diff --git a/staking_deposit/cli/generate_keys.py b/staking_deposit/cli/generate_keys.py index 4caa3b7b..2b009068 100644 --- a/staking_deposit/cli/generate_keys.py +++ b/staking_deposit/cli/generate_keys.py @@ -33,7 +33,7 @@ ) from staking_deposit.settings import ( ALL_CHAINS, - MAINNET, + LUKSO, PRATER, get_chain_setting, ) @@ -83,7 +83,7 @@ def generate_keys_arguments_decorator(function: Callable[..., Any]) -> Callable[ list(ALL_CHAINS.keys()) ), ), - default=MAINNET, + default=LUKSO, help=lambda: load_text(['chain', 'help'], func='generate_keys_arguments_decorator'), param_decls='--chain', prompt=choice_prompt_func( @@ -111,6 +111,12 @@ def generate_keys_arguments_decorator(function: Callable[..., Any]) -> Callable[ help=lambda: load_text(['eth1_withdrawal_address', 'help'], func='generate_keys_arguments_decorator'), param_decls='--eth1_withdrawal_address', ), + jit_option( + callback=lambda ctx,param,x: int(x), + default=MAX_DEPOSIT_AMOUNT, + help=('Amount to use in all deposit data files.'), + param_decls='--amount', + ), ] for decorator in reversed(decorators): function = decorator(function) @@ -121,10 +127,10 @@ def generate_keys_arguments_decorator(function: Callable[..., Any]) -> Callable[ @click.pass_context def generate_keys(ctx: click.Context, validator_start_index: int, num_validators: int, folder: str, chain: str, keystore_password: str, - eth1_withdrawal_address: HexAddress, **kwargs: Any) -> None: + amount: int, eth1_withdrawal_address: HexAddress, **kwargs: Any) -> None: mnemonic = ctx.obj['mnemonic'] mnemonic_password = ctx.obj['mnemonic_password'] - amounts = [MAX_DEPOSIT_AMOUNT] * num_validators + amounts = [amount] * num_validators folder = os.path.join(folder, DEFAULT_VALIDATOR_KEYS_FOLDER_NAME) chain_setting = get_chain_setting(chain) if not os.path.exists(folder): diff --git a/staking_deposit/settings.py b/staking_deposit/settings.py index 52a61d0d..f42fc691 100644 --- a/staking_deposit/settings.py +++ b/staking_deposit/settings.py @@ -9,7 +9,9 @@ class BaseChainSetting(NamedTuple): GENESIS_FORK_VERSION: bytes -MAINNET = 'mainnet' +LUKSO = 'lukso' +LUKSO_L16 = 'l16' +MAINNET = 'ethereum' ROPSTEN = 'ropsten' GOERLI = 'goerli' PRATER = 'prater' @@ -17,19 +19,31 @@ class BaseChainSetting(NamedTuple): SEPOLIA = 'sepolia' -# Mainnet setting -MainnetSetting = BaseChainSetting(NETWORK_NAME=MAINNET, GENESIS_FORK_VERSION=bytes.fromhex('00000000')) +# LUKSO mainnet setting +LUKSOSetting = BaseChainSetting( + NETWORK_NAME=LUKSO, GENESIS_FORK_VERSION=bytes.fromhex('38380001')) +# LUKSO L16 testnet setting +LUKSOL16Setting = BaseChainSetting( + NETWORK_NAME=LUKSO_L16, GENESIS_FORK_VERSION=bytes.fromhex('60000069')) +# Ethereum Mainnet setting +MainnetSetting = BaseChainSetting( + NETWORK_NAME=MAINNET, GENESIS_FORK_VERSION=bytes.fromhex('00000000')) # Ropsten setting -RopstenSetting = BaseChainSetting(NETWORK_NAME=ROPSTEN, GENESIS_FORK_VERSION=bytes.fromhex('80000069')) +RopstenSetting = BaseChainSetting( + NETWORK_NAME=ROPSTEN, GENESIS_FORK_VERSION=bytes.fromhex('80000069')) # Goerli setting -GoerliSetting = BaseChainSetting(NETWORK_NAME=GOERLI, GENESIS_FORK_VERSION=bytes.fromhex('00001020')) +GoerliSetting = BaseChainSetting( + NETWORK_NAME=GOERLI, GENESIS_FORK_VERSION=bytes.fromhex('00001020')) # Merge Testnet (spec v1.1.9) -KilnSetting = BaseChainSetting(NETWORK_NAME=KILN, GENESIS_FORK_VERSION=bytes.fromhex('70000069')) +KilnSetting = BaseChainSetting( + NETWORK_NAME=KILN, GENESIS_FORK_VERSION=bytes.fromhex('70000069')) # Sepolia setting -SepoliaSetting = BaseChainSetting(NETWORK_NAME=SEPOLIA, GENESIS_FORK_VERSION=bytes.fromhex('90000069')) - +SepoliaSetting = BaseChainSetting( + NETWORK_NAME=SEPOLIA, GENESIS_FORK_VERSION=bytes.fromhex('90000069')) ALL_CHAINS: Dict[str, BaseChainSetting] = { + LUKSO: LUKSOSetting, # Due to change when mainnet is launched + LUKSO_L16: LUKSOL16Setting, MAINNET: MainnetSetting, ROPSTEN: RopstenSetting, GOERLI: GoerliSetting,