Skip to content

Commit

Permalink
Load libp2p private key from custom location if present
Browse files Browse the repository at this point in the history
  • Loading branch information
Tumas committed Aug 30, 2024
1 parent fa5e309 commit c7d0990
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion eth2_libp2p
6 changes: 6 additions & 0 deletions grandine/src/grandine_args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,10 @@ struct NetworkConfigOptions {
#[clap(long, value_delimiter = ',')]
libp2p_nodes: Vec<Multiaddr>,

/// Load p2p private key from KEY_FILE
#[clap(long, value_name = "KEY_FILE")]
libp2p_private_key_file: Option<PathBuf>,

/// Target number of network peers
#[clap(long, default_value_t = DEFAULT_TARGET_PEERS)]
target_peers: usize,
Expand Down Expand Up @@ -502,6 +506,7 @@ impl NetworkConfigOptions {
enr_quic_port_ipv6,
boot_nodes,
libp2p_nodes,
libp2p_private_key_file,
target_peers,
target_subnet_peers,
trusted_peers,
Expand All @@ -521,6 +526,7 @@ impl NetworkConfigOptions {
network_config.target_peers = target_peers;
network_config.target_subnet_peers = target_subnet_peers;
network_config.trusted_peers = trusted_peers;
network_config.libp2p_private_key_file = libp2p_private_key_file;

if let Some(listen_address_ipv6) = listen_address_ipv6 {
network_config.set_ipv4_ipv6_listening_addresses(
Expand Down

0 comments on commit c7d0990

Please sign in to comment.