Add Pyrmont testnet (#1904)

## Issue Addressed

NA

## Proposed Changes

- Replace Zinken with Pyrmont (Zinken has been sun-setted).
- Ensure Mainnet is build in the build script.

## Additional Info

NA
This commit is contained in:
Paul Hauner
2020-11-16 05:11:35 +00:00
parent eb56140582
commit fe71f25c3a
18 changed files with 190 additions and 94 deletions

View File

@@ -1,7 +1,8 @@
//! Downloads a testnet configuration from Github.
use eth2_config::{
altona, medalla, spadina, toledo, zinken, Eth2NetArchiveAndDirectory, GENESIS_FILE_NAME,
altona, mainnet, medalla, pyrmont, spadina, toledo, Eth2NetArchiveAndDirectory,
GENESIS_FILE_NAME,
};
use std::fs::File;
use std::io;
@@ -11,7 +12,8 @@ const ETH2_NET_DIRS: &[Eth2NetArchiveAndDirectory<'static>] = &[
altona::ETH2_NET_DIR,
medalla::ETH2_NET_DIR,
spadina::ETH2_NET_DIR,
zinken::ETH2_NET_DIR,
mainnet::ETH2_NET_DIR,
pyrmont::ETH2_NET_DIR,
toledo::ETH2_NET_DIR,
];
@@ -29,14 +31,14 @@ fn main() {
/// Uncompress the testnet configs archive into a testnet configs folder.
fn uncompress_state(testnet: &Eth2NetArchiveAndDirectory<'static>) -> Result<(), String> {
let archive_path = testnet.genesis_state_archive();
let archive_file = File::open(&archive_path)
.map_err(|e| format!("Failed to open archive file {:?}: {:?}", archive_path, e))?;
let mut archive =
ZipArchive::new(archive_file).map_err(|e| format!("Error with zip file: {}", e))?;
if testnet.genesis_is_known {
let archive_path = testnet.genesis_state_archive();
let archive_file = File::open(&archive_path)
.map_err(|e| format!("Failed to open archive file {:?}: {:?}", archive_path, e))?;
let mut archive =
ZipArchive::new(archive_file).map_err(|e| format!("Error with zip file: {}", e))?;
let mut file = archive.by_name(GENESIS_FILE_NAME).map_err(|e| {
format!(
"Error retrieving file {} inside zip: {}",