hyperdrive icon indicating copy to clipboard operation
hyperdrive copied to clipboard

Unable to open existing hyperdrive with keypair

Open mjp0 opened this issue 5 years ago • 2 comments

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
  })
})

mjp0 avatar Jan 08 '20 08:01 mjp0

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

mafintosh avatar Jan 08 '20 08:01 mafintosh

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

dpaez avatar Jan 10 '20 17:01 dpaez