Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allow reading PeerId from keychain #1552

Merged
merged 2 commits into from Jan 17, 2023

Conversation

achingbrain
Copy link
Member

@achingbrain achingbrain commented Jan 16, 2023

libp2p has a secure keychain where all items are stored in the datastore in an encrypted format, including the PeerId of the current node.

If no PeerId is passed into the factory function, a new PeerId is created for the current node.

Instead, if the factory function is passed a datastore, it should try to read the PeerId from the datastore and only create a new PeerId if the self key is not in the datastore.

libp2p has a secure keychain where all items are stored in the datastore
in an encrypted format, including the PeerId of the current node.

If no PeerId is passed into the factory function, a new PeerId is created
for the current node.

Instead, if the factory function is passed a DataStore, it should try
to read the PeerId from the DataStore and only create a new PeerId if
reading the `self` key fails.
@achingbrain achingbrain merged commit 0831cd9 into master Jan 17, 2023
@achingbrain achingbrain deleted the fix/allow-reading-peer-id-from-keychain branch January 17, 2023 10:11
maschad pushed a commit to maschad/js-libp2p that referenced this pull request Jan 18, 2023
libp2p has a secure keychain where all items are stored in the datastore
in an encrypted format, including the PeerId of the current node.

If no PeerId is passed into the factory function, a new PeerId is created
for the current node.

Instead, if the factory function is passed a DataStore, it should try
to read the PeerId from the DataStore and only create a new PeerId if
reading the `self` key fails.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant