-
Notifications
You must be signed in to change notification settings - Fork 833
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Feature request allow me to initialize the p2p private key file with new flag #7181 #7191
base: unstable
Are you sure you want to change the base?
Conversation
Hello @barnabasbusa @michaelsproul , do check out this pr, once free! |
@@ -178,7 +178,7 @@ impl<E: EthSpec> Network<E> { | |||
let config = ctx.config.clone(); | |||
trace!("Libp2p Service starting"); | |||
// initialise the node's ID | |||
let local_keypair = utils::load_private_key(&config); | |||
let local_keypair = utils::load_private_key(&config, &cli_args); |
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.
Have you run this yourself? cli_args
doesn't exist in this scope, so this should result in a compile error.
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.
Hi @ackintosh , my local pipeline does not works for some reason, but do check out this pr once again, have pushed further changes!
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 heads-up — it’s hard to review if the PR doesn’t compile. Can you make sure everything builds locally before pushing changes?
Hey @barnabasbusa , can you rerun it , i think beside swarm builder rest should be resolved. |
…he-p2p-private-key-file-with-new-flag-sigp#7181
} | ||
local_private_key.into() | ||
let key_path = config.network_dir.join("key"); | ||
load_or_create_keypair(key_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.
It looks like the implementation of load_or_create_keypair
might be missing—did you forget to include it?"
…he-p2p-private-key-file-with-new-flag-sigp#7181
@@ -49,6 +49,7 @@ tracing-subscriber = { workspace = true } | |||
types = { workspace = true } | |||
unsigned-varint = { version = "0.8", features = ["codec"] } | |||
unused_port = { workspace = true } | |||
clap = { version = "4", features = ["derive"] } |
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.
Un-intended change?
pub fn initialize_network(config: NetworkConfig, cli_args: &ArgMatches) { | ||
let local_keypair = utils::load_private_key(&config, cli_args); | ||
} |
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 seems out of place, you don't have access to cli_args here. You should pass CLI data through the network config
Issue Addressed
#7181
##Changes
This PR introduces a new command‑line flag
--p2p-priv-key
that lets users supply a hex‑encoded p2p private key via a file. The key loading function is updated to first check for this flag and decode the hex input, while falling back to the existing binary key file behavior if not provided, and the call sites are updated accordingly.