Add much more progress to new CLI setup

This commit is contained in:
Paul Hauner
2019-08-25 12:14:04 +10:00
parent 7fd7aa2cdb
commit 140c677a38
5 changed files with 214 additions and 81 deletions

View File

@@ -60,9 +60,10 @@ where
T::LmdGhost: LmdGhost<U, V>,
{
let genesis_state = match &config.beacon_chain_start_method {
BeaconChainStartMethod::Resume => {
crit!(log, "This release does not support mainnet genesis state.");
return Err("Mainnet is unsupported".into());
BeaconChainStartMethod::Resume => unimplemented!("No resume code yet"),
BeaconChainStartMethod::Mainnet => {
crit!(log, "No mainnet beacon chain startup specification.");
return Err("Mainnet is not yet specified. We're working on it.".into());
}
BeaconChainStartMethod::RecentGenesis { validator_count } => {
generate_testnet_genesis_state(*validator_count, recent_genesis_time(), &spec)

View File

@@ -37,7 +37,9 @@ pub struct Config {
pub enum BeaconChainStartMethod {
/// Resume from an existing BeaconChain, loaded from the existing local database.
Resume,
/// Create a new beacon chain with `validator_count` validators, all with well-known secret keys.
/// Resume from an existing BeaconChain, loaded from the existing local database.
Mainnet,
/// Create a new beacon chain that can connect to mainnet.
///
/// Set the genesis time to be the start of the previous 30-minute window.
RecentGenesis { validator_count: usize },
@@ -51,10 +53,7 @@ pub enum BeaconChainStartMethod {
Yaml { file: PathBuf },
/// Create a new beacon chain by using a HTTP server (running our REST-API) to load genesis and
/// finalized states and blocks.
HttpBootstrap {
server: String,
port: Option<String>,
},
HttpBootstrap { server: String, port: Option<u16> },
}
impl Default for BeaconChainStartMethod {

View File

@@ -23,7 +23,7 @@ pub use beacon_chain::BeaconChainTypes;
pub use beacon_chain_types::ClientType;
pub use beacon_chain_types::InitialiseBeaconChain;
pub use bootstrapper::Bootstrapper;
pub use config::Config as ClientConfig;
pub use config::{BeaconChainStartMethod, Config as ClientConfig};
pub use eth2_config::Eth2Config;
/// Main beacon node client service. This provides the connection and initialisation of the clients