Merge latest master

This commit is contained in:
Age Manning
2020-05-06 22:12:22 +10:00
42 changed files with 4986 additions and 1488 deletions

View File

@@ -1 +1,2 @@
testnet*
schlesi-*

View File

@@ -1,11 +1,12 @@
/// Pulls down the latest Lighthouse testnet from https://github.com/eth2-clients/eth2-testnets
//! Downloads a testnet configuration from Github.
use reqwest;
use std::env;
use std::fs::File;
use std::io::Write;
use std::path::PathBuf;
const TESTNET_ID: &str = "testnet5";
const TESTNET_ID: &str = "schlesi-v0-11";
fn main() {
if !base_dir().exists() {
@@ -37,16 +38,25 @@ pub fn get_all_files() -> Result<(), String> {
pub fn get_file(filename: &str) -> Result<(), String> {
let url = format!(
"https://raw.githubusercontent.com/eth2-clients/eth2-testnets/master/lighthouse/{}/{}",
TESTNET_ID, filename
"https://raw.githubusercontent.com/goerli/schlesi/839866fe29a1b4df3a87bfe2ff1257c8a58671c9/light/{}",
filename
);
let path = base_dir().join(filename);
let mut file =
File::create(path).map_err(|e| format!("Failed to create {}: {:?}", filename, e))?;
let contents = reqwest::blocking::get(&url)
let request = reqwest::blocking::Client::builder()
.build()
.map_err(|_| "Could not build request client".to_string())?
.get(&url)
.timeout(std::time::Duration::from_secs(120));
let contents = request
.send()
.map_err(|e| format!("Failed to download {}: {}", filename, e))?
.error_for_status()
.map_err(|e| format!("Error downloading {}: {}", filename, e))?
.bytes()
.map_err(|e| format!("Failed to read {} response bytes: {}", filename, e))?;

View File

@@ -20,11 +20,14 @@ pub const BOOT_ENR_FILE: &str = "boot_enr.yaml";
pub const GENESIS_STATE_FILE: &str = "genesis.ssz";
pub const YAML_CONFIG_FILE: &str = "config.yaml";
pub const HARDCODED_YAML_CONFIG: &[u8] = include_bytes!("../testnet5/config.yaml");
pub const HARDCODED_DEPLOY_BLOCK: &[u8] = include_bytes!("../testnet5/deploy_block.txt");
pub const HARDCODED_DEPOSIT_CONTRACT: &[u8] = include_bytes!("../testnet5/deposit_contract.txt");
pub const HARDCODED_GENESIS_STATE: &[u8] = include_bytes!("../testnet5/genesis.ssz");
pub const HARDCODED_BOOT_ENR: &[u8] = include_bytes!("../testnet5/boot_enr.yaml");
pub const HARDCODED_TESTNET: &str = "schlesi-v0-11";
pub const HARDCODED_YAML_CONFIG: &[u8] = include_bytes!("../schlesi-v0-11/config.yaml");
pub const HARDCODED_DEPLOY_BLOCK: &[u8] = include_bytes!("../schlesi-v0-11/deploy_block.txt");
pub const HARDCODED_DEPOSIT_CONTRACT: &[u8] =
include_bytes!("../schlesi-v0-11/deposit_contract.txt");
pub const HARDCODED_GENESIS_STATE: &[u8] = include_bytes!("../schlesi-v0-11/genesis.ssz");
pub const HARDCODED_BOOT_ENR: &[u8] = include_bytes!("../schlesi-v0-11/boot_enr.yaml");
/// Specifies an Eth2 testnet.
///