-
Notifications
You must be signed in to change notification settings - Fork 809
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Issue Addressed Resolves #2094 ## Proposed Changes Fixes scripts for creating local testnets. Adds an option in `lighthouse boot_node` to run with a previously generated enr.
- Loading branch information
1 parent
9eb1945
commit 95a3622
Showing
18 changed files
with
359 additions
and
140 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
use clap::ArgMatches; | ||
use environment::Environment; | ||
use types::EthSpec; | ||
|
||
use web3::{transports::Http, Web3}; | ||
|
||
pub fn run<T: EthSpec>(env: Environment<T>, matches: &ArgMatches<'_>) -> Result<(), String> { | ||
let eth1_http: String = clap_utils::parse_required(matches, "eth1-http")?; | ||
let confirmations: usize = clap_utils::parse_required(matches, "confirmations")?; | ||
let validator_count: Option<usize> = clap_utils::parse_optional(matches, "validator-count")?; | ||
|
||
let transport = | ||
Http::new(ð1_http).map_err(|e| format!("Unable to connect to eth1 HTTP: {:?}", e))?; | ||
let web3 = Web3::new(transport); | ||
|
||
env.runtime().block_on(async { | ||
let contract = eth1_test_rig::DepositContract::deploy(web3, confirmations, None) | ||
.await | ||
.map_err(|e| format!("Failed to deploy deposit contract: {:?}", e))?; | ||
|
||
println!("Deposit contract address: {:?}", contract.address()); | ||
|
||
// Deposit insecure validators to the deposit contract created | ||
if let Some(validator_count) = validator_count { | ||
let amount = env.eth2_config.spec.max_effective_balance; | ||
for i in 0..validator_count { | ||
println!("Submitting deposit for validator {}...", i); | ||
contract.deposit_deterministic_async::<T>(i, amount).await?; | ||
} | ||
} | ||
Ok(()) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.