hyperdrive
hyperdrive copied to clipboard
Unable to open existing hyperdrive with keypair
I'm unable to open existing hyperdrive with keypair generated by hypercore-crypto. According to @mafintosh this is a regression.
const hyperdrive = require('hyperdrive')
const crypto = require('hypercore-crypto')
const keyPair = crypto.keyPair()
const d1 = hyperdrive('./test', keyPair.publicKey.toString('hex'), { keyPair })
d1.ready(() => {
d1.close()
const d2 = hyperdrive('./test', keyPair.publicKey.toString('hex'), { keyPair })
d2.ready(() => {
console.log(d2.writable) // should be true
})
})
I did some probing on this yesterday and note that the first archive here is not writable as well (d1) so we prob loose the keypair somewhere or we don't support it anymore due corestore upgrades
I think we are having this same issue on the p2pcommons SDK while we are trying to update to the latest hyperdrive version (we are also using it together with mirror-folder).
I've added a skipped test from hyperdrive codebase to @geut/hyperdrive-promise, this test reflects the same case that @markopolojarvi is exposing above. https://github.com/geut/hyperdrive-promise/pull/10/files#diff-e2686e2925145c11799d638b2f4706dcR106