mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-09 11:41:51 +00:00
Configuration updates allow for verbosity CLI flag and spec constants
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
use crate::Eth2Config;
|
||||
use clap::ArgMatches;
|
||||
use http_server::HttpServerConfig;
|
||||
use network::NetworkConfig;
|
||||
@@ -56,8 +57,6 @@ impl Default for Config {
|
||||
log_file: PathBuf::from(""),
|
||||
db_type: "disk".to_string(),
|
||||
db_name: "chain_db".to_string(),
|
||||
// Note: there are no default bootnodes specified.
|
||||
// Once bootnodes are established, add them here.
|
||||
network: NetworkConfig::new(),
|
||||
rpc: rpc::RPCConfig::default(),
|
||||
http: HttpServerConfig::default(),
|
||||
@@ -129,6 +128,15 @@ impl Config {
|
||||
self.data_dir = PathBuf::from(dir);
|
||||
};
|
||||
|
||||
if let Some(default_spec) = args.value_of("default-spec") {
|
||||
match default_spec {
|
||||
"mainnet" => self.spec_constants = Eth2Config::mainnet().spec_constants,
|
||||
"minimal" => self.spec_constants = Eth2Config::minimal().spec_constants,
|
||||
"interop" => self.spec_constants = Eth2Config::interop().spec_constants,
|
||||
_ => {} // not supported
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(dir) = args.value_of("db") {
|
||||
self.db_type = dir.to_string();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user