Update testnet tooling (#1001)

* Add progress on new deposits

* Add deposited command to account manager

* Remove old lcli::helpers mod

* Clean clap_utils

* Refactor lcli deposit contract commands to use IPC

* Make testnet optional for environment

* Use dbg formatting for deploy address

* Add command to generate bootnode enr

* Ensure lcli returns with 1 on error

* Ensure account manager returns 1 on error

* Disallow deposits to the zero address

* Update web3 in eth1 crate

* Ensure correct lighthouse dir is created

* Reduce deposit gas requirement

* Update cargo.lock

* Add progress on new deposits

* Add deposited command to account manager

* Remove old lcli::helpers mod

* Clean clap_utils

* Refactor lcli deposit contract commands to use IPC

* Add command to generate bootnode enr

* Ensure lcli returns with 1 on error

* Ensure account manager returns 1 on error

* Update web3 in eth1 crate

* Update Cargo.lock

* Move lcli out of main install script

* Change --limit to --at-least

* Change --datadir to --validator-dir

* Remove duplication in docs
This commit is contained in:
Paul Hauner
2020-04-19 12:20:43 +10:00
committed by GitHub
parent f9e8dad1fb
commit 7b86c9a08f
30 changed files with 711 additions and 304 deletions

View File

@@ -28,6 +28,7 @@ pub struct EnvironmentBuilder<E: EthSpec> {
log: Option<Logger>,
eth_spec_instance: E,
eth2_config: Eth2Config,
testnet: Option<Eth2TestnetConfig<E>>,
}
impl EnvironmentBuilder<MinimalEthSpec> {
@@ -38,6 +39,7 @@ impl EnvironmentBuilder<MinimalEthSpec> {
log: None,
eth_spec_instance: MinimalEthSpec,
eth2_config: Eth2Config::minimal(),
testnet: None,
}
}
}
@@ -50,6 +52,7 @@ impl EnvironmentBuilder<MainnetEthSpec> {
log: None,
eth_spec_instance: MainnetEthSpec,
eth2_config: Eth2Config::mainnet(),
testnet: None,
}
}
}
@@ -62,6 +65,7 @@ impl EnvironmentBuilder<InteropEthSpec> {
log: None,
eth_spec_instance: InteropEthSpec,
eth2_config: Eth2Config::interop(),
testnet: None,
}
}
}
@@ -140,7 +144,7 @@ impl<E: EthSpec> EnvironmentBuilder<E> {
/// Setups eth2 config using the CLI arguments.
pub fn eth2_testnet_config(
mut self,
eth2_testnet_config: &Eth2TestnetConfig<E>,
eth2_testnet_config: Eth2TestnetConfig<E>,
) -> Result<Self, String> {
// Create a new chain spec from the default configuration.
self.eth2_config.spec = eth2_testnet_config
@@ -155,6 +159,8 @@ impl<E: EthSpec> EnvironmentBuilder<E> {
)
})?;
self.testnet = Some(eth2_testnet_config);
Ok(self)
}
@@ -169,6 +175,7 @@ impl<E: EthSpec> EnvironmentBuilder<E> {
.ok_or_else(|| "Cannot build environment without log".to_string())?,
eth_spec_instance: self.eth_spec_instance,
eth2_config: self.eth2_config,
testnet: self.testnet,
})
}
}
@@ -211,6 +218,7 @@ pub struct Environment<E: EthSpec> {
log: Logger,
eth_spec_instance: E,
pub eth2_config: Eth2Config,
pub testnet: Option<Eth2TestnetConfig<E>>,
}
impl<E: EthSpec> Environment<E> {