mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-08 09:16:00 +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:
@@ -1,15 +1,9 @@
|
||||
//! Extracts zipped genesis states on first run.
|
||||
use eth2_config::{mainnet, prater, pyrmont, Eth2NetArchiveAndDirectory, GENESIS_FILE_NAME};
|
||||
use eth2_config::{Eth2NetArchiveAndDirectory, ETH2_NET_DIRS, GENESIS_FILE_NAME};
|
||||
use std::fs::File;
|
||||
use std::io;
|
||||
use zip::ZipArchive;
|
||||
|
||||
const ETH2_NET_DIRS: &[Eth2NetArchiveAndDirectory<'static>] = &[
|
||||
mainnet::ETH2_NET_DIR,
|
||||
pyrmont::ETH2_NET_DIR,
|
||||
prater::ETH2_NET_DIR,
|
||||
];
|
||||
|
||||
fn main() {
|
||||
for network in ETH2_NET_DIRS {
|
||||
match uncompress_state(network) {
|
||||
|
||||
Reference in New Issue
Block a user