staking-deposit-cli/eth2deposit/settings.py

50 lines
1.6 KiB
Python
Raw Normal View History

from typing import Dict, NamedTuple
2020-11-17 16:14:34 +00:00
DEPOSIT_CLI_VERSION = '1.1.0'
class BaseChainSetting(NamedTuple):
ETH2_NETWORK_NAME: str
GENESIS_FORK_VERSION: bytes
2020-06-25 03:42:03 +00:00
MAINNET = 'mainnet'
WITTI = 'witti'
ALTONA = 'altona'
MEDALLA = 'medalla'
SPADINA = 'spadina'
ZINKEN = 'zinken'
PYRMONT = 'pyrmont'
# Eth2 Mainnet setting
MainnetSetting = BaseChainSetting(ETH2_NETWORK_NAME=MAINNET, GENESIS_FORK_VERSION=bytes.fromhex('00000000'))
2020-05-26 08:13:12 +00:00
# Eth2 spec v0.11.3 testnet
WittiSetting = BaseChainSetting(ETH2_NETWORK_NAME=WITTI, GENESIS_FORK_VERSION=bytes.fromhex('00000113'))
2020-06-25 03:23:00 +00:00
# Eth2 spec v0.12.1 testnet
AltonaSetting = BaseChainSetting(ETH2_NETWORK_NAME=ALTONA, GENESIS_FORK_VERSION=bytes.fromhex('00000121'))
2020-07-23 08:01:15 +00:00
# Eth2 "official" public testnet (spec v0.12.2)
MedallaSetting = BaseChainSetting(ETH2_NETWORK_NAME=MEDALLA, GENESIS_FORK_VERSION=bytes.fromhex('00000001'))
2020-09-30 02:00:59 +00:00
# Eth2 "dress rehearsal" testnet (spec v0.12.3)
SpadinaSetting = BaseChainSetting(ETH2_NETWORK_NAME=SPADINA, GENESIS_FORK_VERSION=bytes.fromhex('00000002'))
2020-09-30 02:00:59 +00:00
# Eth2 "dress rehearsal" testnet (spec v0.12.3)
ZinkenSetting = BaseChainSetting(ETH2_NETWORK_NAME=ZINKEN, GENESIS_FORK_VERSION=bytes.fromhex('00000003'))
# Eth2 pre-launch testnet (spec v1.0.0)
PyrmontSetting = BaseChainSetting(ETH2_NETWORK_NAME=PYRMONT, GENESIS_FORK_VERSION=bytes.fromhex('00002009'))
2020-05-26 08:13:12 +00:00
ALL_CHAINS: Dict[str, BaseChainSetting] = {
MAINNET: MainnetSetting,
2020-05-26 08:13:12 +00:00
WITTI: WittiSetting,
2020-06-25 03:23:00 +00:00
ALTONA: AltonaSetting,
2020-07-23 08:01:15 +00:00
MEDALLA: MedallaSetting,
SPADINA: SpadinaSetting,
2020-09-30 02:00:59 +00:00
ZINKEN: ZinkenSetting,
PYRMONT: PyrmontSetting,
}
def get_chain_setting(chain_name: str = MAINNET) -> BaseChainSetting:
return ALL_CHAINS[chain_name]