staking-deposit-cli/eth2deposit/settings.py

34 lines
883 B
Python
Raw Normal View History

from typing import Dict, NamedTuple
2021-04-02 05:33:24 +00:00
DEPOSIT_CLI_VERSION = '1.2.0'
class BaseChainSetting(NamedTuple):
ETH2_NETWORK_NAME: str
GENESIS_FORK_VERSION: bytes
2020-06-25 03:42:03 +00:00
MAINNET = 'mainnet'
PYRMONT = 'pyrmont'
2021-03-19 12:08:59 +00:00
PRATER = 'prater'
# Eth2 Mainnet setting
MainnetSetting = BaseChainSetting(ETH2_NETWORK_NAME=MAINNET, GENESIS_FORK_VERSION=bytes.fromhex('00000000'))
# Eth2 pre-launch testnet (spec v1.0.0)
PyrmontSetting = BaseChainSetting(ETH2_NETWORK_NAME=PYRMONT, GENESIS_FORK_VERSION=bytes.fromhex('00002009'))
2021-03-19 12:08:59 +00:00
# Eth2 testnet (spec v1.0.1)
PraterSetting = BaseChainSetting(ETH2_NETWORK_NAME=PRATER, GENESIS_FORK_VERSION=bytes.fromhex('00001020'))
2020-05-26 08:13:12 +00:00
ALL_CHAINS: Dict[str, BaseChainSetting] = {
MAINNET: MainnetSetting,
PYRMONT: PyrmontSetting,
2021-03-19 12:08:59 +00:00
PRATER: PraterSetting,
}
def get_chain_setting(chain_name: str = MAINNET) -> BaseChainSetting:
return ALL_CHAINS[chain_name]