Coder Social home page Coder Social logo

Comments (12)

marcus-pousette avatar marcus-pousette commented on June 9, 2024

Also get the same behaviour. Previously by making the datastore persistant the peerid would persist between if recreating the client from the same directory. The new behaviour (since the keychgain no longer is shipped with the client) is that the peer id is not persisted even if that is the case.

Looking at the code that did the peerId load from datastore previously, and now is removed. Perhaps this change of behaviour should be documented in the migration guide on how to recover your previous PeerId given that it will now by default not be exported https://github.com/libp2p/js-libp2p/blob/main/doc/migrations/v0.46-v1.0.0.md#keychain.

Here is the previous code that will allow you to export the PeerId before creating the client, if you want to persist the PeerId. I suggest you to write that as pre-loading step before creating your client and pass the peerId to createLibp2p instead.

const datastore = options.datastore as Datastore | undefined

from js-libp2p.

christroutner avatar christroutner commented on June 9, 2024

If the solution is to use the @libp2p/keychain library, I would appreciate a code example on how to generate a key and pass it on to createLibp2p().

If the data is generated by datastore or some other part of libp2p, I just need an example of how to find it and extract it. It's easy enough to write a JSON object to file. I just need some idea of how to go feeding some persisted private key to createLibp2p().

from js-libp2p.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.