mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-27 01:33:33 +00:00
Post merge local testnets (#3807)
## Issue Addressed N/A ## Proposed Changes Modifies the local testnet scripts to start a network with genesis validators embedded into the genesis state. This allows us to start a local testnet without the need for deploying a deposit contract or depositing validators pre-genesis. This also enables us to start a local test network at any fork we want without going through fork transitions. Also adds scripts to start multiple geth clients and peer them with each other and peer the geth clients with beacon nodes to start a post merge local testnet. ## Additional info Adds a new lcli command `mnemonics-validators` that generates validator directories derived from a given mnemonic. Adds a new `derived-genesis-state` option to the `lcli new-testnet` command to generate a genesis state populated with validators derived from a mnemonic.
This commit is contained in:
@@ -10,6 +10,7 @@ mod generate_bootnode_enr;
|
||||
mod indexed_attestations;
|
||||
mod insecure_validators;
|
||||
mod interop_genesis;
|
||||
mod mnemonic_validators;
|
||||
mod new_testnet;
|
||||
mod parse_ssz;
|
||||
mod replace_state_pubkeys;
|
||||
@@ -449,6 +450,22 @@ fn main() {
|
||||
"If present, a interop-style genesis.ssz file will be generated.",
|
||||
),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("derived-genesis-state")
|
||||
.long("derived-genesis-state")
|
||||
.takes_value(false)
|
||||
.help(
|
||||
"If present, a genesis.ssz file will be generated with keys generated from a given mnemonic.",
|
||||
),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("mnemonic-phrase")
|
||||
.long("mnemonic-phrase")
|
||||
.value_name("MNEMONIC_PHRASE")
|
||||
.takes_value(true)
|
||||
.requires("derived-genesis-state")
|
||||
.help("The mnemonic with which we generate the validator keys for a derived genesis state"),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("min-genesis-time")
|
||||
.long("min-genesis-time")
|
||||
@@ -568,14 +585,32 @@ fn main() {
|
||||
),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("merge-fork-epoch")
|
||||
.long("merge-fork-epoch")
|
||||
Arg::with_name("bellatrix-fork-epoch")
|
||||
.long("bellatrix-fork-epoch")
|
||||
.value_name("EPOCH")
|
||||
.takes_value(true)
|
||||
.help(
|
||||
"The epoch at which to enable the Merge hard fork",
|
||||
),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("capella-fork-epoch")
|
||||
.long("capella-fork-epoch")
|
||||
.value_name("EPOCH")
|
||||
.takes_value(true)
|
||||
.help(
|
||||
"The epoch at which to enable the Capella hard fork",
|
||||
),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("ttd")
|
||||
.long("ttd")
|
||||
.value_name("TTD")
|
||||
.takes_value(true)
|
||||
.help(
|
||||
"The terminal total difficulty",
|
||||
),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("eth1-block-hash")
|
||||
.long("eth1-block-hash")
|
||||
@@ -695,6 +730,7 @@ fn main() {
|
||||
.long("count")
|
||||
.value_name("COUNT")
|
||||
.takes_value(true)
|
||||
.required(true)
|
||||
.help("Produces validators in the range of 0..count."),
|
||||
)
|
||||
.arg(
|
||||
@@ -702,6 +738,7 @@ fn main() {
|
||||
.long("base-dir")
|
||||
.value_name("BASE_DIR")
|
||||
.takes_value(true)
|
||||
.required(true)
|
||||
.help("The base directory where validator keypairs and secrets are stored"),
|
||||
)
|
||||
.arg(
|
||||
@@ -712,6 +749,43 @@ fn main() {
|
||||
.help("The number of nodes to divide the validator keys to"),
|
||||
)
|
||||
)
|
||||
.subcommand(
|
||||
SubCommand::with_name("mnemonic-validators")
|
||||
.about("Produces validator directories by deriving the keys from \
|
||||
a mnemonic. For testing purposes only, DO NOT USE IN \
|
||||
PRODUCTION!")
|
||||
.arg(
|
||||
Arg::with_name("count")
|
||||
.long("count")
|
||||
.value_name("COUNT")
|
||||
.takes_value(true)
|
||||
.required(true)
|
||||
.help("Produces validators in the range of 0..count."),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("base-dir")
|
||||
.long("base-dir")
|
||||
.value_name("BASE_DIR")
|
||||
.takes_value(true)
|
||||
.required(true)
|
||||
.help("The base directory where validator keypairs and secrets are stored"),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("node-count")
|
||||
.long("node-count")
|
||||
.value_name("NODE_COUNT")
|
||||
.takes_value(true)
|
||||
.help("The number of nodes to divide the validator keys to"),
|
||||
)
|
||||
.arg(
|
||||
Arg::with_name("mnemonic-phrase")
|
||||
.long("mnemonic-phrase")
|
||||
.value_name("MNEMONIC_PHRASE")
|
||||
.takes_value(true)
|
||||
.required(true)
|
||||
.help("The mnemonic with which we generate the validator keys"),
|
||||
)
|
||||
)
|
||||
.subcommand(
|
||||
SubCommand::with_name("indexed-attestations")
|
||||
.about("Convert attestations to indexed form, using the committees from a state.")
|
||||
@@ -853,6 +927,8 @@ fn run<T: EthSpec>(
|
||||
.map_err(|e| format!("Failed to run generate-bootnode-enr command: {}", e)),
|
||||
("insecure-validators", Some(matches)) => insecure_validators::run(matches)
|
||||
.map_err(|e| format!("Failed to run insecure-validators command: {}", e)),
|
||||
("mnemonic-validators", Some(matches)) => mnemonic_validators::run(matches)
|
||||
.map_err(|e| format!("Failed to run mnemonic-validators command: {}", e)),
|
||||
("indexed-attestations", Some(matches)) => indexed_attestations::run::<T>(matches)
|
||||
.map_err(|e| format!("Failed to run indexed-attestations command: {}", e)),
|
||||
("block-root", Some(matches)) => block_root::run::<T>(env, matches)
|
||||
|
||||
Reference in New Issue
Block a user