Update to latest testnet dir (#1303)
This commit is contained in:
parent
38b9bf98ac
commit
3953204727
2
common/eth2_testnet_config/.gitignore
vendored
2
common/eth2_testnet_config/.gitignore
vendored
@ -1,4 +1,4 @@
|
||||
testnet*
|
||||
schlesi-*
|
||||
witti-*
|
||||
altona
|
||||
altona*
|
||||
|
@ -6,7 +6,7 @@ use std::fs::File;
|
||||
use std::io::Write;
|
||||
use std::path::PathBuf;
|
||||
|
||||
const TESTNET_ID: &str = "altona";
|
||||
const TESTNET_ID: &str = "altona-v2";
|
||||
|
||||
fn main() {
|
||||
if !base_dir().exists() {
|
||||
@ -32,16 +32,14 @@ pub fn get_all_files() -> Result<(), String> {
|
||||
get_file("config.yaml")?;
|
||||
get_file("deploy_block.txt")?;
|
||||
get_file("deposit_contract.txt")?;
|
||||
// TODO: add once we know the genesis state for Altona.
|
||||
//
|
||||
// get_file("genesis.ssz")?;
|
||||
get_file("genesis.ssz")?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn get_file(filename: &str) -> Result<(), String> {
|
||||
let url = format!(
|
||||
"https://raw.githubusercontent.com/sigp/witti/a48ea2d68a87db93aa7fd482461418496ed4347d/altona/lighthouse/{}",
|
||||
"https://raw.githubusercontent.com/sigp/witti/2bab01c2c18aea9f571e79d646acfd34704cbfde/altona/lighthouse/{}",
|
||||
filename
|
||||
);
|
||||
|
||||
|
@ -23,15 +23,13 @@ pub const YAML_CONFIG_FILE: &str = "config.yaml";
|
||||
/// The name of the testnet to hardcode.
|
||||
///
|
||||
/// Should be set to `None` when no existing testnet is compatible with the codebase.
|
||||
pub const HARDCODED_TESTNET: Option<&str> = Some("altona");
|
||||
pub const HARDCODED_TESTNET: Option<&str> = Some("altona-v2");
|
||||
|
||||
pub const HARDCODED_YAML_CONFIG: &[u8] = include_bytes!("../altona/config.yaml");
|
||||
pub const HARDCODED_DEPLOY_BLOCK: &[u8] = include_bytes!("../altona/deploy_block.txt");
|
||||
pub const HARDCODED_DEPOSIT_CONTRACT: &[u8] = include_bytes!("../altona/deposit_contract.txt");
|
||||
// TODO: add once we know the genesis state for Altona.
|
||||
//
|
||||
// pub const HARDCODED_GENESIS_STATE: &[u8] = include_bytes!("../altona/genesis.ssz");
|
||||
pub const HARDCODED_BOOT_ENR: &[u8] = include_bytes!("../altona/boot_enr.yaml");
|
||||
pub const HARDCODED_YAML_CONFIG: &[u8] = include_bytes!("../altona-v2/config.yaml");
|
||||
pub const HARDCODED_DEPLOY_BLOCK: &[u8] = include_bytes!("../altona-v2/deploy_block.txt");
|
||||
pub const HARDCODED_DEPOSIT_CONTRACT: &[u8] = include_bytes!("../altona-v2/deposit_contract.txt");
|
||||
pub const HARDCODED_GENESIS_STATE: &[u8] = include_bytes!("../altona-v2/genesis.ssz");
|
||||
pub const HARDCODED_BOOT_ENR: &[u8] = include_bytes!("../altona-v2/boot_enr.yaml");
|
||||
|
||||
/// Specifies an Eth2 testnet.
|
||||
///
|
||||
@ -62,15 +60,10 @@ impl<E: EthSpec> Eth2TestnetConfig<E> {
|
||||
serde_yaml::from_reader(HARDCODED_BOOT_ENR)
|
||||
.map_err(|e| format!("Unable to parse boot enr: {:?}", e))?,
|
||||
),
|
||||
genesis_state: None,
|
||||
/*
|
||||
* TODO: add once we know the genesis state for Altona.
|
||||
*
|
||||
genesis_state: Some(
|
||||
BeaconState::from_ssz_bytes(HARDCODED_GENESIS_STATE)
|
||||
.map_err(|e| format!("Unable to parse genesis state: {:?}", e))?,
|
||||
),
|
||||
*/
|
||||
yaml_config: Some(
|
||||
serde_yaml::from_reader(HARDCODED_YAML_CONFIG)
|
||||
.map_err(|e| format!("Unable to parse genesis state: {:?}", e))?,
|
||||
@ -227,9 +220,7 @@ mod tests {
|
||||
Eth2TestnetConfig::<E>::hard_coded().expect("should decode hard_coded params")
|
||||
{
|
||||
assert!(dir.boot_enr.is_some());
|
||||
// TODO: add once we know the genesis state for Altona.
|
||||
//
|
||||
// assert!(dir.genesis_state.is_some());
|
||||
assert!(dir.genesis_state.is_some());
|
||||
assert!(dir.yaml_config.is_some());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user