mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-06 18:21:45 +00:00
Adds bootnode CLI parameter
This commit is contained in:
@@ -10,6 +10,7 @@ use std::path::PathBuf;
|
||||
use types::multiaddr::Protocol;
|
||||
use types::multiaddr::ToMultiaddr;
|
||||
use types::ChainSpec;
|
||||
use types::Multiaddr;
|
||||
|
||||
/// Stores the client configuration for this Lighthouse instance.
|
||||
#[derive(Debug, Clone)]
|
||||
@@ -88,6 +89,17 @@ impl ClientConfig {
|
||||
}
|
||||
}
|
||||
|
||||
// Custom bootnodes
|
||||
// TODO: Handle list of addresses
|
||||
if let Some(boot_addresses_str) = args.value_of("boot_nodes") {
|
||||
if let Ok(boot_address) = boot_addresses_str.parse::<Multiaddr>() {
|
||||
config.net_conf.boot_nodes.append(&mut vec![boot_address]);
|
||||
} else {
|
||||
error!(log, "Invalid Bootnode multiaddress"; "Multiaddr" => boot_addresses_str);
|
||||
return Err("Invalid IP Address");
|
||||
}
|
||||
}
|
||||
|
||||
/* Filesystem related arguments */
|
||||
|
||||
// Custom datadir
|
||||
|
||||
Reference in New Issue
Block a user