staking-deposit-cli/eth2deposit/settings.py

31 lines
890 B
Python
Raw Normal View History

from typing import Dict, NamedTuple
class BaseChainSetting(NamedTuple):
GENESIS_FORK_VERSION: bytes
2020-06-25 03:42:03 +00:00
2020-06-25 03:23:00 +00:00
# Eth2 Mainet setting
MainnetSetting = BaseChainSetting(GENESIS_FORK_VERSION=bytes.fromhex('00000000'))
2020-05-26 08:13:12 +00:00
# Eth2 spec v0.11.3 testnet
2020-06-25 03:23:00 +00:00
WittiSetting = BaseChainSetting(GENESIS_FORK_VERSION=bytes.fromhex('00000113'))
# Eth2 spec v0.12.1 testnet
AltonaSetting = BaseChainSetting(GENESIS_FORK_VERSION=bytes.fromhex('00000121'))
2020-07-23 08:01:15 +00:00
# Eth2 "official" public testnet (spec v0.12.2)
MedallaSetting = BaseChainSetting(GENESIS_FORK_VERSION=bytes.fromhex('00000001'))
2020-05-26 08:13:12 +00:00
MAINNET = 'mainnet'
2020-05-26 08:13:12 +00:00
WITTI = 'witti'
2020-06-25 03:23:00 +00:00
ALTONA = 'altona'
2020-07-23 08:01:15 +00:00
MEDALLA = 'medalla'
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,
}
def get_setting(chain_name: str = MAINNET) -> BaseChainSetting:
return ALL_CHAINS[chain_name]