Add Eth2Config to runtime

This commit is contained in:
Paul Hauner
2019-06-08 13:17:03 -04:00
parent fd6766c268
commit d8fc5f31d8
13 changed files with 196 additions and 101 deletions

View File

@@ -4,26 +4,22 @@ use network::NetworkConfig;
use serde_derive::{Deserialize, Serialize};
use std::fs;
use std::path::PathBuf;
use types::ChainSpec;
/// The core configuration of a Lighthouse beacon node.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ClientConfig {
pub data_dir: String,
pub spec_constants: String,
pub db_type: String,
db_name: String,
pub network: network::NetworkConfig,
pub rpc: rpc::RPCConfig,
pub http: HttpServerConfig, //pub ipc_conf:
pub spec: ChainSpec,
pub http: HttpServerConfig,
}
impl Default for ClientConfig {
fn default() -> Self {
Self {
data_dir: ".lighthouse".to_string(),
spec_constants: "testnet".to_string(),
db_type: "disk".to_string(),
db_name: "chain_db".to_string(),
// Note: there are no default bootnodes specified.
@@ -31,7 +27,6 @@ impl Default for ClientConfig {
network: NetworkConfig::new(vec![]),
rpc: rpc::RPCConfig::default(),
http: HttpServerConfig::default(),
spec: ChainSpec::minimal(),
}
}
}