-
Notifications
You must be signed in to change notification settings - Fork 50
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
Support for swarm keys #172
Conversation
Current ci failures in travis are due to npm rebuilding their search index. |
*/ | ||
swarmKey (callback) { | ||
const swarmKeyKey = new Key('swarm.key') | ||
this.root.get(swarmKeyKey, (err, swarmKeyBuffer) => { |
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.
All keys should be on 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.
@richardschneider this implementation is based off of the current implementation for private network keys in go, https://github.com/ipfs/go-ipfs/blob/07feeec9c4f40f59efb57d7e16739a35b4c42d5b/repo/fsrepo/fsrepo.go#L681-L695, which are not store in the key store.
Looking at the keychain it doesn't look like it currently has the ability to store this key type. Here is the working private network spec for reference https://github.com/libp2p/specs/blob/b1365bedcd46442074fbf96610f66b0663be088a/pnet/Private-Networks-PSK-V1.md
846cef3
to
faacb30
Compare
License: MIT Signed-off-by: Jacob Heun <jacobheun@gmail.com>
@jacobheun what's missing to land this? |
@daviddias we need to confirm the path forward, given the concern that this is not leveraging the libp2p Keystore. There are two primary options as I see it: Behave like go-ipfs
Use the Keystore
IMO, we should match go-ipfs and do option 2. Additionally, we should open an issue to discuss migrating both implementations to using the Keystore in the future, as that should be the approach we use long term. Just a note, it is possible to privatize js-ipfs today, as libp2p can programmatically be customized, however, it can't be done using just the CLI client. cc: @alanshaw |
+1 |
@jacobheun do we still need this PR? |
No, we have the ability to create pnets by customizing libp2p in js-ipfs. If we want to support that being built in by just adding a swarm.key file, we can modify js-ipfs to check for the existence of the key on boot. Closing this. |
This gives ipfs-repo the ability to return swarm.key files that are stored in its root. This is necessary for autostarting an ipfs node with a private network swarm.
This will make it possible to implement the pnet protector in js-ipfs.