Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

feat: Allow pregenerated ids #1485

Merged
merged 3 commits into from
Aug 29, 2018
Merged

feat: Allow pregenerated ids #1485

merged 3 commits into from
Aug 29, 2018

Conversation

mkg20001
Copy link
Contributor

@mkg20001 mkg20001 commented Aug 4, 2018

@mkg20001 mkg20001 force-pushed the feat/pregen-ids branch 2 times, most recently from 3beef19 to d5c7aa5 Compare August 4, 2018 12:39
opts.log(`generating ${opts.bits}-bit RSA keypair...`, false)
self.log('generating peer id: %s bits', opts.bits)
peerId.create({ bits: opts.bits }, cb)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of calling it "pregen ID", just say that it takes a Private Key.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And make it an option and not a env variable.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for an option. i.e. a top level privateKey option to the constructor that you can also pass as a CLI option --private-key=....

Also needs to be documented in the README.

opts.log(`generating ${opts.bits}-bit RSA keypair...`, false)
self.log('generating peer id: %s bits', opts.bits)
peerId.create({ bits: opts.bits }, cb)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for an option. i.e. a top level privateKey option to the constructor that you can also pass as a CLI option --private-key=....

Also needs to be documented in the README.

Copy link
Member

@alanshaw alanshaw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mkg20001 could you add a test here to ensure the passed private key is used? Apologies I should have raised this in the previous review.

@mkg20001
Copy link
Contributor Author

@alanshaw Added test

@mkg20001
Copy link
Contributor Author

Also the --private-key option would be needed in go-ipfs, too.

@Mr0grog
Copy link
Contributor

Mr0grog commented Aug 16, 2018

I know I’m way late to this, but reading it, I worry that it won’t be clear that the private key is being used to generate a peer ID here (as opposed to, say, encrypting the repo contents on disk or something).

At the very least, I think it would be really helpful to state that this is the key for generating a peer ID in the README & CLI help. I’m kind of wondering if a different name for the option might be better, though, like peerIdKey or something :\

@daviddias daviddias added the status/ready Ready to be worked label Aug 25, 2018
@ghost ghost assigned alanshaw Aug 28, 2018
@ghost ghost added status/in-progress In progress and removed status/ready Ready to be worked labels Aug 28, 2018
@alanshaw
Copy link
Member

@mkg20001 I have rebased and tweaked the README a little - hope that's ok :D

Lets get CI green and then get this merged!

@alanshaw
Copy link
Member

@Mr0grog IMHO just private-key is ok here since it is the private key for your IPFS node.

@alanshaw alanshaw merged commit 61b91f8 into ipfs:master Aug 29, 2018
@ghost ghost removed the status/in-progress In progress label Aug 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants