mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-29 02:33:48 +00:00
Improve ergonomics of adding a new network config (#2489)
## Issue Addressed
NA
## Proposed Changes
This PR adds some more fancy macro magic to make it easier to add a new built-in (aka "baked-in") testnet config to the `lighthouse` binary.
Previously, a user needed to modify several files and repeat themselves several times. Now, they only need to add a single definition in the `eth2_config` crate. No repetition 🎉
This commit is contained in:
@@ -8,7 +8,7 @@ use clap_utils::flags::DISABLE_MALLOC_TUNING_FLAG;
|
||||
use env_logger::{Builder, Env};
|
||||
use environment::EnvironmentBuilder;
|
||||
use eth2_hashing::have_sha_extensions;
|
||||
use eth2_network_config::{Eth2NetworkConfig, DEFAULT_HARDCODED_NETWORK};
|
||||
use eth2_network_config::{Eth2NetworkConfig, DEFAULT_HARDCODED_NETWORK, HARDCODED_NET_NAMES};
|
||||
use lighthouse_version::VERSION;
|
||||
use malloc_utils::configure_memory_allocator;
|
||||
use slog::{crit, info, warn};
|
||||
@@ -127,7 +127,7 @@ fn main() {
|
||||
.long("network")
|
||||
.value_name("network")
|
||||
.help("Name of the Eth2 chain Lighthouse will sync and follow.")
|
||||
.possible_values(&["pyrmont", "mainnet", "prater"])
|
||||
.possible_values(HARDCODED_NET_NAMES)
|
||||
.conflicts_with("testnet-dir")
|
||||
.takes_value(true)
|
||||
.global(true)
|
||||
|
||||
Reference in New Issue
Block a user