2020-05-23 16:19:41 +00:00
|
|
|
from typing import Dict, NamedTuple
|
|
|
|
|
|
|
|
|
2022-02-02 22:22:22 +00:00
|
|
|
DEPOSIT_CLI_VERSION = '2.0.0'
|
2020-09-30 18:17:10 +00:00
|
|
|
|
|
|
|
|
2020-05-23 16:19:41 +00:00
|
|
|
class BaseChainSetting(NamedTuple):
|
2021-08-24 12:44:26 +00:00
|
|
|
NETWORK_NAME: str
|
2020-05-23 16:19:41 +00:00
|
|
|
GENESIS_FORK_VERSION: bytes
|
|
|
|
|
2020-06-25 03:42:03 +00:00
|
|
|
|
2020-11-12 16:15:52 +00:00
|
|
|
MAINNET = 'mainnet'
|
2021-03-19 12:08:59 +00:00
|
|
|
PRATER = 'prater'
|
2022-02-02 22:30:20 +00:00
|
|
|
KINTSUGI = 'kintsugi'
|
2022-02-02 22:21:31 +00:00
|
|
|
KILN = 'kiln'
|
2020-11-12 16:15:52 +00:00
|
|
|
|
|
|
|
|
2021-08-24 12:44:26 +00:00
|
|
|
# Mainnet setting
|
|
|
|
MainnetSetting = BaseChainSetting(NETWORK_NAME=MAINNET, GENESIS_FORK_VERSION=bytes.fromhex('00000000'))
|
|
|
|
# Testnet (spec v1.0.1)
|
|
|
|
PraterSetting = BaseChainSetting(NETWORK_NAME=PRATER, GENESIS_FORK_VERSION=bytes.fromhex('00001020'))
|
2022-02-02 22:30:20 +00:00
|
|
|
# Merge Testnet (spec v1.1.4)
|
2022-02-02 22:33:35 +00:00
|
|
|
KintsugiSetting = BaseChainSetting(NETWORK_NAME=KINTSUGI, GENESIS_FORK_VERSION=bytes.fromhex('60000069'))
|
2022-02-02 22:21:31 +00:00
|
|
|
# Merge Testnet (spec v1.1.9)
|
2022-02-02 22:33:35 +00:00
|
|
|
KilnSetting = BaseChainSetting(NETWORK_NAME=KILN, GENESIS_FORK_VERSION=bytes.fromhex('70000069'))
|
2020-09-18 09:23:12 +00:00
|
|
|
|
2020-05-26 08:13:12 +00:00
|
|
|
|
2020-05-23 16:19:41 +00:00
|
|
|
ALL_CHAINS: Dict[str, BaseChainSetting] = {
|
|
|
|
MAINNET: MainnetSetting,
|
2021-03-19 12:08:59 +00:00
|
|
|
PRATER: PraterSetting,
|
2022-02-02 22:30:20 +00:00
|
|
|
KINTSUGI: KintsugiSetting,
|
2022-02-02 22:21:31 +00:00
|
|
|
KILN: KilnSetting,
|
2020-05-23 16:19:41 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-11-12 16:15:52 +00:00
|
|
|
def get_chain_setting(chain_name: str = MAINNET) -> BaseChainSetting:
|
2020-05-23 16:19:41 +00:00
|
|
|
return ALL_CHAINS[chain_name]
|