Add --bootstrap arg to beacon node
This commit is contained in:
parent
c97b3b20cb
commit
fda208b103
@ -22,7 +22,7 @@ use tokio::timer::Interval;
|
|||||||
pub use beacon_chain::BeaconChainTypes;
|
pub use beacon_chain::BeaconChainTypes;
|
||||||
pub use beacon_chain_types::ClientType;
|
pub use beacon_chain_types::ClientType;
|
||||||
pub use beacon_chain_types::InitialiseBeaconChain;
|
pub use beacon_chain_types::InitialiseBeaconChain;
|
||||||
pub use config::Config as ClientConfig;
|
pub use config::{Config as ClientConfig, GenesisState};
|
||||||
pub use eth2_config::Eth2Config;
|
pub use eth2_config::Eth2Config;
|
||||||
|
|
||||||
/// Main beacon node client service. This provides the connection and initialisation of the clients
|
/// Main beacon node client service. This provides the connection and initialisation of the clients
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
mod run;
|
mod run;
|
||||||
|
|
||||||
use clap::{App, Arg};
|
use clap::{App, Arg};
|
||||||
use client::{ClientConfig, Eth2Config};
|
use client::{ClientConfig, Eth2Config, GenesisState};
|
||||||
use env_logger::{Builder, Env};
|
use env_logger::{Builder, Env};
|
||||||
use eth2_config::{read_from_file, write_to_file};
|
use eth2_config::{read_from_file, write_to_file};
|
||||||
use slog::{crit, o, warn, Drain, Level};
|
use slog::{crit, o, warn, Drain, Level};
|
||||||
@ -200,6 +200,16 @@ fn main() {
|
|||||||
.help("Sets the verbosity level")
|
.help("Sets the verbosity level")
|
||||||
.takes_value(true),
|
.takes_value(true),
|
||||||
)
|
)
|
||||||
|
/*
|
||||||
|
* Bootstrap.
|
||||||
|
*/
|
||||||
|
.arg(
|
||||||
|
Arg::with_name("bootstrap")
|
||||||
|
.long("bootstrap")
|
||||||
|
.value_name("HTTP_SERVER")
|
||||||
|
.help("Load the genesis state and libp2p address from the HTTP API of another Lighthouse node.")
|
||||||
|
.takes_value(true)
|
||||||
|
)
|
||||||
.get_matches();
|
.get_matches();
|
||||||
|
|
||||||
// build the initial logger
|
// build the initial logger
|
||||||
@ -288,6 +298,13 @@ fn main() {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// If the `--bootstrap` flag is provided, overwrite the default configuration.
|
||||||
|
if let Some(server) = matches.value_of("bootstrap") {
|
||||||
|
client_config.genesis_state = GenesisState::HttpBootstrap {
|
||||||
|
server: server.to_string(),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
let eth2_config_path = data_dir.join(ETH2_CONFIG_FILENAME);
|
let eth2_config_path = data_dir.join(ETH2_CONFIG_FILENAME);
|
||||||
|
|
||||||
// Initialise the `Eth2Config`.
|
// Initialise the `Eth2Config`.
|
||||||
|
Loading…
Reference in New Issue
Block a user