forked from sigp/lighthouse
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commit 0204647 Merge: 405a612 1c507c5 Author: pawan <[email protected]> Date: Tue Mar 2 19:49:35 2021 +0530 Merge branch 'unstable' into local-testnet commit 405a612 Author: pawan <[email protected]> Date: Tue Mar 2 19:48:06 2021 +0530 Fix script commit d99dc06 Author: pawan <[email protected]> Date: Mon Mar 1 13:13:01 2021 +0530 more lint commit 6203a3c Merge: 79c410d ed9b245 Author: pawan <[email protected]> Date: Mon Mar 1 12:09:55 2021 +0530 Merge branch 'unstable' into local-testnet commit 79c410d Author: pawan <[email protected]> Date: Mon Mar 1 12:06:49 2021 +0530 Fix lint commit 672def5 Author: pawan <[email protected]> Date: Sat Feb 27 00:11:41 2021 +0530 Minor fixes commit 0a37e04 Author: pawan <[email protected]> Date: Sat Feb 27 00:07:16 2021 +0530 Fix docs; add comments commit 2b18c9c Author: pawan <[email protected]> Date: Fri Feb 26 22:55:42 2021 +0530 Add eth1 params for testnet config commit 351fe1c Author: pawan <[email protected]> Date: Fri Feb 26 16:34:47 2021 +0530 Tidy commit 689c8f9 Author: pawan <[email protected]> Date: Fri Feb 26 02:36:16 2021 +0530 Working setup commit b90fc07 Author: pawan <[email protected]> Date: Fri Feb 26 00:36:46 2021 +0530 lighthouse boot_node can take an enr commit 5899bce Author: pawan <[email protected]> Date: Thu Feb 25 22:31:35 2021 +0530 Modify insecure_validators to support separate datadirs commit d8a6e67 Author: pawan <[email protected]> Date: Thu Feb 25 21:09:30 2021 +0530 Refactor to use web3 commit bfea81c Author: pawan <[email protected]> Date: Thu Feb 25 20:29:10 2021 +0530 Add deposit insecure validators subcommand commit de25370 Author: pawan <[email protected]> Date: Thu Feb 25 19:30:56 2021 +0530 Use fewer crates commit 7950fb1 Author: pawan <[email protected]> Date: Thu Feb 25 19:23:28 2021 +0530 Add deploy_deposit_contract method
- Loading branch information
1 parent
ba7bc2f
commit 2cc68d8
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.