-
Notifications
You must be signed in to change notification settings - Fork 164
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
File path support for p2p private key #1904
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1904 +/- ##
==========================================
- Coverage 75.51% 75.44% -0.08%
==========================================
Files 100 100
Lines 8982 9003 +21
==========================================
+ Hits 6783 6792 +9
- Misses 1599 1605 +6
- Partials 600 606 +6 ☔ View full report in Codecov by Sentry. |
cmd/juno/juno.go
Outdated
@@ -148,7 +149,7 @@ const ( | |||
"These peers can be either Feeder or regular nodes." | |||
p2pFeederNodeUsage = "EXPERIMENTAL: Run juno as a feeder node which will only sync from feeder gateway and gossip the new" + | |||
" blocks to the network." | |||
p2pPrivateKeyUsage = "EXPERIMENTAL: Hexadecimal representation of a private key on the Ed25519 elliptic curve." | |||
p2pPrivateKeyUsage = "EXPERIMENTAL: Hexadecimal representation of a private key on the Ed25519 elliptic curve. Also accepts a file path." |
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.
I am unsure whether it is a good idea to have a flag accept 2 different input types.
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.
I see. My thought process is having one flag can abstract out the input process.
That could be confusing. Perhaps it's better to have a separate flag to accept file path for private key. Let me work on that.
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.
There are some conflicts... @weiihann could you rebase and fix those ? :)
ce3e6ac
to
804257b
Compare
ca6c70b
to
2abdcd9
Compare
On a second thought, I find this feature irrelevant as users can just use environment variables. |
Description
This PR adds filepath support to two existing P2P-related tools and flags, namely
genp2pkeypair
and--p2p-private-key
.Example
Command:
juno genp2pkeypair --file nodekey
juno genp2pkeypair
just like before.Command:
juno --p2p-private-key nodekey
nodekey
file.juno --p2p-private-key <private-key>
) just like before.Rationale
It's more of a UX nicety to allow users to generate key pairs in a file and parse the file to use as a private key, rather than having to copy pasting manually.