-
Notifications
You must be signed in to change notification settings - Fork 446
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
chore: integrate libp2p-keychain into js-libp2p (#633) #634
Conversation
8128e6f
to
f8a80e8
Compare
'use strict' | ||
|
||
module.exports = require('./keychain') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
content of src/keychain/keychain
was moved here to be consistent with the rest of the libp2p codebase
f8a80e8
to
a275c78
Compare
Integrates the libp2p-keychain codebase into this repo
a275c78
to
303bbee
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a minor thing around the default configuration, but otherwise this looks good.
src/config.js
Outdated
@@ -17,6 +18,9 @@ const DefaultConfig = { | |||
maxDialsPerPeer: Constants.MAX_PER_PEER_DIALS, | |||
dialTimeout: Constants.DIAL_TIMEOUT | |||
}, | |||
keychain: { | |||
datastore: new MemoryDatastore() | |||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is going to cause us to carry around the MemoryDatastore even if we don't use the keychain. I think we should just default this to null and check the datastore before creating the keychain. There's no real value in a memory datastore for the keychain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are right! just removed it and added a validation. In the docs it is already defined as required
Co-authored-by: Jacob Heun <jacobheun@gmail.com>
dbd3d4f
to
84f1e30
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Integrates the libp2p-keychain codebase into libp2p.keychain.
This is the second part of decoupling #631 and replaces it.