├── .gitignore ├── .gitmodules ├── README.md ├── custom_config_data ├── besu.json ├── boot_cl.txt ├── boot_el.txt ├── boot_enr.txt ├── bootstrap_nodes.txt ├── chainspec.json ├── config.yaml ├── deploy_block.txt ├── deployedContract.sh ├── deposit_contract.txt ├── deposit_contract_block.txt ├── deposit_contract_block_hash.txt ├── genesis.json ├── genesis.ssz ├── genesis_validators_root.txt ├── jwtsecret ├── parsedBeaconState.json ├── password.txt ├── tranches │ └── tranche_0000.txt ├── trusted_setup.json └── trusted_setup.txt ├── docker-compose.yml ├── engram-deposit-cli ├── .circleci │ └── config.yml ├── .dockerignore ├── .gitignore ├── Dockerfile ├── LICENSE ├── Makefile ├── README.md ├── build_configs │ ├── linux │ │ ├── build.spec │ │ └── requirements.txt │ ├── macos │ │ ├── build.spec │ │ └── requirements.txt │ └── windows │ │ ├── build.spec │ │ └── requirements.txt ├── dep.sh ├── deposit.json ├── deposit.sh ├── flake8.ini ├── log.txt ├── mypy.ini ├── requirements.txt ├── requirements_test.txt ├── run.sh ├── setup.py ├── staking_deposit │ ├── __init__.py │ ├── cli │ │ ├── __init__.py │ │ ├── existing_mnemonic.py │ │ ├── generate_bls_to_execution_change.py │ │ ├── generate_keys.py │ │ └── new_mnemonic.py │ ├── credentials.py │ ├── deposit.py │ ├── exceptions.py │ ├── intl │ │ ├── __init__.py │ │ ├── ar │ │ │ ├── cli │ │ │ │ ├── existing_mnemonic.json │ │ │ │ ├── generate_keys.json │ │ │ │ └── new_mnemonic.json │ │ │ ├── credentials.json │ │ │ ├── deposit.json │ │ │ └── utils │ │ │ │ └── validation.json │ │ ├── el │ │ │ ├── cli │ │ │ │ ├── existing_mnemonic.json │ │ │ │ ├── generate_keys.json │ │ │ │ └── new_mnemonic.json │ │ │ ├── credentials.json │ │ │ ├── deposit.json │ │ │ └── utils │ │ │ │ └── validation.json │ │ ├── en │ │ │ ├── cli │ │ │ │ ├── existing_mnemonic.json │ │ │ │ ├── generate_bls_to_execution_change.json │ │ │ │ ├── generate_keys.json │ │ │ │ └── new_mnemonic.json │ │ │ ├── credentials.json │ │ │ ├── deposit.json │ │ │ └── utils │ │ │ │ └── validation.json │ │ ├── fr │ │ │ ├── cli │ │ │ │ ├── existing_mnemonic.json │ │ │ │ ├── generate_keys.json │ │ │ │ └── new_mnemonic.json │ │ │ ├── credentials.json │ │ │ ├── deposit.json │ │ │ └── utils │ │ │ │ └── validation.json │ │ ├── id │ │ │ ├── cli │ │ │ │ ├── existing_mnemonic.json │ │ │ │ ├── generate_keys.json │ │ │ │ └── new_mnemonic.json │ │ │ ├── credentials.json │ │ │ ├── deposit.json │ │ │ └── utils │ │ │ │ └── validation.json │ │ ├── it │ │ │ ├── cli │ │ │ │ ├── existing_mnemonic.json │ │ │ │ ├── generate_keys.json │ │ │ │ └── new_mnemonic.json │ │ │ ├── credentials.json │ │ │ ├── deposit.json │ │ │ └── utils │ │ │ │ └── validation.json │ │ ├── ja │ │ │ ├── cli │ │ │ │ ├── existing_mnemonic.json │ │ │ │ ├── generate_keys.json │ │ │ │ └── new_mnemonic.json │ │ │ ├── credentials.json │ │ │ ├── deposit.json │ │ │ └── utils │ │ │ │ └── validation.json │ │ ├── ko │ │ │ ├── cli │ │ │ │ ├── existing_mnemonic.json │ │ │ │ ├── generate_keys.json │ │ │ │ └── new_mnemonic.json │ │ │ ├── credentials.json │ │ │ ├── deposit.json │ │ │ └── utils │ │ │ │ └── validation.json │ │ ├── pt-BR │ │ │ ├── cli │ │ │ │ ├── existing_mnemonic.json │ │ │ │ ├── generate_keys.json │ │ │ │ └── new_mnemonic.json │ │ │ ├── credentials.json │ │ │ ├── deposit.json │ │ │ └── utils │ │ │ │ └── validation.json │ │ ├── ro │ │ │ ├── cli │ │ │ │ ├── existing_mnemonic.json │ │ │ │ ├── generate_keys.json │ │ │ │ └── new_mnemonic.json │ │ │ ├── credentials.json │ │ │ ├── deposit.json │ │ │ └── utils │ │ │ │ └── validation.json │ │ ├── tr │ │ │ ├── cli │ │ │ │ ├── existing_mnemonic.json │ │ │ │ ├── generate_keys.json │ │ │ │ └── new_mnemonic.json │ │ │ ├── credentials.json │ │ │ ├── deposit.json │ │ │ └── utils │ │ │ │ └── validation.json │ │ └── zh-CN │ │ │ ├── cli │ │ │ ├── existing_mnemonic.json │ │ │ ├── generate_keys.json │ │ │ └── new_mnemonic.json │ │ │ ├── credentials.json │ │ │ ├── deposit.json │ │ │ └── utils │ │ │ └── validation.json │ ├── key_handling │ │ ├── __init__.py │ │ ├── key_derivation │ │ │ ├── __init__.py │ │ │ ├── mnemonic.py │ │ │ ├── path.py │ │ │ ├── tree.py │ │ │ └── word_lists │ │ │ │ ├── chinese_simplified.txt │ │ │ │ ├── chinese_traditional.txt │ │ │ │ ├── czech.txt │ │ │ │ ├── english.txt │ │ │ │ ├── italian.txt │ │ │ │ ├── korean.txt │ │ │ │ ├── portuguese.txt │ │ │ │ └── spanish.txt │ │ └── keystore.py │ ├── settings.py │ └── utils │ │ ├── __init__.py │ │ ├── ascii_art.py │ │ ├── click.py │ │ ├── config.py │ │ ├── constants.py │ │ ├── crypto.py │ │ ├── file_handling.py │ │ ├── intl.py │ │ ├── ssz.py │ │ └── validation.py ├── test_binary_btec_script.py ├── test_binary_deposit_script.py ├── test_btec_script.py ├── test_deposit_script.py ├── testnet_deposit_0_1.txt ├── tests │ ├── __init__.py │ ├── test_cli │ │ ├── __init__.py │ │ ├── helpers.py │ │ ├── test_existing_menmonic.py │ │ ├── test_generate_bls_to_execution_change.py │ │ ├── test_new_mnemonic.py │ │ └── test_regeneration.py │ ├── test_credentials.py │ ├── test_intl │ │ ├── schemas │ │ │ ├── cli │ │ │ │ ├── existing_mnemonic.json │ │ │ │ ├── generate_keys.json │ │ │ │ └── new_mnemonic.json │ │ │ ├── credentials.json │ │ │ ├── deposit.json │ │ │ └── utils │ │ │ │ └── validation.json │ │ └── test_json_schema.py │ ├── test_key_handling │ │ ├── __init__.py │ │ ├── keystore_test_vectors │ │ │ ├── test0.json │ │ │ └── test1.json │ │ ├── test_key_derivation │ │ │ ├── __init__.py │ │ │ ├── test_mnemonic.py │ │ │ ├── test_path.py │ │ │ ├── test_tree.py │ │ │ └── test_vectors │ │ │ │ ├── mnemonic.json │ │ │ │ ├── tree_kdf.json │ │ │ │ └── tree_kdf_intermediate.json │ │ └── test_keystore.py │ └── test_utils │ │ ├── test_constants.py │ │ ├── test_crypto.py │ │ ├── test_intl.py │ │ ├── test_ssz.py │ │ └── test_validation.py └── tox.ini └── scripts ├── clean.sh ├── install-asdf.sh ├── install-docker.sh ├── validator-build.sh └── validator-deposit-data.sh /.gitignore: -------------------------------------------------------------------------------- 1 | consensus/ 2 | execution/ 3 | validator/ 4 | validator_keys/ 5 | logs/ -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "engram-deposit-cli"] 2 | path = engram-deposit-cli 3 | url = https://github.com/engram-network/engram-deposit-cli 4 | -------------------------------------------------------------------------------- /custom_config_data/boot_cl.txt: -------------------------------------------------------------------------------- 1 | enr:-MS4QAcCGw8Pncl2Lidd51j9OjqmLNVnExPBdA71S0T4gQszL6PiZXUNTpchqGkpRGEIeRdGhI06PMMRaVOJ2JjlhVBFh2F0dG5ldHOI__________-EZXRoMpBc4aciQAABMf__________gmlkgnY0gmlwhA3UtEqEcXVpY4IjKYlzZWNwMjU2azGhAoW4WExH213eOZrOzuThMHDYqS56O5DGE4fgK8ihgR7GiHN5bmNuZXRzD4N0Y3CCIyiDdWRwgiMo 2 | enr:-MS4QGOGlttjofgnBvfmyKIpKBLl-2OPKxLfUfKGyUlWBRnDRlU-9fYeqKP-DnySYnpK6WvCJMDmDmPs9T3-vqTCzmhFh2F0dG5ldHOI__________-EZXRoMpBc4aciQAABMf__________gmlkgnY0gmlwhDb_xcuEcXVpY4IjKYlzZWNwMjU2azGhAutHyoDBd-nvWN1DdTggz2ajo2W053uMUW7EKptXLpgDiHN5bmNuZXRzD4N0Y3CCIyiDdWRwgiMo 3 | enr:-MS4QEuCFSPpDKfMn7PfBC-mdL-UR4IdDRVZ0zr3bUxfIU_OfRD5Rt3ngqFgQOTLajvBC_ul1vK3jsPktKAm1PWsVpBFh2F0dG5ldHOI__________-EZXRoMpBc4aciQAABMf__________gmlkgnY0gmlwhKpAzP-EcXVpY4IjKYlzZWNwMjU2azGhAwTGWXl8cPw1AAkRiFVl7phbt2FFIJ-vFgsW2BJFsuQFiHN5bmNuZXRzD4N0Y3CCIyiDdWRwgiMo 4 | -------------------------------------------------------------------------------- /custom_config_data/boot_el.txt: -------------------------------------------------------------------------------- 1 | enode://d60816e110da3d306f2999c86fdf4e6bcc33c3a2829b1490a22f2c62f898516fc9759c3bfc0d22f8d68336dcfe03c7888b0e6255dd564cc99883052c4f8b56e9@13.212.180.74:30303 #Sydney 2 | enode://b2a6c8890183af431581b34aca6b608f5de1d5facaf3f5bffe6bce2129ce3364df6b147b2a159594b074c782e06702ec0ad45785999b9f602dfe638a2b8b5515@54.255.197.203:30303 #Sydney 3 | enode://84bfc8f00094b95de4835757ef82eb631c155a0ab4e0ea59522295f942a54ee89f8b4e1c30e59b30d4454ca53f09ea939ceda646061283a67909ac1bf276f32c@170.64.204.255:30303 #Singapore 4 | enode://29b663be8f9eebda336f8930604f477bec57d486fa3fe50a7014e392a09b2ec1789f294997783c3ec4cc7847e3f412fe35e5904fd684fc6cf34210aea1f88dc6@159.223.32.178:30303 #Singapore 5 | -------------------------------------------------------------------------------- /custom_config_data/boot_enr.txt: -------------------------------------------------------------------------------- 1 | - enr:-Iq4QJk4WqRkjsX5c2CXtOra6HnxN-BMXnWhmhEQO9Bn9iABTJGdjUOurM7Btj1ouKaFkvTRoju5vz2GPmVON2dffQKGAX53x8JigmlkgnY0gmlwhLKAlv6Jc2VjcDI1NmsxoQK6S-Cii_KmfFdUJL2TANL3ksaKUnNXvTCv1tLwXs0QgIN1ZHCCIyk 2 | -------------------------------------------------------------------------------- /custom_config_data/bootstrap_nodes.txt: -------------------------------------------------------------------------------- 1 | enr:-Iq4QJk4WqRkjsX5c2CXtOra6HnxN-BMXnWhmhEQO9Bn9iABTJGdjUOurM7Btj1ouKaFkvTRoju5vz2GPmVON2dffQKGAX53x8JigmlkgnY0gmlwhLKAlv6Jc2VjcDI1NmsxoQK6S-Cii_KmfFdUJL2TANL3ksaKUnNXvTCv1tLwXs0QgIN1ZHCCIyk 2 | -------------------------------------------------------------------------------- /custom_config_data/config.yaml: -------------------------------------------------------------------------------- 1 | # Extends the mainnet preset 2 | PRESET_BASE: 'mainnet' 3 | CONFIG_NAME: 'tokioswift' # needs to exist because of Prysm. Otherwise it conflicts with mainnet genesis 4 | 5 | # Genesis 6 | # --------------------------------------------------------------- 7 | # `2**14` (= 16,384) 8 | MIN_GENESIS_ACTIVE_VALIDATOR_COUNT: 100 9 | # Nov 16 2023 10:17:48 GMT+0000 10 | MIN_GENESIS_TIME: 1700129868 11 | GENESIS_FORK_VERSION: 0x10000131 12 | GENESIS_DELAY: 60 13 | 14 | 15 | # Forking 16 | # --------------------------------------------------------------- 17 | # Some forks are disabled for now: 18 | # - These may be re-assigned to another fork-version later 19 | # - Temporarily set to max uint64 value: 2**64 - 1 20 | 21 | # Altair 22 | ALTAIR_FORK_VERSION: 0x20000131 23 | ALTAIR_FORK_EPOCH: 0 24 | # Merge 25 | BELLATRIX_FORK_VERSION: 0x30000131 26 | BELLATRIX_FORK_EPOCH: 0 27 | TERMINAL_TOTAL_DIFFICULTY: 0 28 | TERMINAL_BLOCK_HASH: 0x0000000000000000000000000000000000000000000000000000000000000000 29 | TERMINAL_BLOCK_HASH_ACTIVATION_EPOCH: 18446744073709551615 30 | 31 | # Capella 32 | CAPELLA_FORK_VERSION: 0x40000131 33 | CAPELLA_FORK_EPOCH: 0 34 | 35 | # DENEB 36 | DENEB_FORK_VERSION: 0x50000131 37 | DENEB_FORK_EPOCH: 20000 38 | 39 | # Time parameters 40 | # --------------------------------------------------------------- 41 | # 12 seconds 42 | SECONDS_PER_SLOT: 12 43 | # 14 (estimate from Eth1 mainnet) 44 | SECONDS_PER_ETH1_BLOCK: 12 45 | # 2**0 (= 1) epochs ~1 hours 46 | MIN_VALIDATOR_WITHDRAWABILITY_DELAY: 1 47 | # 2**8 (= 256) epochs ~27 hours 48 | SHARD_COMMITTEE_PERIOD: 1 49 | # 2**11 (= 2,048) Eth1 blocks ~8 hours 50 | ETH1_FOLLOW_DISTANCE: 12 51 | 52 | 53 | # Validator cycle 54 | # --------------------------------------------------------------- 55 | # 2**2 (= 4) 56 | INACTIVITY_SCORE_BIAS: 4 57 | # 2**4 (= 16) 58 | INACTIVITY_SCORE_RECOVERY_RATE: 16 59 | # 2**4 * 10**9 (= 16,000,000,000) Gwei 60 | EJECTION_BALANCE: 31000000000 61 | # 2**2 (= 4) 62 | MIN_PER_EPOCH_CHURN_LIMIT: 4 63 | # 2**16 (= 65,536) 64 | CHURN_LIMIT_QUOTIENT: 65536 65 | # [New in Deneb:EIP7514] 2**3 (= 8) 66 | MAX_PER_EPOCH_ACTIVATION_CHURN_LIMIT: 8 67 | 68 | # Fork choice 69 | # --------------------------------------------------------------- 70 | # 40% 71 | PROPOSER_SCORE_BOOST: 40 72 | 73 | # Deposit contract 74 | # --------------------------------------------------------------- 75 | DEPOSIT_CHAIN_ID: 131 76 | DEPOSIT_NETWORK_ID: 131 77 | DEPOSIT_CONTRACT_ADDRESS: 0x4242424242424242424242424242424242424242 78 | 79 | # Networking 80 | # --------------------------------------------------------------- 81 | # `10 * 2**20` (= 10485760, 10 MiB) 82 | GOSSIP_MAX_SIZE: 10485760 83 | # `2**10` (= 1024) 84 | MAX_REQUEST_BLOCKS: 1024 85 | # `2**8` (= 256) 86 | EPOCHS_PER_SUBNET_SUBSCRIPTION: 256 87 | # `MIN_VALIDATOR_WITHDRAWABILITY_DELAY + CHURN_LIMIT_QUOTIENT // 2` (= 33024, ~5 months) 88 | MIN_EPOCHS_FOR_BLOCK_REQUESTS: 33024 89 | # `10 * 2**20` (=10485760, 10 MiB) 90 | MAX_CHUNK_SIZE: 10485760 91 | # 5s 92 | TTFB_TIMEOUT: 5 93 | # 10s 94 | RESP_TIMEOUT: 10 95 | ATTESTATION_PROPAGATION_SLOT_RANGE: 32 96 | # 500ms 97 | MAXIMUM_GOSSIP_CLOCK_DISPARITY: 500 98 | MESSAGE_DOMAIN_INVALID_SNAPPY: 0x00000000 99 | MESSAGE_DOMAIN_VALID_SNAPPY: 0x01000000 100 | # 2 subnets per node 101 | SUBNETS_PER_NODE: 2 102 | # 2**8 (= 64) 103 | ATTESTATION_SUBNET_COUNT: 64 104 | ATTESTATION_SUBNET_EXTRA_BITS: 0 105 | # ceillog2(ATTESTATION_SUBNET_COUNT) + ATTESTATION_SUBNET_EXTRA_BITS 106 | ATTESTATION_SUBNET_PREFIX_BITS: 6 107 | 108 | # Deneb 109 | # `2**7` (=128) 110 | MAX_REQUEST_BLOCKS_DENEB: 128 111 | # MAX_REQUEST_BLOCKS_DENEB * MAX_BLOBS_PER_BLOCK 112 | MAX_REQUEST_BLOB_SIDECARS: 768 113 | # `2**12` (= 4096 epochs, ~18 days) 114 | MIN_EPOCHS_FOR_BLOB_SIDECARS_REQUESTS: 4096 115 | # `6` 116 | BLOB_SIDECAR_SUBNET_COUNT: 6 117 | # `uint64(6)` 118 | MAX_BLOBS_PER_BLOCK: 6 119 | -------------------------------------------------------------------------------- /custom_config_data/deploy_block.txt: -------------------------------------------------------------------------------- 1 | 0 2 | -------------------------------------------------------------------------------- /custom_config_data/deposit_contract.txt: -------------------------------------------------------------------------------- 1 | 0x4242424242424242424242424242424242424242 2 | -------------------------------------------------------------------------------- /custom_config_data/deposit_contract_block.txt: -------------------------------------------------------------------------------- 1 | 0 2 | -------------------------------------------------------------------------------- /custom_config_data/deposit_contract_block_hash.txt: -------------------------------------------------------------------------------- 1 | 0x80a844561ee9f1c08df22f27767950406ebeffad467739c2af0c4e5311569605 2 | -------------------------------------------------------------------------------- /custom_config_data/genesis.ssz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/engram-network/tokio-docker/14c03b1d1d5b98f085922f6ed6905c98f3699a8d/custom_config_data/genesis.ssz -------------------------------------------------------------------------------- /custom_config_data/genesis_validators_root.txt: -------------------------------------------------------------------------------- 1 | 0xc78d775f2899f59c64c705ebb6f40aeff0d5ba28f37f46158d973cb5fb1e2e15 2 | -------------------------------------------------------------------------------- /custom_config_data/jwtsecret: -------------------------------------------------------------------------------- 1 | 0x19bfe69075b54bab519ec56db2062676e9e844396b8894b1f9f2e5ceb1408aae -------------------------------------------------------------------------------- /custom_config_data/password.txt: -------------------------------------------------------------------------------- 1 | 0x19bfe69075b54bab519ec56db2062676e9e844396b8894b1f9f2e5ceb1408aae 2 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3.9" 2 | services: 3 | striatum_init: 4 | image: "engramnet/striatum:tokio" # Sets up the genesis configuration for the striatum Engram Tokio client from a JSON file. 5 | container_name: striatum_init 6 | command: --datadir=/execution init /custom_config_data/genesis.json 7 | volumes: 8 | - ./execution:/execution 9 | - ./custom_config_data:/custom_config_data 10 | 11 | striatum_el: 12 | image: "engramnet/striatum:tokio" # Runs the striatum execution client with the specified networks. 13 | container_name: striatum_el 14 | restart: on-failure 15 | command: 16 | - --http 17 | - --http.api=admin,eth,net,web3 18 | - --http.addr=0.0.0.0 19 | - --http.port=8545 20 | - --http.vhosts=* 21 | - --http.corsdomain=* 22 | - --ethstats=YourNameNodeHere:engramstats@nodewatch.engram.tech #Change YourNameNodeHere With Your Node/Community 23 | - --authrpc.vhosts=* 24 | - --authrpc.addr=0.0.0.0 25 | - --authrpc.port=8551 26 | - --authrpc.jwtsecret=/custom_config_data/jwtsecret 27 | - --datadir=/execution 28 | - --identity=Huemint # Change With Your userdiscord without handle or hastag 29 | - --networkid=131 30 | - --syncmode=full 31 | - --cache=1028 32 | - --rpc.allow-unprotected-txs 33 | - --port=30303 34 | - --gcmode=full 35 | - --cache.preimages 36 | - --crypto.kzg=gokzg 37 | - --bootnodes=enode://29b663be8f9eebda336f8930604f477bec57d486fa3fe50a7014e392a09b2ec1789f294997783c3ec4cc7847e3f412fe35e5904fd684fc6cf34210aea1f88dc6@159.223.32.178:30303 38 | ports: 39 | - 8551:8551 # rpc engine 40 | - 8545:8545 # rpc json, optional, you can deactivate if you don't need 41 | - 30303:30303/tcp # bootnodes 42 | - 30303:30303/udp # bootnodes 43 | depends_on: 44 | striatum_init: 45 | condition: service_completed_successfully 46 | volumes: 47 | - ./execution:/execution 48 | - ./custom_config_data:/custom_config_data 49 | 50 | lighthouse_cl: 51 | image: "sigp/lighthouse:v4.5.0" # Runs a Lighthouse beacon chain from a specified genesis state created in the previous step 52 | container_name: lighthouse_cl 53 | restart: on-failure 54 | command: 55 | - lighthouse 56 | - bn 57 | - --gui 58 | - --eth1 59 | - --staking 60 | - --http 61 | - --http-port=5052 62 | - --http-allow-sync-stalled 63 | - --http-address=0.0.0.0 64 | - --subscribe-all-subnets 65 | - --http-allow-origin=* 66 | - --debug-level=info 67 | - --datadir=/consensus 68 | - --testnet-dir=/custom_config_data 69 | - --disable-enr-auto-update 70 | - --enr-address=0.0.0.0 71 | - --enr-udp-port=9000 72 | - --enr-tcp-port=9000 73 | - --discovery-port=9000 74 | - --port=9002 75 | - --genesis-backfill 76 | - --target-peers=400 77 | - --metrics 78 | - --metrics-address=0.0.0.0 79 | - --metrics-allow-origin=* 80 | - --metrics-port=5054 81 | - --graffiti=Huemint # Change with your discord address (e.g: ethStaker) 82 | - --boot-nodes=enr:-MS4QGOGlttjofgnBvfmyKIpKBLl-2OPKxLfUfKGyUlWBRnDRlU-9fYeqKP-DnySYnpK6WvCJMDmDmPs9T3-vqTCzmhFh2F0dG5ldHOI__________-EZXRoMpBc4aciQAABMf__________gmlkgnY0gmlwhDb_xcuEcXVpY4IjKYlzZWNwMjU2azGhAutHyoDBd-nvWN1DdTggz2ajo2W053uMUW7EKptXLpgDiHN5bmNuZXRzD4N0Y3CCIyiDdWRwgiMo,enr:-MS4QEuCFSPpDKfMn7PfBC-mdL-UR4IdDRVZ0zr3bUxfIU_OfRD5Rt3ngqFgQOTLajvBC_ul1vK3jsPktKAm1PWsVpBFh2F0dG5ldHOI__________-EZXRoMpBc4aciQAABMf__________gmlkgnY0gmlwhKpAzP-EcXVpY4IjKYlzZWNwMjU2azGhAwTGWXl8cPw1AAkRiFVl7phbt2FFIJ-vFgsW2BJFsuQFiHN5bmNuZXRzD4N0Y3CCIyiDdWRwgiMo,enr:-MS4QAcCGw8Pncl2Lidd51j9OjqmLNVnExPBdA71S0T4gQszL6PiZXUNTpchqGkpRGEIeRdGhI06PMMRaVOJ2JjlhVBFh2F0dG5ldHOI__________-EZXRoMpBc4aciQAABMf__________gmlkgnY0gmlwhA3UtEqEcXVpY4IjKYlzZWNwMjU2azGhAoW4WExH213eOZrOzuThMHDYqS56O5DGE4fgK8ihgR7GiHN5bmNuZXRzD4N0Y3CCIyiDdWRwgiMo 83 | - --execution-endpoints=http://striatum_el:8551 84 | - --eth1-endpoints=http://striatum_el:8545 85 | - --execution-jwt=/custom_config_data/jwtsecret 86 | depends_on: 87 | striatum_el: 88 | condition: service_started 89 | ports: 90 | - 5052:5052 # Ethereum Node Record 91 | - 5054:5054 # metrics 92 | - 9000:9000/tcp # ENR port tcp 93 | - 9000:9000/udp # ENR port udp 94 | volumes: 95 | - ./consensus:/consensus 96 | - ./custom_config_data:/custom_config_data 97 | 98 | lighthouse_init: 99 | image: "sigp/lighthouse:v4.5.0" # Initialize and import keystore from staking_cli to lighthouse client. 100 | container_name: lighthouse_init 101 | command: 102 | - lighthouse 103 | - account 104 | - validator 105 | - import 106 | - --testnet-dir=/custom_config_data 107 | - --datadir=/validator 108 | - --directory=/validator_keys 109 | - --password-file=/custom_config_data/password.txt 110 | - --reuse-password 111 | volumes: 112 | - ./custom_config_data:/custom_config_data 113 | - ./validator:/validator 114 | - ./validator_keys:/validator_keys 115 | 116 | lighthouse_vc: 117 | image: "sigp/lighthouse:v4.5.0" # Runs a Lighthouse validator from a specified consensus state created in the previous step 118 | container_name: lighthouse_vc 119 | restart: on-failure 120 | command: 121 | - lighthouse 122 | - vc 123 | - --http 124 | - --unencrypted-http-transport 125 | - --init-slashing-protection 126 | - --http-allow-origin=* 127 | - --http-port=5062 128 | - --http-address=0.0.0.0 129 | - --metrics 130 | - --metrics-address=0.0.0.0 131 | - --metrics-port=5064 132 | - --metrics-allow-origin=* 133 | - --datadir=/validator 134 | - --testnet-dir=/custom_config_data 135 | - --suggested-fee-recipient=0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266 # Change With Your Address From Funding Deposit Contracts 136 | - --graffiti=Huemint # Change With Your Name Nodes 137 | - --beacon-nodes=http://lighthouse_cl:5052 138 | depends_on: 139 | lighthouse_init: 140 | condition: service_completed_successfully 141 | lighthouse_cl: 142 | condition: service_started 143 | volumes: 144 | - ./custom_config_data:/custom_config_data 145 | - ./validator:/validator 146 | ports: 147 | - 5062:5062 148 | - 5064:5064 149 | -------------------------------------------------------------------------------- /engram-deposit-cli/.dockerignore: -------------------------------------------------------------------------------- 1 | # Prevent your local modules and debug logs from being 2 | # copied onto your Docker image and possibly overwriting 3 | # modules installed within your image 4 | .git 5 | __pycache__ 6 | -------------------------------------------------------------------------------- /engram-deposit-cli/.gitignore: -------------------------------------------------------------------------------- 1 | validator_keys 2 | bls_to_execution_changes 3 | 4 | # Python testing & linting: 5 | build/ 6 | dist/ 7 | venv/ 8 | *.pytest_cache 9 | *.hypothesis 10 | *.mypy_cache 11 | *.egg-info 12 | *.egg 13 | __pycache__ 14 | .DS_Store 15 | -------------------------------------------------------------------------------- /engram-deposit-cli/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:alpine3.14 2 | 3 | WORKDIR /app 4 | 5 | COPY requirements.txt setup.py ./ 6 | 7 | COPY staking_deposit ./staking_deposit 8 | 9 | RUN apk add --update gcc libc-dev linux-headers 10 | 11 | RUN pip3 install -r requirements.txt 12 | 13 | RUN python3 setup.py install 14 | 15 | ARG cli_command 16 | 17 | ENTRYPOINT [ "python3", "./staking_deposit/deposit.py" ] 18 | 19 | CMD [ $cli_command ] 20 | -------------------------------------------------------------------------------- /engram-deposit-cli/Makefile: -------------------------------------------------------------------------------- 1 | VENV_NAME?=venv 2 | VENV_ACTIVATE=. $(VENV_NAME)/bin/activate 3 | PYTHON=${VENV_NAME}/bin/python3.8 4 | DOCKER_IMAGE="ethereum/staking-deposit-cli:latest" 5 | 6 | help: 7 | @echo "clean - remove build and Python file artifacts" 8 | # Run with venv 9 | @echo "venv_deposit - run deposit cli with venv" 10 | @echo "venv_build - install basic dependencies with venv" 11 | @echo "venv_build_test - install testing dependencies with venv" 12 | @echo "venv_lint - check style with flake8 and mypy with venv" 13 | @echo "venv_test - run tests with venv" 14 | 15 | clean: 16 | rm -rf venv/ 17 | rm -rf build/ 18 | rm -rf dist/ 19 | rm -rf *.egg-info 20 | rm -rf .tox/ 21 | find . -name __pycache__ -exec rm -rf {} \; 22 | find . -name .mypy_cache -exec rm -rf {} \; 23 | find . -name .pytest_cache -exec rm -rf {} \; 24 | 25 | $(VENV_NAME)/bin/activate: requirements.txt 26 | @test -d $(VENV_NAME) || python3 -m venv --clear $(VENV_NAME) 27 | ${VENV_NAME}/bin/python setup.py install 28 | ${VENV_NAME}/bin/python -m pip install -r requirements.txt 29 | ${VENV_NAME}/bin/python -m pip install -r requirements_test.txt 30 | @touch $(VENV_NAME)/bin/activate 31 | 32 | venv_build: $(VENV_NAME)/bin/activate 33 | 34 | venv_build_test: venv_build 35 | ${VENV_NAME}/bin/python -m pip install -r requirements_test.txt 36 | 37 | venv_test: venv_build_test 38 | $(VENV_ACTIVATE) && python -m pytest ./tests 39 | 40 | venv_lint: venv_build_test 41 | $(VENV_ACTIVATE) && flake8 --config=flake8.ini ./staking_deposit ./tests && mypy --config-file mypy.ini -p staking_deposit 42 | 43 | venv_deposit: venv_build 44 | $(VENV_ACTIVATE) && python ./staking_deposit/deposit.py $(filter-out $@,$(MAKECMDGOALS)) 45 | 46 | build_macos: venv_build 47 | ${VENV_NAME}/bin/python -m pip install -r ./build_configs/macos/requirements.txt 48 | export PYTHONHASHSEED=42; \ 49 | $(VENV_ACTIVATE) && pyinstaller ./build_configs/macos/build.spec; 50 | 51 | build_linux: venv_build 52 | ${VENV_NAME}/bin/python -m pip install -r ./build_configs/linux/requirements.txt 53 | export PYTHONHASHSEED=42; \ 54 | $(VENV_ACTIVATE) && pyinstaller ./build_configs/linux/build.spec 55 | 56 | build_docker: 57 | @docker build --pull -t $(DOCKER_IMAGE) . 58 | 59 | run_docker: 60 | @docker run -it --rm $(DOCKER_IMAGE) $(filter-out $@,$(MAKECMDGOALS)) 61 | -------------------------------------------------------------------------------- /engram-deposit-cli/build_configs/linux/build.spec: -------------------------------------------------------------------------------- 1 | # -*- mode: python ; coding: utf-8 -*- 2 | 3 | block_cipher = None 4 | 5 | 6 | a = Analysis(['../../staking_deposit/deposit.py'], 7 | binaries=[], 8 | datas=[ 9 | ('../../staking_deposit/key_handling/key_derivation/word_lists/*.txt', './staking_deposit/key_handling/key_derivation/word_lists/'), 10 | ('../../staking_deposit/intl', './staking_deposit/intl'), 11 | ], 12 | hiddenimports=[], 13 | hookspath=[], 14 | runtime_hooks=[], 15 | excludes=['FixTk', 'tcl', 'tk', '_tkinter', 'tkinter', 'Tkinter'], 16 | win_no_prefer_redirects=False, 17 | win_private_assemblies=False, 18 | cipher=block_cipher, 19 | noarchive=False) 20 | pyz = PYZ(a.pure, a.zipped_data, 21 | cipher=block_cipher) 22 | exe = EXE(pyz, 23 | a.scripts, 24 | a.binaries, 25 | a.zipfiles, 26 | a.datas, 27 | [], 28 | name='deposit', 29 | debug=False, 30 | bootloader_ignore_signals=False, 31 | strip=False, 32 | upx=True, 33 | upx_exclude=[], 34 | runtime_tmpdir=None, 35 | console=True ) 36 | -------------------------------------------------------------------------------- /engram-deposit-cli/build_configs/macos/build.spec: -------------------------------------------------------------------------------- 1 | # -*- mode: python ; coding: utf-8 -*- 2 | 3 | block_cipher = None 4 | 5 | 6 | a = Analysis(['../../staking_deposit/deposit.py'], 7 | binaries=None, 8 | datas=[ 9 | ('../../staking_deposit/key_handling/key_derivation/word_lists/*.txt', './staking_deposit/key_handling/key_derivation/word_lists/'), 10 | ('../../staking_deposit/intl', './staking_deposit/intl'), 11 | ], 12 | hiddenimports=[], 13 | hookspath=[], 14 | runtime_hooks=[], 15 | excludes=['FixTk', 'tcl', 'tk', '_tkinter', 'tkinter', 'Tkinter'], 16 | win_no_prefer_redirects=False, 17 | win_private_assemblies=False, 18 | cipher=block_cipher, 19 | noarchive=False) 20 | pyz = PYZ(a.pure, a.zipped_data, 21 | cipher=block_cipher) 22 | exe = EXE(pyz, 23 | a.scripts, 24 | a.binaries, 25 | a.zipfiles, 26 | a.datas, 27 | [], 28 | name='deposit', 29 | debug=False, 30 | bootloader_ignore_signals=False, 31 | strip=False, 32 | upx=True, 33 | upx_exclude=[], 34 | runtime_tmpdir=None, 35 | console=True ) 36 | -------------------------------------------------------------------------------- /engram-deposit-cli/build_configs/windows/build.spec: -------------------------------------------------------------------------------- 1 | # -*- mode: python ; coding: utf-8 -*- 2 | 3 | block_cipher = None 4 | 5 | 6 | a = Analysis(['..\\..\\staking_deposit\\deposit.py'], 7 | binaries=[], 8 | datas=[ 9 | ('..\\..\\staking_deposit\\key_handling\\key_derivation\\word_lists\\*.txt', '.\\staking_deposit\\key_handling\\key_derivation\\word_lists'), 10 | ('..\\..\\staking_deposit\\intl', '.\\staking_deposit\\intl'), 11 | ], 12 | hiddenimports=[], 13 | hookspath=[], 14 | runtime_hooks=[], 15 | excludes=['FixTk', 'tcl', 'tk', '_tkinter', 'tkinter', 'Tkinter'], 16 | win_no_prefer_redirects=False, 17 | win_private_assemblies=False, 18 | cipher=block_cipher, 19 | noarchive=False) 20 | pyz = PYZ(a.pure, a.zipped_data, 21 | cipher=block_cipher) 22 | exe = EXE(pyz, 23 | a.scripts, 24 | a.binaries, 25 | a.zipfiles, 26 | a.datas, 27 | [], 28 | name='deposit', 29 | debug=False, 30 | bootloader_ignore_signals=False, 31 | strip=False, 32 | upx=True, 33 | upx_exclude=[], 34 | runtime_tmpdir=None, 35 | console=True ) 36 | -------------------------------------------------------------------------------- /engram-deposit-cli/dep.sh: -------------------------------------------------------------------------------- 1 | amount=32000000000 2 | smin=0 3 | smax=1 4 | 5 | eth2-val-tools deposit-data \ 6 | --source-min=$smin \ 7 | --source-max=$smax \ 8 | --amount=$amount \ 9 | --fork-version=0x10000130 \ 10 | --withdrawals-mnemonic="giggle addict tribe outdoor rose chalk struggle claim zebra prize yellow depend match rally into enhance follow attend session industry stove dial remain regular" \ 11 | --validators-mnemonic="giggle addict tribe outdoor rose chalk struggle claim zebra prize yellow depend match rally into enhance follow attend session industry stove dial remain regular" > testnet_deposit_$smin\_$smax.txt 12 | 13 | while read x; do 14 | account_name="$(echo "$x" | jq '.account')" 15 | pubkey="$(echo "$x" | jq '.pubkey')" 16 | echo "Sending deposit for validator $account_name $pubkey" 17 | ethereal beacon deposit \ 18 | --allow-unknown-contract=true \ 19 | --address="0x4242424242424242424242424242424242424242" \ 20 | --connection=https://engram.tech/testnet \ 21 | --data="$x" \ 22 | --allow-excessive-deposit \ 23 | --value="$amount" \ 24 | --from="0x841cabb0fba376019f879451adb88c95f30b0b20" \ 25 | --privatekey="0x0ce2003ea0a665e9e38f43a376e77119cb6d725cfe8045d697bb32ef4b931139" # the public key's private key 26 | echo "Sent deposit for validator $account_name $pubkey" 27 | sleep 2 28 | done < testnet_deposit_$smin\_$smax.txt -------------------------------------------------------------------------------- /engram-deposit-cli/deposit.json: -------------------------------------------------------------------------------- 1 | { 2 | "account": "m/12381/3600/0/0/0", 3 | "deposit_data_root": "5a575ee49ccf62a2223b87313ac45ea3637f17610f4ed4714f9d6afe13781cd1", 4 | "pubkey": "b93d4df1ac07da9bf7cf007ab49e398d045c0ac0619bd012055676855393518278a6a6897f9ed3a1e39cdd6c2ba7469e", 5 | "signature": "99ce0eaf16bd77d09f098b0a25104c590f546f2b4bd1a7f723ecba81252613222f8fd79f5872d28006430ad1b8ab24880a9739d6bae8e7df4f934c3473621b489d31e4bd514825ebae23104a1db21286b82ff4775899e3f6cca3e29b074ce36f", 6 | "value": 32000000000, 7 | "version": 1, 8 | "withdrawal_credentials": "0053a89444b457da0e4745b2f92741f5a70e9f13d63a92affdbd200027947cda" 9 | } -------------------------------------------------------------------------------- /engram-deposit-cli/deposit.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [[ "$OSTYPE" == "linux"* ]] || [[ "$OSTYPE" == "linux-android"* ]] || [[ "$OSTYPE" == "darwin"* ]]; then 4 | echo $OSTYPE 5 | if [[ $1 == "install" ]]; then 6 | echo "Installing dependencies..." 7 | pip3 install -r requirements.txt 8 | python3 setup.py install 9 | exit 1 10 | fi 11 | echo "Running deposit-cli..." 12 | python3 ./staking_deposit/deposit.py "$@" 13 | 14 | elif [[ "$OSTYPE" == "msys" ]] || [[ "$OSTYPE" == "cygwin" ]]; then 15 | echo $OSTYPE 16 | if [[ $1 == "install" ]]; then 17 | echo "Installing dependencies..." 18 | pip install -r requirements.txt 19 | python setup.py install 20 | exit 1 21 | fi 22 | echo "Running deposit-cli..." 23 | python ./staking_deposit/deposit.py "$@" 24 | 25 | else 26 | echo "Sorry, to run deposit-cli on" $(uname -s)", please see the trouble-shooting on https://github.com/ethereum/staking-deposit-cli" 27 | exit 1 28 | 29 | fi 30 | -------------------------------------------------------------------------------- /engram-deposit-cli/flake8.ini: -------------------------------------------------------------------------------- 1 | [flake8] 2 | max-line-length= 120 3 | exclude= 4 | ignore=E252,W504,W503 5 | -------------------------------------------------------------------------------- /engram-deposit-cli/log.txt: -------------------------------------------------------------------------------- 1 | MicroStarted -------------------------------------------------------------------------------- /engram-deposit-cli/mypy.ini: -------------------------------------------------------------------------------- 1 | [mypy] 2 | warn_unused_ignores = True 3 | ignore_missing_imports = True 4 | strict_optional = False 5 | check_untyped_defs = True 6 | disallow_incomplete_defs = True 7 | disallow_untyped_defs = True 8 | disallow_any_generics = True 9 | disallow_untyped_calls = True 10 | warn_redundant_casts = True 11 | warn_unused_configs = True 12 | strict_equality = True 13 | -------------------------------------------------------------------------------- /engram-deposit-cli/requirements.txt: -------------------------------------------------------------------------------- 1 | py-ecc==5.2.0 \ 2 | --hash=sha256:525b95aae5bbc185baff7dbfdb9bbd14d2c9454a797457f3edc85fd14c2ad7a6 \ 3 | --hash=sha256:f0aabdc82813ecb2e75e0531e3850295ff1a96bedfba42f15b5bc7f39ced64ba 4 | pycryptodome==3.14.1 \ 5 | --hash=sha256:028dcbf62d128b4335b61c9fbb7dd8c376594db607ef36d5721ee659719935d5 \ 6 | --hash=sha256:12ef157eb1e01a157ca43eda275fa68f8db0dd2792bc4fe00479ab8f0e6ae075 \ 7 | --hash=sha256:2562de213960693b6d657098505fd4493c45f3429304da67efcbeb61f0edfe89 \ 8 | --hash=sha256:27e92c1293afcb8d2639baf7eb43f4baada86e4de0f1fb22312bfc989b95dae2 \ 9 | --hash=sha256:36e3242c4792e54ed906c53f5d840712793dc68b726ec6baefd8d978c5282d30 \ 10 | --hash=sha256:50a5346af703330944bea503106cd50c9c2212174cfcb9939db4deb5305a8367 \ 11 | --hash=sha256:53dedbd2a6a0b02924718b520a723e88bcf22e37076191eb9b91b79934fb2192 \ 12 | --hash=sha256:69f05aaa90c99ac2f2af72d8d7f185f729721ad7c4be89e9e3d0ab101b0ee875 \ 13 | --hash=sha256:75a3a364fee153e77ed889c957f6f94ec6d234b82e7195b117180dcc9fc16f96 \ 14 | --hash=sha256:766a8e9832128c70012e0c2b263049506cbf334fb21ff7224e2704102b6ef59e \ 15 | --hash=sha256:7fb90a5000cc9c9ff34b4d99f7f039e9c3477700e309ff234eafca7b7471afc0 \ 16 | --hash=sha256:893f32210de74b9f8ac869ed66c97d04e7d351182d6d39ebd3b36d3db8bda65d \ 17 | --hash=sha256:8b5c28058102e2974b9868d72ae5144128485d466ba8739abd674b77971454cc \ 18 | --hash=sha256:924b6aad5386fb54f2645f22658cb0398b1f25bc1e714a6d1522c75d527deaa5 \ 19 | --hash=sha256:9924248d6920b59c260adcae3ee231cd5af404ac706ad30aa4cd87051bf09c50 \ 20 | --hash=sha256:9ec761a35dbac4a99dcbc5cd557e6e57432ddf3e17af8c3c86b44af9da0189c0 \ 21 | --hash=sha256:a36ab51674b014ba03da7f98b675fcb8eabd709a2d8e18219f784aba2db73b72 \ 22 | --hash=sha256:aae395f79fa549fb1f6e3dc85cf277f0351e15a22e6547250056c7f0c990d6a5 \ 23 | --hash=sha256:c880a98376939165b7dc504559f60abe234b99e294523a273847f9e7756f4132 \ 24 | --hash=sha256:ce7a875694cd6ccd8682017a7c06c6483600f151d8916f2b25cf7a439e600263 \ 25 | --hash=sha256:d1b7739b68a032ad14c5e51f7e4e1a5f92f3628bba024a2bda1f30c481fc85d8 \ 26 | --hash=sha256:dcd65355acba9a1d0fc9b923875da35ed50506e339b35436277703d7ace3e222 \ 27 | --hash=sha256:e04e40a7f8c1669195536a37979dd87da2c32dbdc73d6fe35f0077b0c17c803b \ 28 | --hash=sha256:e0c04c41e9ade19fbc0eff6aacea40b831bfcb2c91c266137bcdfd0d7b2f33ba \ 29 | --hash=sha256:e24d4ec4b029611359566c52f31af45c5aecde7ef90bf8f31620fd44c438efe7 \ 30 | --hash=sha256:e64738207a02a83590df35f59d708bf1e7ea0d6adce712a777be2967e5f7043c \ 31 | --hash=sha256:ea56a35fd0d13121417d39a83f291017551fa2c62d6daa6b04af6ece7ed30d84 \ 32 | --hash=sha256:f2772af1c3ef8025c85335f8b828d0193fa1e43256621f613280e2c81bfad423 \ 33 | --hash=sha256:f403a3e297a59d94121cb3ee4b1cf41f844332940a62d71f9e4a009cc3533493 \ 34 | --hash=sha256:f572a3ff7b6029dd9b904d6be4e0ce9e309dcb847b03e3ac8698d9d23bb36525 35 | click==7.1.2 \ 36 | --hash=sha256:d2b5255c7c6349bc1bd1e59e08cd12acbbd63ce649f2588755783aa94dfb6b1a \ 37 | --hash=sha256:dacca89f4bfadd5de3d7489b7c8a566eee0d3676333fbb50030263894c38c0dc 38 | ssz==0.2.4 \ 39 | --hash=sha256:3c944cd97a38448fe2b145d80d704bd28bc3c5368da9624177b0964e37adaf7e \ 40 | --hash=sha256:99c4a7bbaf632113fc28beb8770673637286f7fdade1231e0a2c6fae6331c06d 41 | eth-typing==2.3.0 \ 42 | --hash=sha256:39cce97f401f082739b19258dfa3355101c64390914c73fe2b90012f443e0dc7 \ 43 | --hash=sha256:b7fa58635c1cb0cbf538b2f5f1e66139575ea4853eac1d6000f0961a4b277422 44 | 45 | # Dependencies for the above 46 | eth-utils==1.10.0 \ 47 | --hash=sha256:74240a8c6f652d085ed3c85f5f1654203d2f10ff9062f83b3bad0a12ff321c7a \ 48 | --hash=sha256:bf82762a46978714190b0370265a7148c954d3f0adaa31c6f085ea375e4c61af 49 | mypy-extensions==0.4.3 \ 50 | --hash=sha256:090fedd75945a69ae91ce1303b5824f428daf5a028d2f6ab8a299250a846f15d \ 51 | --hash=sha256:2d82818f5bb3e369420cb3c4060a7970edba416647068eb4c5343488a6c604a8 52 | lru-dict==1.1.7 \ 53 | --hash=sha256:45b81f67d75341d4433abade799a47e9c42a9e22a118531dcb5e549864032d7c 54 | pyrsistent==0.16.1 \ 55 | --hash=sha256:aa2ae1c2e496f4d6777f869ea5de7166a8ccb9c2e06ebcf6c7ff1b670c98c5ef 56 | eth-hash==0.3.2 \ 57 | --hash=sha256:3f40cecd5ead88184aa9550afc19d057f103728108c5102f592f8415949b5a76 \ 58 | --hash=sha256:de7385148a8e0237ba1240cddbc06d53f56731140f8593bdb8429306f6b42271 59 | cytoolz==0.11.2 \ 60 | --hash=sha256:ea23663153806edddce7e4153d1d407d62357c05120a4e8485bddf1bd5ab22b4 61 | toolz==0.11.2 \ 62 | --hash=sha256:6b312d5e15138552f1bda8a4e66c30e236c831b612b2bf0005f8a1df10a4bc33 \ 63 | --hash=sha256:a5700ce83414c64514d82d60bcda8aabfde092d1c1a8663f9200c07fdcc6da8f 64 | six==1.16.0 \ 65 | --hash=sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926 \ 66 | --hash=sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254 67 | cached-property==1.5.2 \ 68 | --hash=sha256:9fa5755838eecbb2d234c3aa390bd80fbd3ac6b6869109bfc1b499f7bd89a130 \ 69 | --hash=sha256:df4f613cf7ad9a588cc381aaf4a512d26265ecebd5eb9e1ba12f1319eb85a6a0 70 | -------------------------------------------------------------------------------- /engram-deposit-cli/run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | sudo apt-get install python3-pip -y 4 | sudo pip3 install -r requirements.txt 5 | sudo python3 setup.py install 6 | sudo ./deposit.sh install -------------------------------------------------------------------------------- /engram-deposit-cli/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import find_packages, setup 2 | 3 | """ 4 | THIS IS A STUB FOR RUNNING THE APP 5 | """ 6 | 7 | setup( 8 | name="staking_deposit", 9 | version='2.7.0', 10 | py_modules=["staking_deposit"], 11 | packages=find_packages(exclude=('tests', 'docs')), 12 | python_requires=">=3.8,<4", 13 | ) 14 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/engram-network/tokio-docker/14c03b1d1d5b98f085922f6ed6905c98f3699a8d/engram-deposit-cli/staking_deposit/__init__.py -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/cli/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/engram-network/tokio-docker/14c03b1d1d5b98f085922f6ed6905c98f3699a8d/engram-deposit-cli/staking_deposit/cli/__init__.py -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/cli/existing_mnemonic.py: -------------------------------------------------------------------------------- 1 | import click 2 | from typing import ( 3 | Any, 4 | Callable, 5 | ) 6 | 7 | from staking_deposit.exceptions import ValidationError 8 | from staking_deposit.key_handling.key_derivation.mnemonic import ( 9 | reconstruct_mnemonic, 10 | ) 11 | from staking_deposit.utils.constants import ( 12 | WORD_LISTS_PATH, 13 | ) 14 | from staking_deposit.utils.click import ( 15 | captive_prompt_callback, 16 | jit_option, 17 | ) 18 | from staking_deposit.utils.intl import load_text 19 | from staking_deposit.utils.validation import validate_int_range 20 | from .generate_keys import ( 21 | generate_keys, 22 | generate_keys_arguments_decorator, 23 | ) 24 | 25 | 26 | def load_mnemonic_arguments_decorator(function: Callable[..., Any]) -> Callable[..., Any]: 27 | ''' 28 | This is a decorator that, when applied to a parent-command, implements the 29 | to obtain the necessary arguments for the generate_keys() subcommand. 30 | ''' 31 | decorators = [ 32 | jit_option( 33 | callback=validate_mnemonic, 34 | help=lambda: load_text(['arg_mnemonic', 'help'], func='existing_mnemonic'), 35 | param_decls='--mnemonic', 36 | prompt=lambda: load_text(['arg_mnemonic', 'prompt'], func='existing_mnemonic'), 37 | type=str, 38 | ), 39 | jit_option( 40 | callback=captive_prompt_callback( 41 | lambda x: x, 42 | lambda: load_text(['arg_mnemonic_password', 'prompt'], func='existing_mnemonic'), 43 | lambda: load_text(['arg_mnemonic_password', 'confirm'], func='existing_mnemonic'), 44 | lambda: load_text(['arg_mnemonic_password', 'mismatch'], func='existing_mnemonic'), 45 | True, 46 | ), 47 | default='', 48 | help=lambda: load_text(['arg_mnemonic_password', 'help'], func='existing_mnemonic'), 49 | hidden=True, 50 | param_decls='--mnemonic-password', 51 | prompt=False, 52 | ), 53 | ] 54 | for decorator in reversed(decorators): 55 | function = decorator(function) 56 | return function 57 | 58 | 59 | def validate_mnemonic(ctx: click.Context, param: Any, mnemonic: str) -> str: 60 | mnemonic = reconstruct_mnemonic(mnemonic, WORD_LISTS_PATH) 61 | if mnemonic is not None: 62 | return mnemonic 63 | else: 64 | raise ValidationError(load_text(['err_invalid_mnemonic'])) 65 | 66 | 67 | @click.command( 68 | help=load_text(['arg_existing_mnemonic', 'help'], func='existing_mnemonic'), 69 | ) 70 | @load_mnemonic_arguments_decorator 71 | @jit_option( 72 | callback=captive_prompt_callback( 73 | lambda num: validate_int_range(num, 0, 2**32), 74 | lambda: load_text(['arg_validator_start_index', 'prompt'], func='existing_mnemonic'), 75 | lambda: load_text(['arg_validator_start_index', 'confirm'], func='existing_mnemonic'), 76 | ), 77 | default=0, 78 | help=lambda: load_text(['arg_validator_start_index', 'help'], func='existing_mnemonic'), 79 | param_decls="--validator_start_index", 80 | prompt=lambda: load_text(['arg_validator_start_index', 'prompt'], func='existing_mnemonic'), 81 | ) 82 | @generate_keys_arguments_decorator 83 | @click.pass_context 84 | def existing_mnemonic(ctx: click.Context, mnemonic: str, mnemonic_password: str, **kwargs: Any) -> None: 85 | ctx.obj = {} if ctx.obj is None else ctx.obj # Create a new ctx.obj if it doesn't exist 86 | ctx.obj.update({'mnemonic': mnemonic, 'mnemonic_password': mnemonic_password}) 87 | ctx.forward(generate_keys) 88 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/cli/new_mnemonic.py: -------------------------------------------------------------------------------- 1 | import click 2 | from typing import ( 3 | Any, 4 | ) 5 | 6 | from staking_deposit.key_handling.key_derivation.mnemonic import ( 7 | get_mnemonic, 8 | reconstruct_mnemonic, 9 | ) 10 | from staking_deposit.utils.click import ( 11 | captive_prompt_callback, 12 | choice_prompt_func, 13 | jit_option, 14 | ) 15 | from staking_deposit.utils.constants import ( 16 | MNEMONIC_LANG_OPTIONS, 17 | WORD_LISTS_PATH, 18 | ) 19 | from staking_deposit.utils.intl import ( 20 | fuzzy_reverse_dict_lookup, 21 | load_text, 22 | get_first_options, 23 | ) 24 | 25 | from .generate_keys import ( 26 | generate_keys, 27 | generate_keys_arguments_decorator, 28 | ) 29 | 30 | languages = get_first_options(MNEMONIC_LANG_OPTIONS) 31 | 32 | 33 | @click.command( 34 | help=load_text(['arg_new_mnemonic', 'help'], func='new_mnemonic'), 35 | ) 36 | @click.pass_context 37 | @jit_option( 38 | callback=captive_prompt_callback( 39 | lambda mnemonic_language: fuzzy_reverse_dict_lookup(mnemonic_language, MNEMONIC_LANG_OPTIONS), 40 | choice_prompt_func(lambda: load_text(['arg_mnemonic_language', 'prompt'], func='new_mnemonic'), languages), 41 | ), 42 | default=lambda: load_text(['arg_mnemonic_language', 'default'], func='new_mnemonic'), 43 | help=lambda: load_text(['arg_mnemonic_language', 'help'], func='new_mnemonic'), 44 | param_decls='--mnemonic_language', 45 | prompt=choice_prompt_func(lambda: load_text(['arg_mnemonic_language', 'prompt'], func='new_mnemonic'), languages), 46 | ) 47 | @generate_keys_arguments_decorator 48 | def new_mnemonic(ctx: click.Context, mnemonic_language: str, **kwargs: Any) -> None: 49 | mnemonic = get_mnemonic(language=mnemonic_language, words_path=WORD_LISTS_PATH) 50 | test_mnemonic = '' 51 | while mnemonic != reconstruct_mnemonic(test_mnemonic, WORD_LISTS_PATH): 52 | click.clear() 53 | click.echo(load_text(['msg_mnemonic_presentation'])) 54 | click.echo('\n\n%s\n\n' % mnemonic) 55 | click.pause(load_text(['msg_press_any_key'])) 56 | 57 | click.clear() 58 | test_mnemonic = click.prompt(load_text(['msg_mnemonic_retype_prompt']) + '\n\n') 59 | click.clear() 60 | # Do NOT use mnemonic_password. 61 | ctx.obj = {'mnemonic': mnemonic, 'mnemonic_password': ''} 62 | ctx.params['validator_start_index'] = 0 63 | ctx.forward(generate_keys) 64 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/deposit.py: -------------------------------------------------------------------------------- 1 | import click 2 | import sys 3 | 4 | from staking_deposit.cli.existing_mnemonic import existing_mnemonic 5 | from staking_deposit.cli.generate_bls_to_execution_change import generate_bls_to_execution_change 6 | from staking_deposit.cli.new_mnemonic import new_mnemonic 7 | from staking_deposit.utils.click import ( 8 | captive_prompt_callback, 9 | choice_prompt_func, 10 | jit_option, 11 | ) 12 | from staking_deposit.utils import config 13 | from staking_deposit.utils.constants import INTL_LANG_OPTIONS 14 | from staking_deposit.utils.intl import ( 15 | get_first_options, 16 | fuzzy_reverse_dict_lookup, 17 | load_text, 18 | ) 19 | 20 | 21 | def check_python_version() -> None: 22 | ''' 23 | Checks that the python version running is sufficient and exits if not. 24 | ''' 25 | if sys.version_info < (3, 7): 26 | click.pause(load_text(['err_python_version'])) 27 | sys.exit() 28 | 29 | 30 | @click.group() 31 | @click.pass_context 32 | @jit_option( 33 | '--language', 34 | callback=captive_prompt_callback( 35 | lambda language: fuzzy_reverse_dict_lookup(language, INTL_LANG_OPTIONS), 36 | choice_prompt_func(lambda: 'Please choose your language', get_first_options(INTL_LANG_OPTIONS)), 37 | ), 38 | default='English', 39 | help='The language you wish to use the CLI in.', 40 | prompt=choice_prompt_func(lambda: 'Please choose your language', get_first_options(INTL_LANG_OPTIONS))(), 41 | type=str, 42 | ) 43 | @click.option( 44 | '--non_interactive', 45 | default=False, 46 | is_flag=True, 47 | help='Disables interactive prompts. Warning: with this flag, there will be no confirmation step(s) to verify the input value(s). Please use it carefully.', # noqa: E501 48 | hidden=False, 49 | ) 50 | def cli(ctx: click.Context, language: str, non_interactive: bool) -> None: 51 | config.language = language 52 | config.non_interactive = non_interactive # Remove interactive commands 53 | 54 | 55 | cli.add_command(existing_mnemonic) 56 | cli.add_command(new_mnemonic) 57 | cli.add_command(generate_bls_to_execution_change) 58 | 59 | 60 | if __name__ == '__main__': 61 | check_python_version() 62 | print('\n***Using the tool on an offline and secure device is highly recommended to keep your mnemonic safe.***\n') 63 | cli() 64 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/exceptions.py: -------------------------------------------------------------------------------- 1 | class ValidationError(Exception): 2 | ... 3 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/engram-network/tokio-docker/14c03b1d1d5b98f085922f6ed6905c98f3699a8d/engram-deposit-cli/staking_deposit/intl/__init__.py -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/ar/cli/existing_mnemonic.json: -------------------------------------------------------------------------------- 1 | { 2 | "validate_mnemonic": { 3 | "err_invalid_mnemonic": "هذا ليس مساعد ذاكرة صالحا، يرجى التحقق من الأخطاء المطبعية." 4 | }, 5 | "existing_mnemonic": { 6 | "arg_existing_mnemonic": { 7 | "help": "إنشاء (أو استرداد) مفاتيح من مساعد ذاكرة موجود" 8 | }, 9 | "arg_mnemonic": { 10 | "help": "مساعد الذاكرة الذي استخدمته لتوليد مفاتيحك. (يوصى بعدم استخدام هذه الوسيطة، وانتظر حتى يطلب منك الـ CLI مساعد الذاكرة الخاص وإلا فإنها ستظهر في سجل الغلاف الخاص بك.)", 11 | "prompt": "الرجاء إدخال مساعد الذاكرة الخاص بك مفصولة بمسافات (\" \")" 12 | }, 13 | "arg_mnemonic_password": { 14 | "help": "من المؤكد تقريبًا أن هذه ليست الوسيطة التي تبحث عنها: فهي لكلمات مرور مساعد الذاكرة، وليس كلمات مرور متجر المفاتيح. وقد يؤدي توفير كلمة مرور هنا عند عدم استخدامك لواحدة في البداية إلى فقدان المفاتيح (وبالتالي الأموال)! لاحظ أيضًا أنه إذا كنت تستخدم هذه الأداة لتوليد مساعد الذاكرة في البداية، فإنك لم تستخدم كلمة مرور مساعد الذاكرة. ومع ذلك، إذا كنت متأكداً من أنك استخدمت كلمة مرور \"لزيادة\" أمان مساعدة الذاكرة الخاصة بك، فهذا هو المكان حيث أدخلتها.", 15 | "confirm": "هل أنت متأكد تماما من أنك استخدمت كلمة مرور مساعد الذاكرة؟ (هذا مختلف عن كلمة مرور متجر المفاتيح!) من المفترض أن يؤدي استخدام واحدة عند عدم افتراض استخدامها إلى فقدان الأموال! كرر للتأكيد" 16 | }, 17 | "arg_validator_start_index": { 18 | "help": "أدخل الفهرس (الرقم الرئيسي) الذي تريد بدء توليد المزيد من المفاتيح منه. على سبيل المثال، إذا قمت بتوليد 4 مفاتيح في الماضي، فإنك ستدخل 4 هنا.", 19 | "prompt": "أدخل الفهرس (الرقم الرئيسي) الذي تريد بدء توليد المزيد من المفاتيح منه. على سبيل المثال، إذا قمت بتوليد 4 مفاتيح في الماضي، فإنك ستدخل 4 هنا.", 20 | "confirm": "كرر للتأكيد" 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/ar/cli/generate_keys.json: -------------------------------------------------------------------------------- 1 | { 2 | "generate_keys_arguments_decorator": { 3 | "num_validators": { 4 | "help": "عدد مفاتيح المدققين التي تريد إنشاؤها (يمكنك دائمًا إنشاء المزيد في وقت لاحق)", 5 | "prompt": "الرجاء اختيار عدد المدققين الذين ترغب في تشغيلهم" 6 | }, 7 | "chain": { 8 | "help": "إصدار Ethereum PoS الذي تستهدفه. استخدم \"mainnet\" إذا كنت تودع ETH", 9 | "prompt": "الرجاء اختيار اسم الشبكة/السلسلة (mainnet أو testnet)" 10 | }, 11 | "keystore_password": { 12 | "help": "كلمة المرور التي ستؤمن متاجر المفاتيح الخاصة بك. وسوف تحتاج إلى إعادة إدخال هذا لفك تشفيرها عند إعداد مدققي Ethereum PoS الخاصي بك. (يوصى بعدم استخدام هذه الوسيطة، وانتظر حتى يطلب منك الـ CLI مساعد الذاكرة الخاص وإلا فإنها ستظهر في سجل الغلاف الخاص بك.)", 13 | "prompt": "كلمة المرور التي سوف تؤمن متاجر المفاتيح الخاصة بك. سوف تحتاج إلى إعادة إدخال هذا لفك تشفيرها عند إعداد مدققي Ethereum PoS الخاصين بك.", 14 | "confirm": "كرر للتأكيد", 15 | "mismatch": "خطأ: القيمتان اللتان تم إدخالهما غير متطابقتين. الرجاء الكتابة مرة أخرى." 16 | } 17 | }, 18 | "generate_keys": { 19 | "msg_key_creation": "إنشاء مفاتيحك.", 20 | "msg_creation_success": "\nنجحت!\nيمكن العثور على مفاتيحك في: ", 21 | "msg_pause": "\n\nاضغط على أي مفتاح.", 22 | "err_verify_keystores": "فشل التحقق من متاجر المفاتيح.", 23 | "err_verify_deposit": "فشل التحقق من ملفات بيانات الإيداع JSON." 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/ar/cli/new_mnemonic.json: -------------------------------------------------------------------------------- 1 | { 2 | "new_mnemonic": { 3 | "arg_new_mnemonic": { 4 | "help": "إنشاء مساعد ذاكرة جديد ومفاتيح جديدة" 5 | }, 6 | "arg_mnemonic_language": { 7 | "default": "english", 8 | "help": "اللغة التي يتكلمها مساعد الذاكرة الخاص بك", 9 | "prompt": "الرجاء اختيار لغة مساعد الذاكرة الخاص بك" 10 | }, 11 | "msg_mnemonic_presentation": "هذا هو مساعد الذاكرة الخاصة بك (العبارة الأصلية). قم بكتابتها وتخزينها بأمان، وهي الطريقة الوحيدة لاسترداد وديعتك.", 12 | "msg_press_any_key": "اضغط على أي مفتاح عندما تكون قد دونت مساعد الذاكرة الخاص بك.", 13 | "msg_mnemonic_retype_prompt": "الرجاء كتابة مساعد الذاكرة الخاص بك (مفصولاً بمسافات) لتأكيد أنك دونته" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/ar/credentials.json: -------------------------------------------------------------------------------- 1 | { 2 | "from_mnemonic": { 3 | "msg_key_creation": "إنشاء المفاتيح الخاصة بك:\t\t" 4 | }, 5 | "export_keystores": { 6 | "msg_keystore_creation": "إنشاء متاجر المفاتيح الخاصة بك:\t" 7 | }, 8 | "export_deposit_data_json": { 9 | "msg_depositdata_creation": "إنشاء بيانات الإيداع الخاصة بك:\t" 10 | }, 11 | "verify_keystores": { 12 | "msg_keystore_verification": "التحقق من متاجر المفاتيح الخاصة بك:\t" 13 | } 14 | } -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/ar/deposit.json: -------------------------------------------------------------------------------- 1 | { 2 | "check_python_version": { 3 | "err_python_version": "إصدار بايثون الخاص بك غير كافٍ، يرجى تثبيت الإصدار 3.8 أو الأحدث." 4 | } 5 | } -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/ar/utils/validation.json: -------------------------------------------------------------------------------- 1 | { 2 | "verify_deposit_data_json": { 3 | "msg_deposit_verification": "التحقق من الإيداعات الخاصة بك:\t" 4 | }, 5 | "validate_password_strength": { 6 | "msg_password_length": "يجب أن يكون طول كلمة المرور 8 على الأقل. الرجاء إعادة الكتابة" 7 | } 8 | } -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/el/cli/existing_mnemonic.json: -------------------------------------------------------------------------------- 1 | { 2 | "validate_mnemonic": { 3 | "err_invalid_mnemonic": "Αυτό δεν είναι έγκυρο μνημονικό, παρακαλώ ελέγξτε για ορθογραφικά." 4 | }, 5 | "existing_mnemonic": { 6 | "arg_existing_mnemonic": { 7 | "help": "Δημιουργία (ή ανάκτηση) κλειδιών από υπάρχον μνημονικό" 8 | }, 9 | "arg_mnemonic": { 10 | "help": "Το μνημονικό που χρησιμοποιήσατε για τη δημιουργία των κλειδιών σας. (Συνιστάται να μην χρησιμοποιήσετε αυτή την παράμετρο, και να περιμένετε το CLI να σας ζητήσει το μνημονικό σας, διαφορετικά θα εμφανιστεί στο ιστορικό κελύφους σας.)", 11 | "prompt": "Παρακαλώ εισάγετε το μνημονικό σας διαχωρισμένο με κενά διαστήματα (\" \")" 12 | }, 13 | "arg_mnemonic_password": { 14 | "help": "Είναι σχεδόν βέβαιο ότι αυτή δεν είναι η παράμετρος που ψάχνετε: είναι για κωδικούς πρόσβασης μνημονικού, όχι κωδικούς πρόσβασης χώρου αποθήκευσης κλειδιών. Η παροχή κωδικού πρόσβασης ενώ δεν χρησιμοποιήσατε έναν αρχικά, μπορεί να οδηγήσει σε χαμένα κλειδιά (και επομένως κεφάλαια)! Επίσης, σημειώστε ότι αν χρησιμοποιήσατε αυτό το εργαλείο για να δημιουργήσετε το μνημονικό σας σε πρώτη φάση, τότε δεν χρησιμοποιήσατε έναν κωδικό πρόσβασης μνημονικού. Ωστόσο, αν είστε σίγουροι ότι χρησιμοποιήσατε έναν κωδικό πρόσβασης για να \"αυξήσετε\" την ασφάλεια του μνημονικού σας, πρέπει να τον πληκτρολογήσετε εδώ.", 15 | "confirm": "Είστε απολύτως βέβαιοι ότι χρησιμοποιήσατε έναν κωδικό πρόσβασης μνημονικού; (Είναι διαφορετικό από έναν κωδικό πρόσβασης χώρου αποθήκευσης κλειδιών! Χρησιμοποιώντας έναν, ενώ υποτίθεται ότι δεν πρέπει μπορεί να οδηγήσει σε απώλεια κεφαλαίων! Επανάληψη για επιβεβαίωση" 16 | }, 17 | "arg_validator_start_index": { 18 | "help": "Εισάγετε το ευρετήριο (αριθμός κλειδιού) από το οποίο θέλετε να αρχίσετε να δημιουργείτε περισσότερα κλειδιά. Για παράδειγμα, αν έχετε δημιουργήσει 4 κλειδιά στο παρελθόν, θα εισάγετε 4 εδώ.", 19 | "prompt": "Εισάγετε το ευρετήριο (αριθμός κλειδιού) από το οποίο θέλετε να αρχίσετε να δημιουργείτε περισσότερα κλειδιά. Για παράδειγμα, αν έχετε δημιουργήσει 4 κλειδιά στο παρελθόν, θα εισάγετε 4 εδώ.", 20 | "confirm": "Επανάληψη για επιβεβαίωση" 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/el/cli/generate_keys.json: -------------------------------------------------------------------------------- 1 | { 2 | "generate_keys_arguments_decorator": { 3 | "num_validators": { 4 | "help": "Ο αριθμός των κλειδιών επαληθευτών που θέλετε να δημιουργήσετε (μπορείτε πάντα να δημιουργήσετε περισσότερα αργότερα)", 5 | "prompt": "Παρακαλώ επιλέξτε πόσους επαληθευτές θέλετε να εκτελέσετε" 6 | }, 7 | "chain": { 8 | "help": "Η έκδοση του Ethereum Proof-of-Stake στην οποία στοχεύετε. Χρησιμοποιήστε το \"mainnet\" αν κάνετε κατάθεση ETH", 9 | "prompt": "Παρακαλώ επιλέξτε το όνομα δικτύου/αλυσίδας (κεντρικό δίκτυο ή δίκτυο δοκιμών)" 10 | }, 11 | "keystore_password": { 12 | "help": "Ο κωδικός πρόσβασης που θα ασφαλίσει τον χώρο αποθήκευσης των κλειδιών σας. Θα πρέπει να το εισάγετε ξανά για να τα αποκρυπτογραφήσετε όταν ρυθμίσετε τους επαληθευτές σας. (Συνιστάται να μην χρησιμοποιήσετε αυτή την παράμετρο, και να περιμένετε το CLI να σας ρωτήσει για το μνημονικό σας, διαφορετικά θα εμφανιστεί στο ιστορικό κελύφους σας.)", 13 | "prompt": "Ο κωδικός πρόσβασης που θα ασφαλίσει τους χώρους αποθήκευσης κλειδιών σας. Θα πρέπει να τον εισάγετε ξανά για να τον αποκρυπτογραφήσετε όταν ρυθμίσετε τους επαληθευτές σας.", 14 | "confirm": "Επανάληψη για επιβεβαίωση", 15 | "mismatch": "Σφάλμα: οι δύο εισαχθείσες τιμές δεν ταιριάζουν. Παρακαλώ πληκτρολογήστε ξανά." 16 | } 17 | }, 18 | "generate_keys": { 19 | "msg_key_creation": "Δημιουργώντας τα κλειδιά σας.", 20 | "msg_creation_success": "\nΕπιτυχία!\nΤα κλειδιά σας μπορούν να βρεθούν στο: ", 21 | "msg_pause": "\n\nΠιέστε οποιοδήποτε πλήκτρο.", 22 | "err_verify_keystores": "Αποτυχία επαλήθευσης των χώρων αποθήκευσης των κλειδιών.", 23 | "err_verify_deposit": "Αποτυχία επαλήθευσης των αρχείων JSON δεδομένων κατάθεσης." 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/el/cli/new_mnemonic.json: -------------------------------------------------------------------------------- 1 | { 2 | "new_mnemonic": { 3 | "arg_new_mnemonic": { 4 | "help": "Δημιουργία νέου μνημονικού και κλειδιών" 5 | }, 6 | "arg_mnemonic_language": { 7 | "default": "english", 8 | "help": "Η γλώσσα του μνημονικού σας", 9 | "prompt": "Επιλέξτε τη γλώσσα του μνημονικού σας" 10 | }, 11 | "msg_mnemonic_presentation": "Αυτό είναι το μνημονικό σας (σειρά λέξεων). Γράψτε την και αποθηκεύστε την με ασφάλεια, είναι ο ΜΟΝΟΣ τρόπος για να ανακτήσετε την κατάθεσή σας.", 12 | "msg_press_any_key": "Πιέστε οποιοδήποτε πλήκτρο όταν έχετε καταγράψει το μνημονικό σας.", 13 | "msg_mnemonic_retype_prompt": "Πληκτρολογήστε το μνημονικό σας (διαχωρισμένο με κενά) για να επιβεβαιώσετε ότι το έχετε καταγράψει" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/el/credentials.json: -------------------------------------------------------------------------------- 1 | { 2 | "from_mnemonic": { 3 | "msg_key_creation": "Δημιουργώντας τα κλειδιά σας:\t\t" 4 | }, 5 | "export_keystores": { 6 | "msg_keystore_creation": "Δημιουργώντας τους χώρους αποθήκευσης των κλειδιών σας:\t" 7 | }, 8 | "export_deposit_data_json": { 9 | "msg_depositdata_creation": "Δημιουργώντας τα δεδομένα κατάθεσής σας:\t" 10 | }, 11 | "verify_keystores": { 12 | "msg_keystore_verification": "Δημιουργώντας τους χώρους αποθήκευσης των κλειδιών σας:\t" 13 | } 14 | } -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/el/deposit.json: -------------------------------------------------------------------------------- 1 | { 2 | "check_python_version": { 3 | "err_python_version": "Η έκδοση python σας δεν είναι επαρκής, εγκαταστήστε την έκδοση 3.8 ή μεγαλύτερη." 4 | } 5 | } -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/el/utils/validation.json: -------------------------------------------------------------------------------- 1 | { 2 | "verify_deposit_data_json": { 3 | "msg_deposit_verification": "Επαλήθευση των καταθέσεών σας:\t" 4 | }, 5 | "validate_password_strength": { 6 | "msg_password_length": "Το μήκος του κωδικού πρόσβασης πρέπει να είναι τουλάχιστον 8. Πληκτρολογήστε ξανά" 7 | } 8 | } -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/en/cli/existing_mnemonic.json: -------------------------------------------------------------------------------- 1 | { 2 | "validate_mnemonic": { 3 | "err_invalid_mnemonic": "That is not a valid mnemonic, please check for typos." 4 | }, 5 | "existing_mnemonic": { 6 | "arg_existing_mnemonic": { 7 | "help": "Generate (or recover) keys from an existing mnemonic" 8 | }, 9 | "arg_mnemonic": { 10 | "help": "The mnemonic that you used to generate your keys. (It is recommended not to use this argument, and wait for the CLI to ask you for your mnemonic as otherwise it will appear in your shell history.)", 11 | "prompt": "Please enter your mnemonic separated by spaces (\" \"). Note: you only need to enter the first 4 letters of each word if you'd prefer." 12 | }, 13 | "arg_mnemonic_password": { 14 | "help": "This is almost certainly not the argument you are looking for: it is for mnemonic passwords, not keystore passwords. Providing a password here when you didn't use one initially, can result in lost keys (and therefore funds)! Also note that if you used this tool to generate your mnemonic initially, then you did not use a mnemonic password. However, if you are certain you used a password to \"increase\" the security of your mnemonic, this is where you enter it.", 15 | "prompt": "Enter your mnemonic password (if you used one). Make sure you won't forget it, it can not be recovered.", 16 | "confirm": "Repeat your mnemonic password for confirmation. Providing a password here when you didn't use one initially, can result in lost keys (and therefore funds)! Also note that if you used this tool to generate your mnemonic initially, then you did not use a mnemonic password. However, if you are certain you used a password to \"increase\" the security of your mnemonic, this is where you enter it.", 17 | "mismatch": "The mnemonic password you entered doesn't match, please try again." 18 | }, 19 | "arg_validator_start_index": { 20 | "help": "Enter the index (key number) you wish to start generating more keys from. For example, if you've generated 4 keys in the past, you'd enter 4 here.", 21 | "prompt": "Enter the index (key number) you wish to start generating more keys from. For example, if you've generated 4 keys in the past, you'd enter 4 here.", 22 | "confirm": "Please repeat the index to confirm" 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/en/cli/generate_bls_to_execution_change.json: -------------------------------------------------------------------------------- 1 | { 2 | "generate_bls_to_execution_change": { 3 | "arg_generate_bls_to_execution_change" :{ 4 | "help": "Generating the SignedBLSToExecutionChange data to enable withdrawals on Ethereum Beacon Chain." 5 | }, 6 | "arg_execution_address": { 7 | "help": "The 20-byte (Eth1) execution address that will be used in withdrawal", 8 | "prompt": "Please enter the 20-byte execution address for the new withdrawal credentials. Note that you CANNOT change it once you have set it on chain.", 9 | "confirm": "Repeat your execution address for confirmation.", 10 | "mismatch": "Error: the two entered values do not match. Please type again." 11 | }, 12 | "arg_validator_indices": { 13 | "help": "A list of the validator index number(s) of the certain validator(s)", 14 | "prompt": "Please enter a list of the validator index number(s) of your validator(s) as identified on the beacon chain. Split multiple items with whitespaces or commas." 15 | }, 16 | "arg_bls_withdrawal_credentials_list": { 17 | "help": "A list of 32-byte old BLS withdrawal credentials of the certain validator(s)", 18 | "prompt": "Please enter a list of the old BLS withdrawal credentials of your validator(s). Split multiple items with whitespaces or commas. The withdrawal credentials are in hexadecimal encoded form." 19 | }, 20 | "arg_validator_start_index": { 21 | "help": "The index position for the keys to start generating withdrawal credentials in ERC-2334 format", 22 | "prompt": "Please enter the index position for the keys to start generating withdrawal credentials in ERC-2334 format.", 23 | "confirm": "Please repeat the index to confirm" 24 | }, 25 | "arg_chain": { 26 | "help": "The name of Ethereum PoS chain you are targeting. Use \"mainnet\" if you are depositing ETH", 27 | "prompt": "Please choose the (mainnet or testnet) network/chain name" 28 | }, 29 | "arg_fork": { 30 | "help": "The fork name of the fork you want to signing the message with.", 31 | "prompt": "Please choose the fork name of the fork you want to signing the message with." 32 | }, 33 | "arg_bls_to_execution_changes_folder": { 34 | "help": "The folder path for the keystore(s). Pointing to `./bls_to_execution_changes` by default." 35 | }, 36 | "msg_key_creation": "Creating your SignedBLSToExecutionChange.", 37 | "msg_creation_success": "\nSuccess!\nYour SignedBLSToExecutionChange JSON file can be found at: ", 38 | "msg_pause": "\n\nPress any key.", 39 | "err_verify_btec": "Failed to verify the bls_to_execution_change JSON files." 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/en/cli/generate_keys.json: -------------------------------------------------------------------------------- 1 | { 2 | "generate_keys_arguments_decorator": { 3 | "num_validators": { 4 | "help": "The number of new validator keys you want to generate (you can always generate more later)", 5 | "prompt": "Please choose how many new validators you wish to run" 6 | }, 7 | "folder": { 8 | "help": "The folder path for the keystore(s) and deposit(s). Pointing to `./validator_keys` by default." 9 | }, 10 | "chain": { 11 | "help": "The name of Ethereum PoS chain you are targeting. Use \"mainnet\" if you are depositing ETH", 12 | "prompt": "Please choose the (mainnet or testnet) network/chain name" 13 | }, 14 | "keystore_password": { 15 | "help": "The password that will secure your keystores. You will need to re-enter this to decrypt them when you setup your Ethereum validators. (It is recommended not to use this argument, and wait for the CLI to ask you for your mnemonic as otherwise it will appear in your shell history.)", 16 | "prompt": "Create a password that secures your validator keystore(s). You will need to re-enter this to decrypt them when you setup your Ethereum validators.", 17 | "confirm": "Repeat your keystore password for confirmation", 18 | "mismatch": "Error: the two entered values do not match. Please type again." 19 | }, 20 | "arg_execution_address": { 21 | "help": "The 20-byte (Eth1) execution address that will be used in withdrawal", 22 | "prompt": "Please enter the 20-byte execution address for the new withdrawal credentials. Note that you CANNOT change it once you have set it on chain.", 23 | "confirm": "Repeat your execution address for confirmation.", 24 | "mismatch": "Error: the two entered values do not match. Please type again." 25 | } 26 | }, 27 | "generate_keys": { 28 | "msg_key_creation": "Creating your keys.", 29 | "msg_creation_success": "\nSuccess!\nYour keys can be found at: ", 30 | "msg_pause": "\n\nPress any key.", 31 | "err_verify_keystores": "Failed to verify the keystores.", 32 | "err_verify_deposit": "Failed to verify the deposit data JSON files." 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/en/cli/new_mnemonic.json: -------------------------------------------------------------------------------- 1 | { 2 | "new_mnemonic": { 3 | "arg_new_mnemonic": { 4 | "help": "Generate a new mnemonic and keys" 5 | }, 6 | "arg_mnemonic_language": { 7 | "default": "english", 8 | "help": "The language of the mnemonic word list", 9 | "prompt": "Please choose the language of the mnemonic word list" 10 | }, 11 | "msg_mnemonic_presentation": "This is your mnemonic (seed phrase). Write it down and store it safely. It is the ONLY way to retrieve your deposit.", 12 | "msg_press_any_key": "Press any key when you have written down your mnemonic.", 13 | "msg_mnemonic_retype_prompt": "Please type your mnemonic (separated by spaces) to confirm you have written it down. Note: you only need to enter the first 4 letters of each word if you'd prefer." 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/en/credentials.json: -------------------------------------------------------------------------------- 1 | { 2 | "from_mnemonic": { 3 | "msg_key_creation": "Creating your keys:\t\t" 4 | }, 5 | "export_keystores": { 6 | "msg_keystore_creation": "Creating your keystores:\t" 7 | }, 8 | "export_deposit_data_json": { 9 | "msg_depositdata_creation": "Creating your depositdata:\t" 10 | }, 11 | "export_bls_to_execution_change_json": { 12 | "msg_bls_to_execution_change_creation": "Creating your SignedBLSToExecutionChange:\t" 13 | }, 14 | "verify_keystores": { 15 | "msg_keystore_verification": "Verifying your keystores:\t" 16 | } 17 | } -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/en/deposit.json: -------------------------------------------------------------------------------- 1 | { 2 | "check_python_version": { 3 | "err_python_version": "Your python version is insufficient, please install version 3.8 or greater." 4 | } 5 | } -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/en/utils/validation.json: -------------------------------------------------------------------------------- 1 | { 2 | "verify_deposit_data_json": { 3 | "msg_deposit_verification": "Verifying your deposits:\t" 4 | }, 5 | "validate_password_strength": { 6 | "msg_password_length": "The password length should be at least 8. Please retype" 7 | }, 8 | "validate_int_range": { 9 | "err_not_positive_integer": "That is not a positive integer. Please retype." 10 | }, 11 | "validate_choice": { 12 | "err_invalid_choice": "That is not one of the valid choices. Please retype your choice." 13 | }, 14 | "validate_eth1_withdrawal_address": { 15 | "err_invalid_ECDSA_hex_addr": "The given Eth1 address is not in hexadecimal encoded form.", 16 | "err_invalid_ECDSA_hex_addr_checksum": "The given Eth1 address is not in checksum form.", 17 | "msg_ECDSA_hex_addr_withdrawal": "**[Warning] you are setting an Eth1 address as your withdrawal address. Please ensure that you have control over this address.**" 18 | }, 19 | "validate_bls_withdrawal_credentials": { 20 | "err_is_already_eth1_form": "The given withdrawal credentials is already in ETH1_ADDRESS_WITHDRAWAL_PREFIX form. Have you already set the EL (eth1) withdrawal addresss?", 21 | "err_not_bls_form": "The given withdrawal credentials is not in BLS_WITHDRAWAL_PREFIX form." 22 | }, 23 | "validate_bls_withdrawal_credentials_matching": { 24 | "err_not_matching": "The given withdrawal credentials does not match the old BLS withdrawal credentials that mnemonic generated." 25 | }, 26 | "verify_bls_to_execution_change_json": { 27 | "msg_bls_to_execution_change_verification": "Verifying your BLSToExecutionChange file:\t" 28 | }, 29 | "normalize_bls_withdrawal_credentials_to_bytes" :{ 30 | "err_incorrect_hex_form": "The given input is not in hexadecimal encoded form." 31 | 32 | }, 33 | "normalize_input_list": { 34 | "err_incorrect_list": "The given input should be a list of the old BLS withdrawal credentials of your validator(s). Split multiple items with whitespaces or commas." 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/fr/cli/existing_mnemonic.json: -------------------------------------------------------------------------------- 1 | { 2 | "validate_mnemonic": { 3 | "err_invalid_mnemonic": "Ceci n'est pas une phrase mnémonique valide, veuillez vérifier s'il existe des fautes de frappe." 4 | }, 5 | "existing_mnemonic": { 6 | "arg_existing_mnemonic": { 7 | "help": "Générer (ou récupérer) des clés à partir d'une phrase mnémonique existante" 8 | }, 9 | "arg_mnemonic": { 10 | "help": "Phrase mnémonique que vous avez utilisée pour générer vos clés. (Il est recommandé de ne pas utiliser ce argument, et d'attendre que l'ILC vous demande votre élément mnémonique, sinon il apparaîtra dans l'historique de votre interpréteur.)", 11 | "prompt": "Veuillez saisir votre phrase mnémonique en séparant les mots par des espaces (\" \")" 12 | }, 13 | "arg_mnemonic_password": { 14 | "help": "Ce n'est certainement pas l'argument que vous recherchez : il est destiné aux mots de passe mnémoniques, pas aux mots de passe de keystores. Fournir un mot de passe ici sans en avoir un utilisé initialement peut entraîner la perte de clés (et donc de fonds) ! Notez également que si vous avez utilisé cet outil pour générer votre phrase mnémonique initialement, cela signifie que vous n'avez pas utilisé de mot de passe mnémonique. Cependant, si vous êtes certain d'avoir utilisé un mot de passe pour \"augmenter\" la sécurité de votre phrase mnémonique, c'est ici que vous devez le saisir.", 15 | "confirm": "Êtes-vous absolument certain d'avoir utilisé un mot de passe mnémonique ? (Différent d'un mot de passe de keystore !) Si vous en utilisez un sans être censé le faire, cela peut entraîner une perte de fonds ! Veuillez confirmer le mot de passe." 16 | }, 17 | "arg_validator_start_index": { 18 | "help": "Saisissez l'index (numéro de clé) à partir duquel vous souhaitez commencer à générer d'autres clés. Par exemple, si vous avez généré 4 clés dans le passé, entrez 4.", 19 | "prompt": "Saisissez l'index (numéro de clé) à partir duquel vous souhaitez commencer à générer d'autres clés. Par exemple, si vous avez généré 4 clés dans le passé, entrez 4.", 20 | "confirm": "Veuillez confirmer l'index." 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/fr/cli/generate_keys.json: -------------------------------------------------------------------------------- 1 | { 2 | "generate_keys_arguments_decorator": { 3 | "num_validators": { 4 | "help": "Nombre de clés de validateurs que vous souhaitez générer (vous pourrez en générer davantage plus tard)", 5 | "prompt": "Veuillez choisir le nombre de validateurs que vous souhaitez exécuter" 6 | }, 7 | "chain": { 8 | "help": "Version Ethereum Proof of Stake que vous ciblez. Utilisez \"mainnet\" si vous déposez de l'ETH.", 9 | "prompt": "Veuillez choisir un nom de chaîne/réseau : mainnet (réseau principal) ou testnet (réseau de test)." 10 | }, 11 | "keystore_password": { 12 | "help": "Mot de passe qui sécurisera vos keystores. Vous devrez le saisir de nouveau pour les décrypter quand vous configurerez vos validateurs Proof of Stake. (Il est recommandé de ne pas utiliser cet argument et d'attendre que l'ILC vous demande votre phrase mnémonique, sinon il apparaîtra dans l'historique de votre interpréteur.)", 13 | "prompt": "Mot de passe qui sécurisera vos keystores. Vous devrez le saisir de nouveau pour les décrypter quand vous configurerez vos validateurs Proof of Stake.", 14 | "confirm": "Veuillez confirmer le mot de passe.", 15 | "mismatch": "Erreur : Les deux valeurs saisies ne correspondent pas. Veuillez réessayer." 16 | } 17 | }, 18 | "generate_keys": { 19 | "msg_key_creation": "Création de vos clés.", 20 | "msg_creation_success": "\nOpération terminée !\nVos clés sont disponibles ici : ", 21 | "msg_pause": "\n\nAppuyez sur n'importe quelle touche.", 22 | "err_verify_keystores": "Impossible de vérifier les keystores.", 23 | "err_verify_deposit": "Impossible de vérifier les fichiers JSON des données de dépôt." 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/fr/cli/new_mnemonic.json: -------------------------------------------------------------------------------- 1 | { 2 | "new_mnemonic": { 3 | "arg_new_mnemonic": { 4 | "help": "Générer un nouvel élément mnémonique et des clés" 5 | }, 6 | "arg_mnemonic_language": { 7 | "default": "english", 8 | "help": "Langue de votre phrase mnémonique", 9 | "prompt": "Veuillez choisir la langue de votre phrase mnémonique." 10 | }, 11 | "msg_mnemonic_presentation": "Ceci est votre phrase mnémonique (seed). Notez-la et conservez-la en sécurité. Elle constitue le SEUL moyen de récupérer votre dépôt.", 12 | "msg_press_any_key": "Une fois que vous avez écrit votre phrase mnémonique, appuyez sur n'importe quelle touche.", 13 | "msg_mnemonic_retype_prompt": "Veuillez saisir votre phrase mnémonique (avec les mots séparés par des espaces) pour confirmer que vous l'avez écrite." 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/fr/credentials.json: -------------------------------------------------------------------------------- 1 | { 2 | "from_mnemonic": { 3 | "msg_key_creation": "Création de vos clés :\t\t" 4 | }, 5 | "export_keystores": { 6 | "msg_keystore_creation": "Création de vos keystores :\t" 7 | }, 8 | "export_deposit_data_json": { 9 | "msg_depositdata_creation": "Création de vos données de dépôt :\t" 10 | }, 11 | "verify_keystores": { 12 | "msg_keystore_verification": "Vérification de vos keystores :\t" 13 | } 14 | } -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/fr/deposit.json: -------------------------------------------------------------------------------- 1 | { 2 | "check_python_version": { 3 | "err_python_version": "Votre version de Python est insuffisante. Veuillez installer la version 3.8 ou supérieure." 4 | } 5 | } -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/fr/utils/validation.json: -------------------------------------------------------------------------------- 1 | { 2 | "verify_deposit_data_json": { 3 | "msg_deposit_verification": "Vérification de vos dépôts :\t" 4 | }, 5 | "validate_password_strength": { 6 | "msg_password_length": "Le mot de passe doit comporter au moins 8 caractères. Veuillez recommencer." 7 | } 8 | } -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/id/cli/existing_mnemonic.json: -------------------------------------------------------------------------------- 1 | { 2 | "validate_mnemonic": { 3 | "err_invalid_mnemonic": "Bukan mnemonik yang valid, harap pastikan tidak ada kesalahan ketik." 4 | }, 5 | "existing_mnemonic": { 6 | "arg_existing_mnemonic": { 7 | "help": "Buat (atau pulihkan) kunci dari mnemonik yang sudah ada" 8 | }, 9 | "arg_mnemonic": { 10 | "help": "Mnemonik yang Anda gunakan untuk membuat kunci Anda. (Disarankan tidak menggunakan argumen ini, dan menunggu CLI menanyakan mnemonik Anda supaya tidak akan muncul di riwayat shell Anda.)", 11 | "prompt": "Silakan masukkan mnemonik Anda dipisahkan dengan spasi (\" \")" 12 | }, 13 | "arg_mnemonic_password": { 14 | "help": "Ini kemungkinan bukan argumen yang Anda cari: ini untuk kata sandi mnemonik, bukan kata sandi keystore. Memasukkan kata sandi di sini ketika pada awalnya Anda tidak menggunakannya, dapat mengakibatkan kunci hilang (dan karenanya dana pun hilang)! Perhatikan juga bahwa jika Anda menggunakan alat ini untuk membuat mnemonik Anda pada awalnya, maka Anda tidak menggunakan kata sandi mnemonik. Namun, jika yakin Anda menggunakan kata sandi untuk \"meningkatkan\" keamanan mnemonik Anda, di sinilah Anda memasukkannya.", 15 | "confirm": "Apakah Anda benar-benar yakin bahwa Anda menggunakan kata sandi mnemonik? (Ini berbeda dari kata sandi keystore!) Menggunakan kata sandi saat Anda tidak seharusnya melakukannya dapat mengakibatkan hilangnya dana! Ulangi untuk konfirmasi" 16 | }, 17 | "arg_validator_start_index": { 18 | "help": "Masukkan indeks (nomor kunci) yang Anda inginkan untuk mulai membuat lebih banyak kunci. Misalnya, jika Anda pernah membuat 4 kunci sebelumnya, masukkan 4 di sini.", 19 | "prompt": "Masukkan indeks (nomor kunci) yang Anda inginkan untuk mulai membuat lebih banyak kunci. Misalnya, jika Anda pernah membuat 4 kunci sebelumnya, masukkan 4 di sini.", 20 | "confirm": "Ulangi untuk konfirmasi" 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/id/cli/generate_keys.json: -------------------------------------------------------------------------------- 1 | { 2 | "generate_keys_arguments_decorator": { 3 | "num_validators": { 4 | "help": "Jumlah kunci validator yang ingin Anda buat (Anda selalu dapat menghasilkan lebih banyak lagi nanti)", 5 | "prompt": "Silakan pilih berapa banyak validator yang ingin Anda jalankan" 6 | }, 7 | "chain": { 8 | "help": "Versi Ethereum PoS yang Anda targetkan. Gunakan \"mainnet\" jika Anda menyetorkan ETH", 9 | "prompt": "Pilih nama jaringan / rantai (mainnet atau testnet)" 10 | }, 11 | "keystore_password": { 12 | "help": "Kata sandi yang akan mengamankan keystore Anda. Anda perlu memasukkan ulang ini untuk mendekripsinya ketika Anda mengatur validator Ethereum PoS Anda. (Disarankan untuk tidak menggunakan argumen ini, dan tunggu CLI menanyakan mnemonik Anda supaya tidak akan muncul dalam riwayat shell Anda.)", 13 | "prompt": "Kata sandi yang akan mengamankan keystore Anda. Anda perlu memasukkan ulang ini untuk mendekripsinya ketika Anda mengatur validator Ethereum PoS Anda.", 14 | "confirm": "Ulangi untuk konfirmasi", 15 | "mismatch": "Kesalahan: dua nilai yang dimasukkan tidak cocok. Silakan ketik ulang." 16 | } 17 | }, 18 | "generate_keys": { 19 | "msg_key_creation": "Membuat kunci Anda.", 20 | "msg_creation_success": "\nSukses!\nKunci Anda dapat ditemukan di: ", 21 | "msg_pause": "\n\nTekan tombol apa saja.", 22 | "err_verify_keystores": "Gagal memverifikasi keystore.", 23 | "err_verify_deposit": "Gagal memverifikasi data setoran file JSON." 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/id/cli/new_mnemonic.json: -------------------------------------------------------------------------------- 1 | { 2 | "new_mnemonic": { 3 | "arg_new_mnemonic": { 4 | "help": "Buat mnemonik dan kunci baru" 5 | }, 6 | "arg_mnemonic_language": { 7 | "default": "english", 8 | "help": "Bahasa mnemonik Anda", 9 | "prompt": "Silakan pilih bahasa mnemonik Anda" 10 | }, 11 | "msg_mnemonic_presentation": "Ini adalah mnemonik Anda (frasa benih). Catat dan simpan dengan aman, ini adalah SATU-SATUNYA cara untuk mengambil deposit Anda.", 12 | "msg_press_any_key": "Tekan sembarang tombol setelah Anda menuliskan mnemonik Anda.", 13 | "msg_mnemonic_retype_prompt": "Harap ketik mnemonik Anda (dipisahkan dengan spasi) untuk mengonfirmasi bahwa Anda telah menuliskannya" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/id/credentials.json: -------------------------------------------------------------------------------- 1 | { 2 | "from_mnemonic": { 3 | "msg_key_creation": "Membuat kunci Anda:\t\t" 4 | }, 5 | "export_keystores": { 6 | "msg_keystore_creation": "Membuat keystore Anda:\t" 7 | }, 8 | "export_deposit_data_json": { 9 | "msg_depositdata_creation": "Membuat depositdata Anda:\t" 10 | }, 11 | "verify_keystores": { 12 | "msg_keystore_verification": "Memverifikasi keystore Anda:\t" 13 | } 14 | } -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/id/deposit.json: -------------------------------------------------------------------------------- 1 | { 2 | "check_python_version": { 3 | "err_python_version": "Versi python Anda tidak cukup, harap instal versi 3.8 atau yang lebih baru." 4 | } 5 | } -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/id/utils/validation.json: -------------------------------------------------------------------------------- 1 | { 2 | "verify_deposit_data_json": { 3 | "msg_deposit_verification": "Memverifikasi deposit Anda:\t" 4 | }, 5 | "validate_password_strength": { 6 | "msg_password_length": "Panjang kata sandi minimal harus 8. Harap ketik ulang" 7 | } 8 | } -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/it/cli/existing_mnemonic.json: -------------------------------------------------------------------------------- 1 | { 2 | "validate_mnemonic": { 3 | "err_invalid_mnemonic": "Questo non è un mnemonico valido. Controlla che la grafia sia corretta." 4 | }, 5 | "existing_mnemonic": { 6 | "arg_existing_mnemonic": { 7 | "help": "Genera (o recupera) chiavi da un mnemonico esistente" 8 | }, 9 | "arg_mnemonic": { 10 | "help": "Il mnemonico che hai usato per generare le chiavi (è consigliabile non utilizzare questo argomento e attendere che il CLI chieda il mnemonico, altrimenti apparirà nella cronologia della shell).", 11 | "prompt": "Inserisci il mnemonico separato da spazi (\" \")" 12 | }, 13 | "arg_mnemonic_password": { 14 | "help": "Quasi sicuramente questo non è l'argomento che stai cercando: è per le password mnemoniche, non per le password dell'archivio chiavi. Fornire una password qui se non ne hai utilizzata una inizialmente può causare la perdita di chiavi (e quindi fondi)! Tieni presente inoltre che se hai usato questo strumento per generare il tuo mnemonico inizialmente, significa che non hai usato una password mnemonica. Se invece hai la certezza di aver usato una password per \"aumentare\" la sicurezza del tuo mnemonico, inseriscila qui.", 15 | "confirm": "Hai la certezza assoluta di aver usato una password mnemonica? È diversa da una password dell'archivio chiavi. Se non devi utilizzarne una ma lo fai, potresti perdere fondi! Ripeti per conferma" 16 | }, 17 | "arg_validator_start_index": { 18 | "help": "Inserisci l'indice (numero di chiave) da cui desideri iniziare a generare ulteriori chiavi. Ad esempio, se hai generato 4 chiavi in passato, inserisci 4.", 19 | "prompt": "Inserisci l'indice (numero di chiave) da cui desideri iniziare a generare ulteriori chiavi. Ad esempio, se hai generato 4 chiavi in passato, inserisci 4.", 20 | "confirm": "Ripeti per conferma" 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/it/cli/generate_keys.json: -------------------------------------------------------------------------------- 1 | { 2 | "generate_keys_arguments_decorator": { 3 | "num_validators": { 4 | "help": "Il numero di chiavi di validatori che si desidera generare (è sempre possibile generarne altre in seguito)", 5 | "prompt": "Scegli quanti validatori vuoi eseguire" 6 | }, 7 | "chain": { 8 | "help": "La versione desiderata della Ethereum PoS chain. Utilizzare \"mainnet\" se depositano ETH", 9 | "prompt": "Scegli il nome delle rete/catena (rete principale o di test)" 10 | }, 11 | "keystore_password": { 12 | "help": "La password che proteggerà gli archivi chiavi. Dovrà essere inserita per decrittografare le chiavi durante la configurazione dei validatori della Ethereum PoS chain (è consigliabile non utilizzare questo argomento e attendere che il CLI chieda il mnemonico, altrimenti apparirà nella cronologia della shell).", 13 | "prompt": "La password che proteggerà gli archivi chiavi. Dovrai inserirla nuovamente per decrittografare gli archivi quando configurerai i tuoi validatori.", 14 | "confirm": "Ripeti per conferma", 15 | "mismatch": "Errore: i due valori inseriti non corrispondono. Ripeti l'inserimento." 16 | } 17 | }, 18 | "generate_keys": { 19 | "msg_key_creation": "Creazione delle tue chiavi.", 20 | "msg_creation_success": "\nOperazione riuscita.\nLe tue chiavi si trovano in: ", 21 | "msg_pause": "\n\nPremi qualunque tasto.", 22 | "err_verify_keystores": "Verifica degli archivi chiavi non riuscita.", 23 | "err_verify_deposit": "Verifica dei file JSON dei dati di deposito non riuscita." 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/it/cli/new_mnemonic.json: -------------------------------------------------------------------------------- 1 | { 2 | "new_mnemonic": { 3 | "arg_new_mnemonic": { 4 | "help": "Genera un nuovo mnemonico e chiavi" 5 | }, 6 | "arg_mnemonic_language": { 7 | "default": "Italiano", 8 | "help": "La lingua del mnemonico", 9 | "prompt": "Scegli la lingua del mnemonico" 10 | }, 11 | "msg_mnemonic_presentation": "Questo è il tuo mnemonico (seed phrase). Prendi nota e tienilo in un luogo sicuro. Rappresenta l'UNICO modo per recuperare il tuo deposito.", 12 | "msg_press_any_key": "Dopo aver preso nota del mnemonico, premi qualsiasi tasto.", 13 | "msg_mnemonic_retype_prompt": "Digita il tuo mnemonico (separato da spazi) per confermare di averlo scritto." 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/it/credentials.json: -------------------------------------------------------------------------------- 1 | { 2 | "from_mnemonic": { 3 | "msg_key_creation": "Creazione delle tue chiavi:\t\t" 4 | }, 5 | "export_keystores": { 6 | "msg_keystore_creation": "Creazione dei tuoi archivi chiavi:\t" 7 | }, 8 | "export_deposit_data_json": { 9 | "msg_depositdata_creation": "Creazione dei tuoi dati di deposito:\t" 10 | }, 11 | "verify_keystores": { 12 | "msg_keystore_verification": "Verifica dei tuoi archivi chiavi:\t" 13 | } 14 | } -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/it/deposit.json: -------------------------------------------------------------------------------- 1 | { 2 | "check_python_version": { 3 | "err_python_version": "La tua versione di python non è sufficiente, installa la versione 3.8 o superiore." 4 | } 5 | } -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/it/utils/validation.json: -------------------------------------------------------------------------------- 1 | { 2 | "verify_deposit_data_json": { 3 | "msg_deposit_verification": "Verifica dei tuoi depositi:\t" 4 | }, 5 | "validate_password_strength": { 6 | "msg_password_length": "La lunghezza della password deve essere almeno di 8 caratteri. Ripetila" 7 | } 8 | } -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/ja/cli/existing_mnemonic.json: -------------------------------------------------------------------------------- 1 | { 2 | "validate_mnemonic": { 3 | "err_invalid_mnemonic": "有効なニーモニックではありません。誤字を確認してください。" 4 | }, 5 | "existing_mnemonic": { 6 | "arg_existing_mnemonic": { 7 | "help": "既存のニーモニックからキーを生成(または回復)" 8 | }, 9 | "arg_mnemonic": { 10 | "help": "キーを生成するために使用したニーモニック。 (この引数を使用せずに、CLIからニーモニックの入力が求められるのを待つことを推奨します。そうしないとこれがシェル履歴に表示されてしまいます。)", 11 | "prompt": "スペースで区切られたニーモニックを入力してください (\"\")" 12 | }, 13 | "arg_mnemonic_password": { 14 | "help": "これは、ほぼ間違いなくあなたが探している引数ではありません。キーストアのパスワードではなく、ニーモニックのパスワードです。 最初にこれを使用せずにパスワードを提供すると、キー (資金) が失われる可能性があります! また、最初にこのツールを使用してニーモニックを生成した場合は、ニーモニックパスワードを使用しなかったことに注意してください。 ただし、ニーモニックのセキュリティを「向上させる」ためにパスワードを使用したことが確実であれば、ここで入力します。", 15 | "confirm": "ニーモニックパスワードを使用したことは間違いありませんか? (ニーモニックパスワードはキーストアのパスワードとは異なります! 使用するべきでないときにこのパスワードを使用すると、資金が失われる可能性があります! 確認のために繰り返し入力してください。" 16 | }, 17 | "arg_validator_start_index": { 18 | "help": "さらにキーの生成を開始するインデックス(キー番号)を入力します。 たとえば、過去に4つのキーを生成した場合は、ここに4と入力します。", 19 | "prompt": "さらにキーの生成を開始するインデックス(キー番号)を入力します。 たとえば、過去に4つのキーを生成した場合は、ここに4と入力します。", 20 | "confirm": "確認のために繰り返し入力してください。" 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/ja/cli/generate_keys.json: -------------------------------------------------------------------------------- 1 | { 2 | "generate_keys_arguments_decorator": { 3 | "num_validators": { 4 | "help": "生成するバリデーターキーの数 (後からいつでも追加で生成できます)", 5 | "prompt": "実行したいバリデーターの数を選択してください" 6 | }, 7 | "chain": { 8 | "help": "ターゲットとしている Ethereum PoS のバージョン。ETH を入金する場合は \"mainnet\" を使用してください。", 9 | "prompt": "(mainnet または testnet) ネットワーク/チェーン名を選択してください" 10 | }, 11 | "keystore_password": { 12 | "help": "キーを生成するために使用したニーモニック。 (この引数を使用せずにCLIからニーモニックの入力が求められるのを待つことをお勧めします。そうしないとシェル履歴に表示されます。)", 13 | "prompt": "キーストアを保護するパスワード。Ethereum PoS バリデーターをセットアップする際に復号化するためにこれを再入力する必要があります。", 14 | "confirm": "確認のために繰り返し入力してください。", 15 | "mismatch": "エラー:入力された2つの値が一致しません。もう一度入力してください。" 16 | } 17 | }, 18 | "generate_keys": { 19 | "msg_key_creation": "キーを作成しています。", 20 | "msg_creation_success": "\n成功しました!\nあなたのキーは次の場所で見つけることができます:", 21 | "msg_pause": "\n任意のキーを押してください。", 22 | "err_verify_keystores": "キーストアの確認に失敗しました。", 23 | "err_verify_deposit": "入金データ JSON ファイルの確認に失敗しました。" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/ja/cli/new_mnemonic.json: -------------------------------------------------------------------------------- 1 | { 2 | "new_mnemonic": { 3 | "arg_new_mnemonic": { 4 | "help": "新しいニーモニックとキーを生成" 5 | }, 6 | "arg_mnemonic_language": { 7 | "default": "english", 8 | "help": "ニーモニックの言語", 9 | "prompt": "ニーモニックの言語を選択してください" 10 | }, 11 | "msg_mnemonic_presentation": "これはあなたのニーモニック (シードフレーズ) です。書き留めて安全な場所に保管してください。これはあなたのデポジットを取得するための唯一の方法です。", 12 | "msg_press_any_key": "ニーモニックを書き留めたら任意のキーを押してください。", 13 | "msg_mnemonic_retype_prompt": "書き留めた内容を確認するには、スペースで区切ってニーモニックを入力してください。" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/ja/credentials.json: -------------------------------------------------------------------------------- 1 | { 2 | "from_mnemonic": { 3 | "msg_key_creation": "キーを作成しています:\t\t" 4 | }, 5 | "export_keystores": { 6 | "msg_keystore_creation": "キーストアを作成しています:\t" 7 | }, 8 | "export_deposit_data_json": { 9 | "msg_depositdata_creation": "デポジットデータを作成しています:\t" 10 | }, 11 | "verify_keystores": { 12 | "msg_keystore_verification": "キーストアを確認しています:\t" 13 | } 14 | } -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/ja/deposit.json: -------------------------------------------------------------------------------- 1 | { 2 | "check_python_version": { 3 | "err_python_version": "Python のバージョンが最新ではありません。バージョン 3.8 以降をインストールしてください。" 4 | } 5 | } -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/ja/utils/validation.json: -------------------------------------------------------------------------------- 1 | { 2 | "verify_deposit_data_json": { 3 | "msg_deposit_verification": "入金確認中:" 4 | }, 5 | "validate_password_strength": { 6 | "msg_password_length": "パスワードの長さは少なくとも8文字でなければなりません。再入力してください" 7 | } 8 | } -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/ko/cli/existing_mnemonic.json: -------------------------------------------------------------------------------- 1 | { 2 | "validate_mnemonic": { 3 | "err_invalid_mnemonic": "유효한 니모닉이 아닙니다. 오타가 있는지 확인하세요." 4 | }, 5 | "existing_mnemonic": { 6 | "arg_existing_mnemonic": { 7 | "help": "기존 니모닉에서 키 생성(또는 복구)" 8 | }, 9 | "arg_mnemonic": { 10 | "help": "키를 생성할 때 사용한 니모닉입니다. (이 인수를 사용하지 말고 CLI가 니모닉을 요청할 때까지 기다리는 것이 좋습니다. 기다리지 않으면 셸 기록에 표시되기 때문입니다.)", 11 | "prompt": "니모닉을 공백(\" \")으로 구분하여 입력하세요." 12 | }, 13 | "arg_mnemonic_password": { 14 | "help": "찾고 계신 인수가 확실히 아닌 것 같습니다. 니모닉 비밀번호이지, 키스토어 비밀번호가 아닙니다. 초기에 사용하지 않은 비밀번호를 여기 입력하면 키(당연히 자금도!)를 잃어버릴 수 있습니다. 이 도구를 사용하여 니모닉을 처음 생성한다면 니모닉 비밀번호를 사용한 적이 없을 것입니다. 니모닉의 보안을 \"강화\"하려는 목적으로 비밀번호를 사용했다는 것이 확실할 때만 이 도구를 사용하시기 바랍니다.", 15 | "confirm": "니모닉 비밀번호를 사용한 적이 있다고 확실히 확신하십니까? (키스토어 비밀번호와 다른 것입니다!) 착오로 인해 사용하면 자금을 잃어버릴 수 있습니다! 확인을 위해 동일하게 입력" 16 | }, 17 | "arg_validator_start_index": { 18 | "help": "키를 추가로 생성하기 시작할 인덱스(생성 완료된 키 개수)를 입력하세요. 과거에 생성한 키가 총 4개라면 여기에 4를 입력하면 됩니다.", 19 | "prompt": "키를 추가로 생성하기 시작할 인덱스(생성 완료된 키 개수)를 입력하세요. 과거에 생성한 키가 총 4개라면 여기에 4를 입력하면 됩니다.", 20 | "confirm": "확인을 위해 동일하게 입력" 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/ko/cli/generate_keys.json: -------------------------------------------------------------------------------- 1 | { 2 | "generate_keys_arguments_decorator": { 3 | "num_validators": { 4 | "help": "생성하려는 검증자 키의 개수(나중에 언제든 생성 가능)", 5 | "prompt": "실행하려는 검증자의 개수를 선택하세요." 6 | }, 7 | "chain": { 8 | "help": "타겟팅하려는 Ethereum PoS의 버전입니다. ETH를 예치한다면 \"mainnet\"을 사용하세요.", 9 | "prompt": "(메인넷 또는 테스트넷) 네트워크/체인 이름을 선택하세요." 10 | }, 11 | "keystore_password": { 12 | "help": "키스토어를 안전하게 보호하는 비밀번호입니다. Ethereum PoS 검증자를 셋업할 때 다시 입력하여 복호화해야 합니다. (이 인수를 사용하지 말고 CLI가 니모닉을 요청할 때까지 기다리는 것이 좋습니다. 기다리지 않으면 셸 기록에 표시되기 때문입니다.)", 13 | "prompt": "키스토어를 안전하게 보호하는 비밀번호입니다. Ethereum PoS 검증자를 셋업할 때 다시 입력하여 복호화해야 합니다.", 14 | "confirm": "확인을 위해 동일하게 입력", 15 | "mismatch": "오류: 입력한 두 값이 일치하지 않습니다. 다시 입력하세요." 16 | } 17 | }, 18 | "generate_keys": { 19 | "msg_key_creation": "키 생성 중입니다.", 20 | "msg_creation_success": "\n성공!\n키를 찾을 수 있는 위치: ", 21 | "msg_pause": "\n\n아무 키나 누르세요.", 22 | "err_verify_keystores": "키스토어를 검증하지 못했습니다.", 23 | "err_verify_deposit": "예치금 데이터 JSON 파일을 검증하지 못했습니다." 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/ko/cli/new_mnemonic.json: -------------------------------------------------------------------------------- 1 | { 2 | "new_mnemonic": { 3 | "arg_new_mnemonic": { 4 | "help": "새 니모닉 및 키 생성" 5 | }, 6 | "arg_mnemonic_language": { 7 | "default": "한국어", 8 | "help": "니모닉이 작성된 언어", 9 | "prompt": "니모닉 언어를 선택하세요." 10 | }, 11 | "msg_mnemonic_presentation": "귀하의 니모닉(시드 문구)입니다. 적어두고 안전한 곳에 보관하세요. 예치금을 찾을 수 있는 유일한 수단입니다.", 12 | "msg_press_any_key": "니모닉을 다 적으면 아무 키나 누르세요.", 13 | "msg_mnemonic_retype_prompt": "니모닉을 입력(공백으로 구분)하여 적은 내용을 확인하세요." 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/ko/credentials.json: -------------------------------------------------------------------------------- 1 | { 2 | "from_mnemonic": { 3 | "msg_key_creation": "키 생성 중:\t\t" 4 | }, 5 | "export_keystores": { 6 | "msg_keystore_creation": "키스토어 생성 중:\t" 7 | }, 8 | "export_deposit_data_json": { 9 | "msg_depositdata_creation": "예치금 데이터 생성 중:\t" 10 | }, 11 | "verify_keystores": { 12 | "msg_keystore_verification": "키스토어 검증 중:\t" 13 | } 14 | } -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/ko/deposit.json: -------------------------------------------------------------------------------- 1 | { 2 | "check_python_version": { 3 | "err_python_version": "Python 버전이 너무 낮습니다. 3.8 이상 버전을 설치하세요." 4 | } 5 | } -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/ko/utils/validation.json: -------------------------------------------------------------------------------- 1 | { 2 | "verify_deposit_data_json": { 3 | "msg_deposit_verification": "예치금 검증 중:\t" 4 | }, 5 | "validate_password_strength": { 6 | "msg_password_length": "비밀번호는 8자 이상이어야 합니다. 다시 입력하세요." 7 | } 8 | } -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/pt-BR/cli/existing_mnemonic.json: -------------------------------------------------------------------------------- 1 | { 2 | "validate_mnemonic": { 3 | "err_invalid_mnemonic": "Isso não é um mnemônico válido. Verifique se há erros de digitação." 4 | }, 5 | "existing_mnemonic": { 6 | "arg_existing_mnemonic": { 7 | "help": "Gerar (ou recuperar) chaves a partir de um mnemônico existente" 8 | }, 9 | "arg_mnemonic": { 10 | "help": "O mnemônico que você usou para gerar suas chaves. (Recomenda-se não usar este argumento e esperar até que a CLI pergunte pelo seu mnemônico; caso contrário, ele aparecerá no seu histórico do shell.)", 11 | "prompt": "Por favor, digite seu mnemônico separado por espaços (\" \")" 12 | }, 13 | "arg_mnemonic_password": { 14 | "help": "Este, quase com certeza, não é o argumento que você está procurando: é para senhas mnemônicas, não para senhas do keystore. Se você fornecer uma senha aqui e não tiver usado uma inicialmente, poderá perder suas chaves (e, portanto, seus fundos!). Note também que se você tiver usado essa ferramenta para gerar seu mnemônico inicial, então não usou uma senha mnemônica. Porém, se tiver certeza de ter usado uma senha para \"aumentar\" a segurança do seu mnemônico, digite-a aqui.", 15 | "confirm": "Você tem certeza absoluta de ter usado uma senha mnemônica? (não é igual a uma senha do keystore!). Se você usar uma num momento inadequado, pode sofrer uma perda de fundos! Repita para confirmar" 16 | }, 17 | "arg_validator_start_index": { 18 | "help": "Digite o índice (número de chave) a partir do qual deseja gerar mais chaves. Por exemplo, se você gerou 4 chaves antes, digite 4 aqui.", 19 | "prompt": "Digite o índice (número de chave) a partir do qual deseja gerar mais chaves. Por exemplo, se você gerou 4 chaves antes, digite 4 aqui.", 20 | "confirm": "Repita para confirmar" 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/pt-BR/cli/generate_keys.json: -------------------------------------------------------------------------------- 1 | { 2 | "generate_keys_arguments_decorator": { 3 | "num_validators": { 4 | "help": "A quantidade de chaves de validadores que você deseja gerar (poderá gerar mais depois)", 5 | "prompt": "Por favor, escolha quantos validadores deseja executar" 6 | }, 7 | "chain": { 8 | "help": "A versão de Ethereum PoS do seu interesse. Use \"mainnet\" se estiver depositando ETH", 9 | "prompt": "Selecione o nome da rede/cadeia (mainnet ou testnet)" 10 | }, 11 | "keystore_password": { 12 | "help": "A senha que protegerá seus keystores. Você precisará digitá-la para descriptografá-los ao configurar seus validadores Ethereum PoS. (Recomenda-se não usar esse argumento e esperar que a CLI solicite o seu mnemônico; caso contrário, aparecerá no histórico do shell.)", 13 | "prompt": "A senha que protegerá seus keystores. Você precisará digitá-la para descriptografá-los ao configurar seus validadores Ethereum PoS.", 14 | "confirm": "Repita para confirmar", 15 | "mismatch": "Erro: os dois valores inseridos não coincidem. Digite-os novamente." 16 | } 17 | }, 18 | "generate_keys": { 19 | "msg_key_creation": "Criando suas chaves.", 20 | "msg_creation_success": "\nSuccesso!\nSuas chaves se encontram em: ", 21 | "msg_pause": "\n\nPressione qualquer tecla.", 22 | "err_verify_keystores": "Não foi possível verificar os keystores.", 23 | "err_verify_deposit": "Não foi possível verificar os dados JSON do depósito." 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/pt-BR/cli/new_mnemonic.json: -------------------------------------------------------------------------------- 1 | { 2 | "new_mnemonic": { 3 | "arg_new_mnemonic": { 4 | "help": "Gerar um novo mnemônico e chaves" 5 | }, 6 | "arg_mnemonic_language": { 7 | "default": "Português", 8 | "help": "A linguagem do seu mnemônico", 9 | "prompt": "Por favor, escolha o idioma do seu mnemônico" 10 | }, 11 | "msg_mnemonic_presentation": "Este é o seu mnemônico (frase semente). Anote-o e armazene-o de maneira segura, pois será a ÚNICA maneira de recuperar o seu depósito.", 12 | "msg_press_any_key": "Pressione qualquer tecla quando tiver anotado o mnemônico.", 13 | "msg_mnemonic_retype_prompt": "Por favor, digite seu mnemônico (separado por espaços) para confirmar que o anotou" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/pt-BR/credentials.json: -------------------------------------------------------------------------------- 1 | { 2 | "from_mnemonic": { 3 | "msg_key_creation": "Criação das suas chaves:\t\t" 4 | }, 5 | "export_keystores": { 6 | "msg_keystore_creation": "Criação dos seus keystores:\t" 7 | }, 8 | "export_deposit_data_json": { 9 | "msg_depositdata_creation": "Criação dos seus dados de depósito:\t" 10 | }, 11 | "verify_keystores": { 12 | "msg_keystore_verification": "Verificação dos seus keystores:\t" 13 | } 14 | } -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/pt-BR/deposit.json: -------------------------------------------------------------------------------- 1 | { 2 | "check_python_version": { 3 | "err_python_version": "Sua versão do python é insuficiente, por favor instale a versão 3.8 ou superior." 4 | } 5 | } -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/pt-BR/utils/validation.json: -------------------------------------------------------------------------------- 1 | { 2 | "verify_deposit_data_json": { 3 | "msg_deposit_verification": "Verificação dos seus depósitos:\t" 4 | }, 5 | "validate_password_strength": { 6 | "msg_password_length": "A senha deve ter pelo menos 8 caracteres. Por favor, digite-a novamente" 7 | } 8 | } -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/ro/cli/existing_mnemonic.json: -------------------------------------------------------------------------------- 1 | { 2 | "validate_mnemonic": { 3 | "err_invalid_mnemonic": "Acesta nu este un mnemonic corect, verifică dacă e scris corect." 4 | }, 5 | "existing_mnemonic": { 6 | "arg_existing_mnemonic": { 7 | "help": "Generează (sau recuperează) chei dintr-un mnemonic existent" 8 | }, 9 | "arg_mnemonic": { 10 | "help": "Mnemonicul cu care ai generat cheile. (Îți recomandăm să nu folosești acest argument, ci să aștepți ca interfața linie de comandă să-ți ceară mnemonicul, altfel acesta o să apară în istoricul comenzilor de shell.)", 11 | "prompt": "Introdu mnemonicul, separat cu spații („ ”)" 12 | }, 13 | "arg_mnemonic_password": { 14 | "help": "Aproape sigur acesta nu este argumentul pe care îl cauți: este vorba despre parole de mnemonice, nu despre parolele de cheie. Dacă introduci aici o parolă, în condițiile în care inițial nu ai folosit parolă, poate duce la pierderi de chei (și, prin urmare, de fonduri)! De reținut: dacă ați folosit acest instrument la generarea inițială a mnemonicului, atunci nu ai folosit parolă de mnemonic. În schimb, dacă știi sigur că ai creat o parolă pentru „a îmbunătăți” securitatea mnemonicului, acesta este locul în care trebuie s-o introduci.", 15 | "confirm": "Știi absolut sigur că ai folosit o parolă de mnemonic? (Aceasta este diferită de parola depozitului de chei!) Dacă folosești parolă atunci când nu e cazul, poți să pierzi fonduri! Repetă parola, pentru confirmare" 16 | }, 17 | "arg_validator_start_index": { 18 | "help": "Introdu indexul (numărul de cheie) de la care vrei să începi să generezi mai multe chei. De exemplu, dacă ai generat 4 chei în trecut, aici trebuie să introduci 4.", 19 | "prompt": "Introdu indexul (numărul de cheie) de la care vrei să începi să generezi mai multe chei. De exemplu, dacă ai generat 4 chei în trecut, aici trebuie să introduci 4.", 20 | "confirm": "Repetă parola, pentru confirmare" 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/ro/cli/generate_keys.json: -------------------------------------------------------------------------------- 1 | { 2 | "generate_keys_arguments_decorator": { 3 | "num_validators": { 4 | "help": "Numărul de chei de validator pe care vrei să le generezi (poți genera oricând mai multe)", 5 | "prompt": "Alege câți validatori vrei să rulezi" 6 | }, 7 | "chain": { 8 | "help": "Versiunea de Ethereum PoS țintă. Dacă depui ETH, folosește „mainnet”", 9 | "prompt": "Alege numele de rețea/lanț (mainnet sau testnet)" 10 | }, 11 | "keystore_password": { 12 | "help": "Parola cu care securizezi depozitele de chei. Va trebui să o introduci din nou pentru a le decripta atunci când configurezi validatorii Ethereum PoS. (Îți recomandăm să nu folosești acest argument, ci să aștepți ca interfața linie de comandă să-ți ceară mnemonicul, altfel acesta o să apară în istoricul comenzilor de shell.)", 13 | "prompt": "Parola cu care vei securiza depozitele de chei. Va trebui să o reintroduci pentru a le decripta atunci când configurezi validatorii Ethereum PoS.", 14 | "confirm": "Repetă parola, pentru confirmare", 15 | "mismatch": "Eroare: cele două valori introduse sunt diferite. Te rugăm să tastezi din nou." 16 | } 17 | }, 18 | "generate_keys": { 19 | "msg_key_creation": "Se creează cheile.", 20 | "msg_creation_success": "\nReușită!\nCheile se găsesc la: ", 21 | "msg_pause": "\n\nApară o tastă oarecare.", 22 | "err_verify_keystores": "Verificarea depozitelor de chei nu a reușit.", 23 | "err_verify_deposit": "Verificarea datelor de depunere a fişierelor JSON a eşuat." 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/ro/cli/new_mnemonic.json: -------------------------------------------------------------------------------- 1 | { 2 | "new_mnemonic": { 3 | "arg_new_mnemonic": { 4 | "help": "Generează un nou mnemonic și chei" 5 | }, 6 | "arg_mnemonic_language": { 7 | "default": "english", 8 | "help": "Limba mnemonicului", 9 | "prompt": "Alege limba mnemonicului" 10 | }, 11 | "msg_mnemonic_presentation": "Acesta este mnemonicul (fraza sămânță). Scrie-l și păstrează-l în siguranță, este SINGURA cale de a prelua depunerea.", 12 | "msg_press_any_key": "După ce ți-ai notat mnemonicul, apasă orice tastă.", 13 | "msg_mnemonic_retype_prompt": "Tastează mnemonicul (separat cu spații) pentru a confirma faptul că ți l-ai notat" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/ro/credentials.json: -------------------------------------------------------------------------------- 1 | { 2 | "from_mnemonic": { 3 | "msg_key_creation": "Se creează cheile:\t\t" 4 | }, 5 | "export_keystores": { 6 | "msg_keystore_creation": "Se creează depozitele de chei:\t" 7 | }, 8 | "export_deposit_data_json": { 9 | "msg_depositdata_creation": "Se creează datele de depozit:\t" 10 | }, 11 | "verify_keystores": { 12 | "msg_keystore_verification": "Se verifică depozitele de chei:\t" 13 | } 14 | } -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/ro/deposit.json: -------------------------------------------------------------------------------- 1 | { 2 | "check_python_version": { 3 | "err_python_version": "Versiunea de python este prea veche, te rugăm să instalezi versiunea 3.8 sau una mai recentă." 4 | } 5 | } -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/ro/utils/validation.json: -------------------------------------------------------------------------------- 1 | { 2 | "verify_deposit_data_json": { 3 | "msg_deposit_verification": "Se verifică depozitele tale:\t" 4 | }, 5 | "validate_password_strength": { 6 | "msg_password_length": "Parola trebuie să aibă o lungime de cel puțin 8. Te rugăm să o reintroduci" 7 | } 8 | } -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/tr/cli/existing_mnemonic.json: -------------------------------------------------------------------------------- 1 | { 2 | "validate_mnemonic": { 3 | "err_invalid_mnemonic": "İpucu kelimeleri doğru değil, lütfen yazım hatalarını kontrol edin." 4 | }, 5 | "existing_mnemonic": { 6 | "arg_existing_mnemonic": { 7 | "help": "Mevcut ipucu kelimelerinden anahtar oluşturun (veya kurtarın)" 8 | }, 9 | "arg_mnemonic": { 10 | "help": "Anahtarlarınız oluştururken kullandığınız ipucu kelimeleri. (Bu parametreyi kullanmamanız ve size sorulduğunda ipucu kelimelerini girmeniz tavsiye edilir, aksi taktirde ipucu kelimeleriniz komut satırı geçmişinde gözükecektir.)", 11 | "prompt": "İpucu kelimelerinizin arasında boşluk bırakarak giriniz (\" \"). Not: her kelimenin ilk 4 harfini girmeniz yeterli olacaktır." 12 | }, 13 | "arg_mnemonic_password": { 14 | "help": "Büyük ihtimalle aradığınız parametre bu değil: bu parametre ipucu kelimeleri için şifredir, anahtar deposu şifresi değildir. Daha önce şifre vermediyseniz burada şifre girmeniz anahtarlarınızın (yani varlıklarınızın) kaybolmasına neden olabilir! Eğer ipucu kelimelerinizi bu aracı kullanarak oluşturduysanız, şifre vermemişsiniz demektir. Fakat ipucu kelimelerinizin güvenliğini \"arttırmak\" için şifre verdiğinize eminseniz, şifrenizi buraya girmelisiniz.", 15 | "prompt": "İpucu kelime şifrenizi giriniz (daha önce sağladıysanız). Unutmayacağınıza emin olun, bu şifre kurtarılamaz.", 16 | "confirm": "Onaylamak için ipucu kelime şifrenizi tekrar giriniz. Daha önce şifre vermediyseniz burada şifre girmeniz anahtarlarınızın (yani varlıklarınızın) kaybolmasına neden olabilir! Eğer ipucu kelimelerinizi bu aracı kullanarak oluşturduysanız, şifre vermemişsiniz demektir. Fakat ipucu kelimelerinizin güvenliğini \"arttırmak\" için şifre verdiğinize eminseniz, şifrenizi buraya girmelisiniz.", 17 | "mismatch": "Girdiğiniz ipucu kelime şifresi eşleşmiyor, lütfen tekrar deneyiniz." 18 | }, 19 | "arg_validator_start_index": { 20 | "help": "Daha fazla anahtar oluşturmaya başlamak istediğiniz sırayı (anahtar numarası) giriniz. Örneğin, daha önce 4 anahtar oluşturduysanız, buraya 4 girmeniz gerekir.", 21 | "prompt": "Daha fazla anahtar oluşturmaya başlamak istediğiniz sırayı (anahtar numarası) giriniz. Örneğin, daha önce 4 anahtar oluşturduysanız, buraya 4 girmeniz gerekir.", 22 | "confirm": "Lütfen onaylamak için sırayı tekrar girin" 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/tr/cli/generate_keys.json: -------------------------------------------------------------------------------- 1 | { 2 | "generate_keys_arguments_decorator": { 3 | "num_validators": { 4 | "help": "Oluşturmak istediğiniz yeni doğrulayıcı anahtarlarının sayısını giriniz (daha fazlasını daha sonra da oluşturabilirsiniz)", 5 | "prompt": "Lütfen kaç tane doğrulayıcı çalıştırmak istediğinizi seçin" 6 | }, 7 | "folder": { 8 | "help": "Anahtar depoları ve depozitolar için dizin yolu. Varsayılan olarak `./validator_keys` yolunu gösterir." 9 | }, 10 | "chain": { 11 | "help": "Hedeflenen Ethereum PoS ağının ismi. Depozito olarak ETH kullanıyorsanız \"mainnet\" kullanın", 12 | "prompt": "Lütfen (mainnet veya testnet) ağ/zincir adını seçin" 13 | }, 14 | "keystore_password": { 15 | "help": "Anahtar depolarınızı koruyacak şifre. Ethereum onaylayıcılarınızı kurarken bu şifreyi tekrar girmeniz gerekecek. (Bu parametreyi kullanmamanız ve size sorulduğunda ipucu kelimelerini girmeniz tavsiye edilir, aksi taktirde şifreniz komut satırı geçmişinde gözükecektir.)", 16 | "prompt": "Onaylayıcı anahtar depolarınızı koruyan bir şifre oluşturun. Ethereum onaylayıcılarınızı kurarken bu şifreyi tekrar girmeniz gerekecek.", 17 | "confirm": "Anahtar deposu şifrenizi onaylamak için tekrar girin", 18 | "mismatch": "Hata: girilen değerler eşleşmiyor. Tekrar deneyin." 19 | }, 20 | "eth1_withdrawal_address": { 21 | "help": "Eğer bu alan girilmiş ve geçerliyse, verilen Eth1 adresi varlık çekme adresi olarak kullanılacaktır. Aksi taktirde, ipucu kelimelerinden üretilmiş bir genel anahtar kullanılır." 22 | } 23 | }, 24 | "generate_keys": { 25 | "msg_key_creation": "Anahtarlarınız oluşturuluyor.", 26 | "msg_creation_success": "\nBaşarılı!\nAnahtarlarınızı burada bulabilirsiniz: ", 27 | "msg_pause": "\n\nHerhangi bir tuşa basın.", 28 | "err_verify_keystores": "Anahtar depoları doğrulanamadı.", 29 | "err_verify_deposit": "Depozito JSON dosyaları doğrulanamadı." 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/tr/cli/new_mnemonic.json: -------------------------------------------------------------------------------- 1 | { 2 | "new_mnemonic": { 3 | "arg_new_mnemonic": { 4 | "help": "Yeni ipucu kelimeler ve anahtarlar oluşturun" 5 | }, 6 | "arg_mnemonic_language": { 7 | "default": "english", 8 | "help": "İpucu kelimelerinizin dili", 9 | "prompt": "Lütfen ipucu kelimelerinin dilini seçin" 10 | }, 11 | "msg_mnemonic_presentation": "Bunlar ipucu kelimelerinizdir (tohum ifadeleri). Bir yere not alın ve güvenli bir şekilde saklayın. Depozitoyu YALNIZCA bununla geri alabilirsiniz.", 12 | "msg_press_any_key": "İpucu kelimelerinizi not aldığınızda bir tuşa basın.", 13 | "msg_mnemonic_retype_prompt": "Lütfen ipucu kelimelerinizi not aldığınızı doğrulamak amacıyla (aralarında boşluk bırakarak) yazın. Not: kelimelerin yalnızca ilk 4 harfini yazmanız yeterlidir." 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/tr/credentials.json: -------------------------------------------------------------------------------- 1 | { 2 | "from_mnemonic": { 3 | "msg_key_creation": "Anahtarlarınız oluşturuluyor:\t\t" 4 | }, 5 | "export_keystores": { 6 | "msg_keystore_creation": "Anahtar depolarınız oluşturuluyor:\t" 7 | }, 8 | "export_deposit_data_json": { 9 | "msg_depositdata_creation": "Depozito veriniz (depositdata) oluşturuluyor:\t" 10 | }, 11 | "verify_keystores": { 12 | "msg_keystore_verification": "Anahtar depolarınız doğrulanıyor:\t" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/tr/deposit.json: -------------------------------------------------------------------------------- 1 | { 2 | "check_python_version": { 3 | "err_python_version": "Python sürümünüz yetersiz, lütfen 3.8 sürümü veya daha yenisini yükleyin." 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/tr/utils/validation.json: -------------------------------------------------------------------------------- 1 | { 2 | "verify_deposit_data_json": { 3 | "msg_deposit_verification": "Depozitonuz doğrulanıyor:\t" 4 | }, 5 | "validate_password_strength": { 6 | "msg_password_length": "Şifre uzunluğu en az 8 olmalıdır. Lütfen tekrar girin." 7 | }, 8 | "validate_int_range": { 9 | "err_not_positive_integer": "Pozitif tam sayı değil. Lütfen tekrar girin." 10 | }, 11 | "validate_choice": { 12 | "err_invalid_choice": "Geçerli bir seçim değil. Lütfen seçiminizi tekrar girin." 13 | }, 14 | "validate_eth1_withdrawal_address": { 15 | "err_invalid_ECDSA_hex_addr": "Girilen Eth1 adresi onaltılık sistemde kodlanmamıştır.", 16 | "msg_ECDSA_hex_addr_withdrawal": "**[Uyarı] bir Eth1 adresini varlık çekme adresi olarak giriyorsunuz. Lütfen bu adresin kontrolünün sizde olduğundan emin olun.**" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/zh-CN/cli/existing_mnemonic.json: -------------------------------------------------------------------------------- 1 | { 2 | "validate_mnemonic": { 3 | "err_invalid_mnemonic": "这不是一个有效的助记符,请检查有无打字错误。" 4 | }, 5 | "existing_mnemonic": { 6 | "arg_existing_mnemonic": { 7 | "help": "从现有助记符中生成(或恢复)密钥" 8 | }, 9 | "arg_mnemonic": { 10 | "help": "用来生成您密钥的助记符。(建议不要使用此参数,而是等待 CLI 要求您提供您的助记符,否则它将出现在您的 shell 历史中。)", 11 | "prompt": "请输入您的助记符,用空格(“ ”)分隔" 12 | }, 13 | "arg_mnemonic_password": { 14 | "help": "这几乎肯定不是您想要的参数:这里要的是助记密码,而不是密钥库密码。如果您在这里提供一个密码(若您起初没有启用密码),则可能会导致密钥丢失(从而造成资金损失)! 还请注意,如果您起初使用此工具生成了您的助记符,则说明您就没有启用助记密码。然而,如果您确定使用了密码来“增加”您助记符的安全性,则您可以在这里提供一个密码。", 15 | "confirm": "您是否绝对肯定您启用了助记密码?(这不同于密钥库密码!) 如果您不确定启用了助记密码而硬要输入,则可能会造成资金损失! 重复输入以确认" 16 | }, 17 | "arg_validator_start_index": { 18 | "help": "输入您想要开始生成更多密钥的索引(密钥号码)。例如,如果您在过去生成了 4 个密钥,请在此处输入 4。", 19 | "prompt": "输入您想要开始生成更多密钥的索引(密钥号码)。例如,如果您在过去生成了 4 个密钥,请在此处输入 4。", 20 | "confirm": "重复输入以确认" 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/zh-CN/cli/generate_keys.json: -------------------------------------------------------------------------------- 1 | { 2 | "generate_keys_arguments_decorator": { 3 | "num_validators": { 4 | "help": "您想要生成的验证者密钥数量(您以后随时可以生成更多密钥)", 5 | "prompt": "请选择您想要运行多少验证者" 6 | }, 7 | "chain": { 8 | "help": "您正在对准的 Ethereum PoS 版本。如果您要存入以太币,请使用 \"mainnet\"", 9 | "prompt": "请选择(主网或测试网)网络名/链名" 10 | }, 11 | "keystore_password": { 12 | "help": "用来保护您密钥库的密码。您在设置您的 Ethereum PoS 验证者时需要重新输入密码以便解密它们。(建议不要使用此参数,而是等待 CLI 要求您提供您的助记符,否则它将出现在您的 shell 历史中。)", 13 | "prompt": "用来保护您密钥库的密码。您在设置您的 Ethereum PoS 验证者时需要重新输入密码以便解密它们。", 14 | "confirm": "重复输入以确认", 15 | "mismatch": "错误:输入的两个值不匹配。请再次输入。" 16 | } 17 | }, 18 | "generate_keys": { 19 | "msg_key_creation": "正在创建您的密钥。", 20 | "msg_creation_success": "\n成功!\n您的密钥可以在这里找到: ", 21 | "msg_pause": "\n\n按任意键。", 22 | "err_verify_keystores": "无法验证密钥库。", 23 | "err_verify_deposit": "无法验证存款数据 JSON 文件。" 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/zh-CN/cli/new_mnemonic.json: -------------------------------------------------------------------------------- 1 | { 2 | "new_mnemonic": { 3 | "arg_new_mnemonic": { 4 | "help": "生成一个新的助记符和密钥" 5 | }, 6 | "arg_mnemonic_language": { 7 | "default": "简体中文", 8 | "help": "您的助记符所使用的语言", 9 | "prompt": "请选择您的助记符语言" 10 | }, 11 | "msg_mnemonic_presentation": "这是您的助记符(助记词)。请记下它并存放在安全的地方,它是取回您存款的唯一方式。", 12 | "msg_press_any_key": "在您记下助记符后,按任意键。", 13 | "msg_mnemonic_retype_prompt": "请输入您的助记符(用空格分隔)以确认您已记下了" 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/zh-CN/credentials.json: -------------------------------------------------------------------------------- 1 | { 2 | "from_mnemonic": { 3 | "msg_key_creation": "正在创建您的密钥:\t\t" 4 | }, 5 | "export_keystores": { 6 | "msg_keystore_creation": "正在创建您的密钥库:\t" 7 | }, 8 | "export_deposit_data_json": { 9 | "msg_depositdata_creation": "正在创建您的存款数据:" 10 | }, 11 | "verify_keystores": { 12 | "msg_keystore_verification": "正在验证您的密钥库:" 13 | } 14 | } -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/zh-CN/deposit.json: -------------------------------------------------------------------------------- 1 | { 2 | "check_python_version": { 3 | "err_python_version": "您的 python 版本不足,请安装 3.8 或以上版本。" 4 | } 5 | } -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/intl/zh-CN/utils/validation.json: -------------------------------------------------------------------------------- 1 | { 2 | "verify_deposit_data_json": { 3 | "msg_deposit_verification": "正在验证您的存款:\t" 4 | }, 5 | "validate_password_strength": { 6 | "msg_password_length": "密码长度至少应为 8。请重新输入" 7 | } 8 | } -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/key_handling/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/engram-network/tokio-docker/14c03b1d1d5b98f085922f6ed6905c98f3699a8d/engram-deposit-cli/staking_deposit/key_handling/__init__.py -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/key_handling/key_derivation/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/engram-network/tokio-docker/14c03b1d1d5b98f085922f6ed6905c98f3699a8d/engram-deposit-cli/staking_deposit/key_handling/key_derivation/__init__.py -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/key_handling/key_derivation/path.py: -------------------------------------------------------------------------------- 1 | from typing import List 2 | 3 | from .mnemonic import get_seed 4 | from .tree import ( 5 | derive_master_SK, 6 | derive_child_SK, 7 | ) 8 | 9 | 10 | def path_to_nodes(path: str) -> List[int]: 11 | """ 12 | Maps from a path string to a list of indices where each index represents the corresponding level in the path. 13 | """ 14 | path = path.replace(' ', '') 15 | if not set(path).issubset(set('m1234567890/')): 16 | raise ValueError(f"Invalid path {path}") 17 | 18 | indices = path.split('/') 19 | 20 | if indices[0] != 'm': 21 | raise ValueError(f"The first character of path should be `m`. Got {indices[0]}.") 22 | indices.pop(0) 23 | 24 | return [int(index) for index in indices] 25 | 26 | 27 | def mnemonic_and_path_to_key(*, mnemonic: str, path: str, password: str) -> int: 28 | """ 29 | Return the SK at position `path`, derived from `mnemonic`. The password is to be 30 | compliant with BIP39 mnemonics that use passwords, but is not used by this CLI outside of tests. 31 | """ 32 | seed = get_seed(mnemonic=mnemonic, password=password) 33 | sk = derive_master_SK(seed) 34 | for node in path_to_nodes(path): 35 | sk = derive_child_SK(parent_SK=sk, index=node) 36 | return sk 37 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/key_handling/key_derivation/tree.py: -------------------------------------------------------------------------------- 1 | from staking_deposit.utils.crypto import ( 2 | HKDF, 3 | SHA256, 4 | ) 5 | from py_ecc.optimized_bls12_381 import curve_order as bls_curve_order 6 | from typing import List 7 | 8 | 9 | def _flip_bits_256(input: int) -> int: 10 | """ 11 | Flips 256 bits worth of `input`. 12 | """ 13 | return input ^ (2**256 - 1) 14 | 15 | 16 | def _IKM_to_lamport_SK(*, IKM: bytes, salt: bytes) -> List[bytes]: 17 | """ 18 | Derives the lamport SK for a given `IKM` and `salt`. 19 | 20 | Ref: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2333.md#ikm_to_lamport_sk 21 | """ 22 | OKM = HKDF(salt=salt, IKM=IKM, L=8160) 23 | lamport_SK = [OKM[i: i + 32] for i in range(0, 8160, 32)] 24 | return lamport_SK 25 | 26 | 27 | def _parent_SK_to_lamport_PK(*, parent_SK: int, index: int) -> bytes: 28 | """ 29 | Derives the `index`th child's lamport PK from the `parent_SK`. 30 | 31 | Ref: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2333.md#parent_sk_to_lamport_pk 32 | """ 33 | salt = index.to_bytes(4, byteorder='big') 34 | IKM = parent_SK.to_bytes(32, byteorder='big') 35 | lamport_0 = _IKM_to_lamport_SK(IKM=IKM, salt=salt) 36 | not_IKM = _flip_bits_256(parent_SK).to_bytes(32, byteorder='big') 37 | lamport_1 = _IKM_to_lamport_SK(IKM=not_IKM, salt=salt) 38 | lamport_SKs = lamport_0 + lamport_1 39 | lamport_PKs = [SHA256(sk) for sk in lamport_SKs] 40 | compressed_PK = SHA256(b''.join(lamport_PKs)) 41 | return compressed_PK 42 | 43 | 44 | def _HKDF_mod_r(*, IKM: bytes, key_info: bytes=b'') -> int: 45 | """ 46 | Hashes the IKM using HKDF and returns the answer as an int modulo r, the BLS field order. 47 | 48 | Ref: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2333.md#hkdf_mod_r 49 | """ 50 | L = 48 # `ceil((3 * ceil(log2(r))) / 16)`, where `r` is the order of the BLS 12-381 curve 51 | salt = b'BLS-SIG-KEYGEN-SALT-' 52 | SK = 0 53 | while SK == 0: 54 | salt = SHA256(salt) 55 | okm = HKDF( 56 | salt=salt, 57 | IKM=IKM + b'\x00', # add postfix `I2OSP(0, 1)` 58 | L=L, 59 | info=key_info + L.to_bytes(2, 'big'), 60 | ) 61 | SK = int.from_bytes(okm, byteorder='big') % bls_curve_order 62 | return SK 63 | 64 | 65 | def derive_child_SK(*, parent_SK: int, index: int) -> int: 66 | """ 67 | Given a parent SK `parent_SK`, return the child SK at the supplied `index`. 68 | 69 | Ref: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2333.md#derive_child_sk 70 | """ 71 | if index < 0 or index >= 2**32: 72 | raise IndexError(f"`index` should be greater than or equal to 0 and less than 2**32. Got index={index}.") 73 | lamport_PK = _parent_SK_to_lamport_PK(parent_SK=parent_SK, index=index) 74 | return _HKDF_mod_r(IKM=lamport_PK) 75 | 76 | 77 | def derive_master_SK(seed: bytes) -> int: 78 | """ 79 | Given a seed, derive the master SK. 80 | 81 | Ref: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2333.md#derive_master_sk 82 | """ 83 | if len(seed) < 32: 84 | raise ValueError(f"`len(seed)` should be greater than or equal to 32. Got {len(seed)}.") 85 | return _HKDF_mod_r(IKM=seed) 86 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/settings.py: -------------------------------------------------------------------------------- 1 | from typing import Dict, NamedTuple 2 | from eth_utils import decode_hex 3 | 4 | DEPOSIT_CLI_VERSION = '2.7.0' 5 | 6 | 7 | class BaseChainSetting(NamedTuple): 8 | NETWORK_NAME: str 9 | GENESIS_FORK_VERSION: bytes 10 | GENESIS_VALIDATORS_ROOT: bytes 11 | 12 | 13 | MAINNET = 'mainnet' 14 | GOERLI = 'goerli' 15 | PRATER = 'prater' 16 | SEPOLIA = 'sepolia' 17 | ZHEJIANG = 'zhejiang' 18 | HOLESKY = 'holesky' 19 | ENGRAM = 'engram' 20 | 21 | # Mainnet setting 22 | MainnetSetting = BaseChainSetting( 23 | NETWORK_NAME=MAINNET, GENESIS_FORK_VERSION=bytes.fromhex('00000000'), 24 | GENESIS_VALIDATORS_ROOT=bytes.fromhex('4b363db94e286120d76eb905340fdd4e54bfe9f06bf33ff6cf5ad27f511bfe95')) 25 | # Goerli setting 26 | GoerliSetting = BaseChainSetting( 27 | NETWORK_NAME=GOERLI, GENESIS_FORK_VERSION=bytes.fromhex('00001020'), 28 | GENESIS_VALIDATORS_ROOT=bytes.fromhex('043db0d9a83813551ee2f33450d23797757d430911a9320530ad8a0eabc43efb')) 29 | # Sepolia setting 30 | SepoliaSetting = BaseChainSetting( 31 | NETWORK_NAME=SEPOLIA, GENESIS_FORK_VERSION=bytes.fromhex('90000069'), 32 | GENESIS_VALIDATORS_ROOT=bytes.fromhex('d8ea171f3c94aea21ebc42a1ed61052acf3f9209c00e4efbaaddac09ed9b8078')) 33 | # Zhejiang setting 34 | ZhejiangSetting = BaseChainSetting( 35 | NETWORK_NAME=ZHEJIANG, GENESIS_FORK_VERSION=bytes.fromhex('00000069'), 36 | GENESIS_VALIDATORS_ROOT=bytes.fromhex('53a92d8f2bb1d85f62d16a156e6ebcd1bcaba652d0900b2c2f387826f3481f6f')) 37 | # Holesky setting 38 | HoleskySetting = BaseChainSetting( 39 | NETWORK_NAME=HOLESKY, GENESIS_FORK_VERSION=bytes.fromhex('01017000'), 40 | GENESIS_VALIDATORS_ROOT=bytes.fromhex('9143aa7c615a7f7115e2b6aac319c03529df8242ae705fba9df39b79c59fa8b1')) 41 | # Engram setting 42 | EngramSetting = BaseChainSetting( 43 | NETWORK_NAME=ENGRAM, GENESIS_FORK_VERSION=bytes.fromhex('10000130'), 44 | GENESIS_VALIDATORS_ROOT=bytes.fromhex('3cf4bd6a29344f8ccf75f629c5615f6fb85ad250063134a18a3aebf1247f9444')) 45 | 46 | ALL_CHAINS: Dict[str, BaseChainSetting] = { 47 | MAINNET: MainnetSetting, 48 | GOERLI: GoerliSetting, 49 | PRATER: GoerliSetting, # Prater is the old name of the Prater/Goerli testnet 50 | SEPOLIA: SepoliaSetting, 51 | ZHEJIANG: ZhejiangSetting, 52 | HOLESKY: HoleskySetting, 53 | ENGRAM: EngramSetting, 54 | } 55 | 56 | 57 | def get_chain_setting(chain_name: str = MAINNET) -> BaseChainSetting: 58 | return ALL_CHAINS[chain_name] 59 | 60 | 61 | def get_devnet_chain_setting(network_name: str, 62 | genesis_fork_version: str, 63 | genesis_validator_root: str) -> BaseChainSetting: 64 | return BaseChainSetting( 65 | NETWORK_NAME=network_name, 66 | GENESIS_FORK_VERSION=decode_hex(genesis_fork_version), 67 | GENESIS_VALIDATORS_ROOT=decode_hex(genesis_validator_root), 68 | ) 69 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/utils/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/engram-network/tokio-docker/14c03b1d1d5b98f085922f6ed6905c98f3699a8d/engram-deposit-cli/staking_deposit/utils/__init__.py -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/utils/ascii_art.py: -------------------------------------------------------------------------------- 1 | # flake8: noqa 2 | RHINO_0 = ''' 3 | 4 | 5 | ███████╗███╗░░██╗░██████╗░██████╗░░█████╗░███╗░░░███╗  ████████╗░█████╗░██╗░░██╗██╗░█████╗░ 6 | ██╔════╝████╗░██║██╔════╝░██╔══██╗██╔══██╗████╗░████║  ╚══██╔══╝██╔══██╗██║░██╔╝██║██╔══██╗ 7 | █████╗░░██╔██╗██║██║░░██╗░██████╔╝███████║██╔████╔██║  ░░░██║░░░██║░░██║█████═╝░██║██║░░██║ 8 | ██╔══╝░░██║╚████║██║░░╚██╗██╔══██╗██╔══██║██║╚██╔╝██║  ░░░██║░░░██║░░██║██╔═██╗░██║██║░░██║ 9 | ███████╗██║░╚███║╚██████╔╝██║░░██║██║░░██║██║░╚═╝░██║  ░░░██║░░░╚█████╔╝██║░╚██╗██║╚█████╔╝ 10 | ╚══════╝╚═╝░░╚══╝░╚═════╝░╚═╝░░╚═╝╚═╝░░╚═╝╚═╝░░░░░╚═╝  ░░░╚═╝░░░░╚════╝░╚═╝░░╚═╝╚═╝░╚════╝░ 11 | ''' 12 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/utils/click.py: -------------------------------------------------------------------------------- 1 | import click 2 | from typing import ( 3 | Any, 4 | Callable, 5 | Optional, 6 | Sequence, 7 | Tuple, 8 | Union, 9 | ) 10 | 11 | from staking_deposit.exceptions import ValidationError 12 | from staking_deposit.utils import config 13 | 14 | 15 | def _value_of(f: Union[Callable[[], Any], Any]) -> Any: 16 | ''' 17 | If the input, f, is a function, return f(), else return f. 18 | ''' 19 | return(f() if callable(f) else f) 20 | 21 | 22 | class JITOption(click.Option): 23 | ''' 24 | A click.Option, except certain values are recomputed before they are used. 25 | ''' 26 | def __init__( 27 | self, 28 | param_decls: Union[str, Sequence[str]], 29 | default: Union[Callable[[], Any], None, Any] = None, 30 | help: Union[Callable[[], str], str, None] = None, 31 | prompt: Union[Callable[[], str], str, None] = None, 32 | **kwargs: Any, 33 | ): 34 | 35 | self.callable_default = default 36 | self.callable_help = help 37 | self.callable_prompt = prompt 38 | 39 | # `click.Option.Argument.param_decls` takes a list of flags or argument names. 40 | if isinstance(param_decls, str): 41 | param_decls = [_value_of(param_decls)] 42 | 43 | return super().__init__( 44 | param_decls=param_decls, 45 | default=_value_of(default), 46 | help=_value_of(help), 47 | prompt=_value_of(prompt), 48 | **kwargs, 49 | ) 50 | 51 | def prompt_for_value(self, ctx: click.Context) -> Any: 52 | self.prompt = _value_of(self.callable_prompt) 53 | return super().prompt_for_value(ctx) 54 | 55 | def get_help_record(self, ctx: click.Context) -> Tuple[str, str]: 56 | self.help = _value_of(self.callable_help) 57 | return super().get_help_record(ctx) 58 | 59 | def get_default(self, ctx: click.Context) -> Any: 60 | self.default = _value_of(self.callable_default) 61 | return super().get_default(ctx) 62 | 63 | 64 | def jit_option(*args: Any, **kwargs: Any) -> Callable[[Any], Any]: 65 | """Attaches an option to the command. All positional arguments are 66 | passed as parameter declarations to :class:`Option`; all keyword 67 | arguments are forwarded unchanged (except ``cls``). 68 | This is equivalent to creating an :class:`Option` instance manually 69 | and attaching it to the :attr:`Command.params` list. 70 | 71 | :param cls: the option class to instantiate. This defaults to 72 | :class:`Option`. 73 | """ 74 | 75 | def decorator(f: Callable[[Any], Any]) -> Callable[[Any], Any]: 76 | click.decorators._param_memo(f, JITOption(*args, **kwargs)) 77 | return f 78 | 79 | return decorator 80 | 81 | 82 | def captive_prompt_callback( 83 | processing_func: Callable[[str], Any], 84 | prompt: Callable[[], str], 85 | confirmation_prompt: Optional[Callable[[], str]]=None, 86 | confirmation_mismatch_msg: Callable[[], str]=lambda: '', 87 | hide_input: bool=False, 88 | ) -> Callable[[click.Context, str, str], Any]: 89 | ''' 90 | Traps the user in a prompt until the value chosen is acceptable 91 | as defined by `processing_func` not returning a ValidationError 92 | :param processing_func: A function to process the user's input that possibly raises a ValidationError 93 | :param prompt: the text to prompt the user with, should their input raise an error when passed to processing_func() 94 | :param confirmation_prompt: the optional prompt for confirming user input (the user must repeat their input) 95 | :param confirmation_mismatch_msg: the message displayed to the user should their input and confirmation not match 96 | :param hide_input: bool, hides the input as the user types 97 | ''' 98 | def callback(ctx: click.Context, param: Any, user_input: str) -> Any: 99 | if config.non_interactive: 100 | return processing_func(user_input) 101 | while True: 102 | try: 103 | processed_input = processing_func(user_input) 104 | # Logic for confirming user input: 105 | if confirmation_prompt is not None and processed_input not in ('', None): 106 | confirmation_input = click.prompt(confirmation_prompt(), hide_input=hide_input) 107 | if processing_func(confirmation_input) != processed_input: 108 | raise ValidationError(confirmation_mismatch_msg()) 109 | return processed_input 110 | except ValidationError as e: 111 | click.echo('\n[Error] ' + str(e)) 112 | user_input = click.prompt(prompt(), hide_input=hide_input) 113 | return callback 114 | 115 | 116 | def choice_prompt_func(prompt_func: Callable[[], str], choices: Sequence[str]) -> Callable[[], str]: 117 | ''' 118 | Formats the prompt and choices in a printable manner. 119 | ''' 120 | return lambda: '%s %s: ' % (prompt_func(), choices) 121 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/utils/config.py: -------------------------------------------------------------------------------- 1 | ''' 2 | This file contains global variables to required to parameterise click functionality 3 | ''' 4 | 5 | language = 'en' # The CLI language selected by the user 6 | non_interactive = False # Whether or not to interactively prompt the user for input. (Useful for tests and debugging) 7 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/utils/constants.py: -------------------------------------------------------------------------------- 1 | import os 2 | from typing import ( 3 | Dict, 4 | List, 5 | ) 6 | 7 | 8 | ZERO_BYTES32 = b'\x00' * 32 9 | 10 | # Execution-spec constants taken from https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md 11 | DOMAIN_DEPOSIT = bytes.fromhex('03000000') 12 | DOMAIN_BLS_TO_EXECUTION_CHANGE = bytes.fromhex('0A000000') 13 | BLS_WITHDRAWAL_PREFIX = bytes.fromhex('00') 14 | ETH1_ADDRESS_WITHDRAWAL_PREFIX = bytes.fromhex('01') 15 | 16 | ETH2GWEI = 10 ** 9 17 | MIN_DEPOSIT_AMOUNT = 2 ** 0 * ETH2GWEI 18 | MAX_DEPOSIT_AMOUNT = 2 ** 5 * ETH2GWEI 19 | 20 | 21 | # File/folder constants 22 | WORD_LISTS_PATH = os.path.join('staking_deposit', 'key_handling', 'key_derivation', 'word_lists') 23 | DEFAULT_VALIDATOR_KEYS_FOLDER_NAME = 'validator_keys' 24 | DEFAULT_BLS_TO_EXECUTION_CHANGES_FOLDER_NAME = 'bls_to_execution_changes' 25 | 26 | # Internationalisation constants 27 | INTL_CONTENT_PATH = os.path.join('staking_deposit', 'intl') 28 | 29 | 30 | def _add_index_to_options(d: Dict[str, List[str]]) -> Dict[str, List[str]]: 31 | ''' 32 | Adds the (1 indexed) index (in the dict) to the first element of value list. 33 | eg. {'en': ['English', 'en']} -> {'en': ['1. English', '1', 'English', 'en']} 34 | Requires dicts to be ordered (Python > 3.6) 35 | ''' 36 | keys = list(d.keys()) # Force copy dictionary keys top prevent iteration over changing dict 37 | for i, key in enumerate(keys): 38 | d.update({key: ['%s. %s' % (i + 1, d[key][0]), str(i + 1)] + d[key]}) 39 | return d 40 | 41 | 42 | INTL_LANG_OPTIONS = _add_index_to_options({ 43 | 'ar': ['العربية', 'ar', 'Arabic'], 44 | 'el': ['ελληνικά', 'el', 'Greek'], 45 | 'en': ['English', 'en'], 46 | 'fr': ['Français', 'Francais', 'fr', 'French'], 47 | 'id': ['Bahasa melayu', 'Melayu', 'id', 'Malay'], 48 | 'it': ['Italiano', 'it', 'Italian'], 49 | 'ja': ['日本語', 'ja', 'Japanese'], 50 | 'ko': ['한국어', '조선말', '韓國語', 'ko', 'Korean'], 51 | 'pt-BR': ['Português do Brasil', 'Brasil', 'pt-BR', 'Brazilian Portuguese'], 52 | 'ro': ['român', 'limba română', 'ro', 'Romainian'], 53 | 'tr': ['Türkçe', 'tr', 'Turkish'], 54 | 'zh-CN': ['简体中文', 'zh-CN', 'zh', 'Chinease'], 55 | }) 56 | MNEMONIC_LANG_OPTIONS = _add_index_to_options({ 57 | 'chinese_simplified': ['简体中文', 'zh', 'zh-CN', 'Chinese Simplified'], 58 | 'chinese_traditional': ['繁體中文', 'zh-tw', 'Chinese Traditional'], 59 | 'czech': ['čeština', 'český jazyk', 'cs', 'Czech'], 60 | 'english': ['English', 'en'], 61 | 'italian': ['Italiano', 'it', 'Italian'], 62 | 'korean': ['한국어', '조선말', '韓國語', 'ko', 'Korean'], 63 | # Portuguese mnemonics are in both pt & pt-BR 64 | 'portuguese': ['Português', 'Português do Brasil', 'pt', 'pt-BR', 'Portuguese'], 65 | 'spanish': ['Español', 'es', 'Spanish'], 66 | }) 67 | 68 | # Sundry constants 69 | UNICODE_CONTROL_CHARS = list(range(0x00, 0x20)) + list(range(0x7F, 0xA0)) 70 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/utils/crypto.py: -------------------------------------------------------------------------------- 1 | from typing import Any 2 | 3 | from Crypto.Hash import ( 4 | SHA256 as _sha256, 5 | SHA512 as _sha512, 6 | ) 7 | from Crypto.Protocol.KDF import ( 8 | scrypt as _scrypt, 9 | HKDF as _HKDF, 10 | PBKDF2 as _PBKDF2, 11 | ) 12 | from Crypto.Cipher import ( 13 | AES as _AES 14 | ) 15 | 16 | 17 | def SHA256(x: bytes) -> bytes: 18 | return _sha256.new(x).digest() 19 | 20 | 21 | def scrypt(*, password: str, salt: str, n: int, r: int, p: int, dklen: int) -> bytes: 22 | if n * r * p < 2**20: # 128 MB memory usage 23 | raise ValueError("The Scrypt parameters chosen are not secure.") 24 | if n >= 2**(128 * r / 8): 25 | raise ValueError("The given `n` should be less than `2**(128 * r / 8)`." 26 | f"\tGot `n={n}`, r={r}, 2**(128 * r / 8)={2**(128 * r / 8)}") 27 | res = _scrypt(password=password, salt=salt, key_len=dklen, N=n, r=r, p=p) 28 | return res if isinstance(res, bytes) else res[0] # PyCryptodome can return Tuple[bytes] 29 | 30 | 31 | def PBKDF2(*, password: bytes, salt: bytes, dklen: int, c: int, prf: str) -> bytes: 32 | if 'sha' not in prf: 33 | raise ValueError(f"String 'sha' is not in `prf`({prf})") 34 | if 'sha256' in prf and c < 2**18: 35 | ''' 36 | Verify the number of rounds of SHA256-PBKDF2. SHA512 not checked as use in BIP39 37 | does not require, and therefore doesn't use, safe parameters (c=2048). 38 | 39 | Ref: https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki#from-mnemonic-to-seed 40 | ''' 41 | raise ValueError("The PBKDF2 parameters chosen are not secure.") 42 | _hash = _sha256 if 'sha256' in prf else _sha512 43 | res = _PBKDF2(password=password, salt=salt, dkLen=dklen, count=c, hmac_hash_module=_hash) # type: ignore 44 | return res if isinstance(res, bytes) else res[0] # PyCryptodome can return Tuple[bytes] 45 | 46 | 47 | def HKDF(*, salt: bytes, IKM: bytes, L: int, info: bytes=b'') -> bytes: 48 | res = _HKDF(master=IKM, key_len=L, salt=salt, hashmod=_sha256, context=info) 49 | return res if isinstance(res, bytes) else res[0] # PyCryptodome can return Tuple[bytes] 50 | 51 | 52 | def AES_128_CTR(*, key: bytes, iv: bytes) -> Any: 53 | if len(key) != 16: 54 | raise ValueError(f"The key length should be 16. Got {len(key)}.") 55 | return _AES.new(key=key, mode=_AES.MODE_CTR, initial_value=iv, nonce=b'') 56 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/utils/file_handling.py: -------------------------------------------------------------------------------- 1 | import os 2 | import sys 3 | 4 | 5 | def resource_path(relative_path: str) -> str: 6 | """ 7 | Get the absolute path to a resource in a manner friendly to PyInstaller. 8 | PyInstaller creates a temp folder and stores path in _MEIPASS which this function swaps 9 | into a resource path so it is available both when building binaries and running natively. 10 | """ 11 | try: 12 | base_path = sys._MEIPASS # type: ignore 13 | except Exception: 14 | base_path = os.path.abspath(".") 15 | return os.path.join(base_path, relative_path) 16 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/utils/intl.py: -------------------------------------------------------------------------------- 1 | import inspect 2 | import difflib 3 | from functools import reduce 4 | import json 5 | from typing import ( 6 | Any, 7 | Dict, 8 | Iterable, 9 | List, 10 | Mapping, 11 | Sequence, 12 | ) 13 | import os 14 | 15 | from staking_deposit.utils import config 16 | from staking_deposit.utils.constants import ( 17 | INTL_CONTENT_PATH, 18 | ) 19 | from staking_deposit.utils.file_handling import ( 20 | resource_path, 21 | ) 22 | from staking_deposit.exceptions import ValidationError 23 | 24 | 25 | def _get_from_dict(dataDict: Dict[str, Any], mapList: Iterable[str]) -> str: 26 | ''' 27 | Iterate nested dictionaries 28 | ''' 29 | try: 30 | ans = reduce(dict.get, mapList, dataDict) 31 | assert isinstance(ans, str) 32 | return ans 33 | except TypeError: 34 | raise KeyError('%s not in internationalisation json file.' % mapList) 35 | except AssertionError: 36 | raise KeyError('The provided params (%s) were incomplete.' % mapList) 37 | 38 | 39 | def load_text(params: List[str], file_path: str='', func: str='', lang: str='') -> str: 40 | ''' 41 | Determine and return the appropriate internationalisation text for a given set of `params`. 42 | ''' 43 | if file_path == '': 44 | # Auto-detect file-path based on call stack 45 | file_path = inspect.stack()[1].filename 46 | if file_path[-4:] == '.pyc': 47 | file_path = file_path[:-4] + '.json' # replace .pyc with .json 48 | elif file_path[-3:] == '.py': 49 | file_path = file_path[:-3] + '.json' # replace .py with .json 50 | else: 51 | raise KeyError("Wrong file_path %s", file_path) 52 | 53 | if func == '': 54 | # Auto-detect function based on call stack 55 | func = inspect.stack()[1].function 56 | 57 | if lang == '': 58 | lang = config.language 59 | 60 | # Determine path to json text 61 | file_path_list = os.path.normpath(file_path).split(os.path.sep) 62 | rel_path_list = file_path_list[file_path_list.index('staking_deposit') + 1:] 63 | json_path = resource_path(os.path.join(INTL_CONTENT_PATH, lang, *rel_path_list)) 64 | 65 | try: 66 | # browse json until text is found 67 | with open(json_path) as f: 68 | text_dict = json.load(f) 69 | return _get_from_dict(text_dict, [func] + params) 70 | except (KeyError, FileNotFoundError): 71 | # If text not found in lang, try return English version 72 | if lang == 'en': 73 | raise KeyError('%s not in %s file' % ([func] + params, json_path)) 74 | return load_text(params, file_path, func, 'en') 75 | 76 | 77 | def get_first_options(options: Mapping[str, Sequence[str]]) -> List[str]: 78 | ''' 79 | Returns the first `option` in the values of the `options` dict. 80 | ''' 81 | return list(map(lambda x: x[0], options.values())) 82 | 83 | 84 | def closest_match(text: str, options: Iterable[str]) -> str: 85 | ''' 86 | Finds the closest match to `text` in the `options_list` 87 | ''' 88 | match = difflib.get_close_matches(text, options, n=1, cutoff=0.6) 89 | if len(match) == 0: 90 | raise ValidationError('%s is not a valid language option' % text) 91 | return match[0] 92 | 93 | 94 | def fuzzy_reverse_dict_lookup(text: str, options: Mapping[str, Sequence[str]]) -> str: 95 | ''' 96 | Returns the closest match to `text` out of the `options` 97 | :param text: The test string that needs to be found 98 | :param options: A dict with keys (the value that will be returned) 99 | and values a list of the options to be matched against 100 | ''' 101 | reverse_lookup_dict = {value: key for key, values in options.items() for value in values} 102 | match = closest_match(text, reverse_lookup_dict.keys()) 103 | return reverse_lookup_dict[match] 104 | -------------------------------------------------------------------------------- /engram-deposit-cli/staking_deposit/utils/ssz.py: -------------------------------------------------------------------------------- 1 | from ssz import ( 2 | ByteVector, 3 | Serializable, 4 | uint64, 5 | bytes4, 6 | bytes32, 7 | bytes48, 8 | bytes96 9 | ) 10 | from staking_deposit.utils.constants import ( 11 | DOMAIN_BLS_TO_EXECUTION_CHANGE, 12 | DOMAIN_DEPOSIT, 13 | ZERO_BYTES32, 14 | ) 15 | 16 | bytes8 = ByteVector(8) 17 | bytes20 = ByteVector(20) 18 | 19 | 20 | # Crypto Domain SSZ 21 | 22 | class SigningData(Serializable): 23 | fields = [ 24 | ('object_root', bytes32), 25 | ('domain', bytes32) 26 | ] 27 | 28 | 29 | class ForkData(Serializable): 30 | fields = [ 31 | ('current_version', bytes4), 32 | ('genesis_validators_root', bytes32), 33 | ] 34 | 35 | 36 | def compute_fork_data_root(current_version: bytes, genesis_validators_root: bytes) -> bytes: 37 | """ 38 | Return the appropriate ForkData root for a given deposit version. 39 | """ 40 | if len(current_version) != 4: 41 | raise ValueError(f"Fork version should be in 4 bytes. Got {len(current_version)}.") 42 | return ForkData( 43 | current_version=current_version, 44 | genesis_validators_root=genesis_validators_root, 45 | ).hash_tree_root 46 | 47 | 48 | def compute_deposit_domain(fork_version: bytes) -> bytes: 49 | """ 50 | Deposit-only `compute_domain` 51 | """ 52 | if len(fork_version) != 4: 53 | raise ValueError(f"Fork version should be in 4 bytes. Got {len(fork_version)}.") 54 | domain_type = DOMAIN_DEPOSIT 55 | fork_data_root = compute_deposit_fork_data_root(fork_version) 56 | return domain_type + fork_data_root[:28] 57 | 58 | 59 | def compute_bls_to_execution_change_domain(fork_version: bytes, genesis_validators_root: bytes) -> bytes: 60 | """ 61 | BLS_TO_EXECUTION_CHANGE-only `compute_domain` 62 | """ 63 | if len(fork_version) != 4: 64 | raise ValueError(f"Fork version should be in 4 bytes. Got {len(fork_version)}.") 65 | domain_type = DOMAIN_BLS_TO_EXECUTION_CHANGE 66 | fork_data_root = compute_fork_data_root(fork_version, genesis_validators_root) 67 | return domain_type + fork_data_root[:28] 68 | 69 | 70 | def compute_deposit_fork_data_root(current_version: bytes) -> bytes: 71 | """ 72 | Return the appropriate ForkData root for a given deposit version. 73 | """ 74 | genesis_validators_root = ZERO_BYTES32 # For deposit, it's fixed value 75 | return compute_fork_data_root(current_version, genesis_validators_root) 76 | 77 | 78 | def compute_signing_root(ssz_object: Serializable, domain: bytes) -> bytes: 79 | """ 80 | Return the signing root of an object by calculating the root of the object-domain tree. 81 | The root is the hash tree root of: 82 | https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#signingdata 83 | """ 84 | if len(domain) != 32: 85 | raise ValueError(f"Domain should be in 32 bytes. Got {len(domain)}.") 86 | domain_wrapped_object = SigningData( 87 | object_root=ssz_object.hash_tree_root, 88 | domain=domain, 89 | ) 90 | return domain_wrapped_object.hash_tree_root 91 | 92 | 93 | class DepositMessage(Serializable): 94 | """ 95 | Ref: https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#depositmessage 96 | """ 97 | fields = [ 98 | ('pubkey', bytes48), 99 | ('withdrawal_credentials', bytes32), 100 | ('amount', uint64), 101 | ] 102 | 103 | 104 | class DepositData(Serializable): 105 | """ 106 | Ref: https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#depositdata 107 | """ 108 | fields = [ 109 | ('pubkey', bytes48), 110 | ('withdrawal_credentials', bytes32), 111 | ('amount', uint64), 112 | ('signature', bytes96) 113 | ] 114 | 115 | 116 | class BLSToExecutionChange(Serializable): 117 | """ 118 | Ref: https://github.com/ethereum/consensus-specs/blob/dev/specs/capella/beacon-chain.md#blstoexecutionchange 119 | """ 120 | fields = [ 121 | ('validator_index', uint64), 122 | ('from_bls_pubkey', bytes48), 123 | ('to_execution_address', bytes20), 124 | ] 125 | 126 | 127 | class SignedBLSToExecutionChange(Serializable): 128 | """ 129 | Ref: https://github.com/ethereum/consensus-specs/blob/dev/specs/capella/beacon-chain.md#signedblstoexecutionchange 130 | """ 131 | fields = [ 132 | ('message', BLSToExecutionChange), 133 | ('signature', bytes96), 134 | ] 135 | -------------------------------------------------------------------------------- /engram-deposit-cli/test_binary_btec_script.py: -------------------------------------------------------------------------------- 1 | import asyncio 2 | import os 3 | import sys 4 | 5 | 6 | # For not importing staking_deposit here 7 | DEFAULT_VALIDATOR_KEYS_FOLDER_NAME = 'bls_to_execution_changes' 8 | 9 | 10 | async def main(argv): 11 | binary_file_path = argv[1] 12 | my_folder_path = os.path.join(os.getcwd(), 'TESTING_TEMP_FOLDER') 13 | if not os.path.exists(my_folder_path): 14 | os.mkdir(my_folder_path) 15 | 16 | if os.name == 'nt': # Windows 17 | run_script_cmd = ".\\" + binary_file_path + '\deposit.exe' 18 | else: # Mac or Linux 19 | run_script_cmd = './' + binary_file_path + '/deposit' 20 | 21 | cmd_args = [ 22 | run_script_cmd, 23 | '--language', 'english', 24 | '--non_interactive', 25 | 'generate-bls-to-execution-change', 26 | '--bls_to_execution_changes_folder', my_folder_path, 27 | '--chain', 'mainnet', 28 | '--mnemonic', '\"sister protect peanut hill ready work profit fit wish want small inflict flip member tail between sick setup bright duck morning sell paper worry\"', 29 | '--bls_withdrawal_credentials_list', '0x00bd0b5a34de5fb17df08410b5e615dda87caf4fb72d0aac91ce5e52fc6aa8de', 30 | '--validator_start_index', '0', 31 | '--validator_indices', '1', 32 | '--execution_address', '0x3434343434343434343434343434343434343434', 33 | ] 34 | proc = await asyncio.create_subprocess_shell( 35 | ' '.join(cmd_args), 36 | stdin=asyncio.subprocess.PIPE, 37 | stdout=asyncio.subprocess.PIPE, 38 | stderr=asyncio.subprocess.PIPE, 39 | ) 40 | seed_phrase = '' 41 | parsing = False 42 | async for out in proc.stdout: 43 | output = out.decode('utf-8').rstrip() 44 | if output.startswith("***Using the tool"): 45 | parsing = True 46 | elif output.startswith("This is your mnemonic"): 47 | parsing = True 48 | elif output.startswith("Please type your mnemonic"): 49 | parsing = False 50 | elif parsing: 51 | seed_phrase += output 52 | if len(seed_phrase) > 0: 53 | encoded_phrase = seed_phrase.encode() 54 | proc.stdin.write(encoded_phrase) 55 | proc.stdin.write(b'\n') 56 | print(output) 57 | 58 | async for out in proc.stderr: 59 | output = out.decode('utf-8').rstrip() 60 | print(f'[stderr] {output}') 61 | 62 | assert len(seed_phrase) > 0 63 | 64 | # Check files 65 | validator_keys_folder_path = os.path.join(my_folder_path, DEFAULT_VALIDATOR_KEYS_FOLDER_NAME) 66 | _, _, key_files = next(os.walk(validator_keys_folder_path)) 67 | 68 | # Clean up 69 | for key_file_name in key_files: 70 | os.remove(os.path.join(validator_keys_folder_path, key_file_name)) 71 | os.rmdir(validator_keys_folder_path) 72 | os.rmdir(my_folder_path) 73 | 74 | 75 | if os.name == 'nt': # Windows 76 | loop = asyncio.ProactorEventLoop() 77 | asyncio.set_event_loop(loop) 78 | loop.run_until_complete(main(sys.argv)) 79 | else: 80 | asyncio.run(main(sys.argv)) 81 | -------------------------------------------------------------------------------- /engram-deposit-cli/test_binary_deposit_script.py: -------------------------------------------------------------------------------- 1 | import asyncio 2 | import os 3 | import sys 4 | 5 | 6 | # For not importing staking_deposit here 7 | DEFAULT_VALIDATOR_KEYS_FOLDER_NAME = 'validator_keys' 8 | 9 | 10 | async def main(argv): 11 | binary_file_path = argv[1] 12 | my_folder_path = os.path.join(os.getcwd(), 'TESTING_TEMP_FOLDER') 13 | if not os.path.exists(my_folder_path): 14 | os.mkdir(my_folder_path) 15 | 16 | if os.name == 'nt': # Windows 17 | run_script_cmd = ".\\" + binary_file_path + '\deposit.exe' 18 | else: # Mac or Linux 19 | run_script_cmd = './' + binary_file_path + '/deposit' 20 | 21 | cmd_args = [ 22 | run_script_cmd, 23 | '--language', 'english', 24 | '--non_interactive', 25 | 'new-mnemonic', 26 | '--num_validators', '1', 27 | '--mnemonic_language', 'english', 28 | '--chain', 'mainnet', 29 | '--keystore_password', 'MyPassword', 30 | '--folder', my_folder_path, 31 | ] 32 | proc = await asyncio.create_subprocess_shell( 33 | ' '.join(cmd_args), 34 | stdin=asyncio.subprocess.PIPE, 35 | stdout=asyncio.subprocess.PIPE, 36 | stderr=asyncio.subprocess.PIPE, 37 | ) 38 | seed_phrase = '' 39 | parsing = False 40 | async for out in proc.stdout: 41 | output = out.decode('utf-8').rstrip() 42 | if output.startswith("This is your mnemonic"): 43 | parsing = True 44 | elif output.startswith("Please type your mnemonic"): 45 | parsing = False 46 | elif parsing: 47 | seed_phrase += output 48 | if len(seed_phrase) > 0: 49 | encoded_phrase = seed_phrase.encode() 50 | proc.stdin.write(encoded_phrase) 51 | proc.stdin.write(b'\n') 52 | print(output) 53 | 54 | async for out in proc.stderr: 55 | output = out.decode('utf-8').rstrip() 56 | print(f'[stderr] {output}') 57 | 58 | assert len(seed_phrase) > 0 59 | 60 | # Check files 61 | validator_keys_folder_path = os.path.join(my_folder_path, DEFAULT_VALIDATOR_KEYS_FOLDER_NAME) 62 | _, _, key_files = next(os.walk(validator_keys_folder_path)) 63 | 64 | # Clean up 65 | for key_file_name in key_files: 66 | os.remove(os.path.join(validator_keys_folder_path, key_file_name)) 67 | os.rmdir(validator_keys_folder_path) 68 | os.rmdir(my_folder_path) 69 | 70 | 71 | if os.name == 'nt': # Windows 72 | loop = asyncio.ProactorEventLoop() 73 | asyncio.set_event_loop(loop) 74 | loop.run_until_complete(main(sys.argv)) 75 | else: 76 | asyncio.run(main(sys.argv)) 77 | -------------------------------------------------------------------------------- /engram-deposit-cli/test_btec_script.py: -------------------------------------------------------------------------------- 1 | import asyncio 2 | import os 3 | 4 | # For not importing staking_deposit here 5 | DEFAULT_VALIDATOR_KEYS_FOLDER_NAME = 'bls_to_execution_changes' 6 | 7 | 8 | async def main(): 9 | my_folder_path = os.path.join(os.getcwd(), 'TESTING_TEMP_FOLDER') 10 | if not os.path.exists(my_folder_path): 11 | os.mkdir(my_folder_path) 12 | 13 | if os.name == 'nt': # Windows 14 | run_script_cmd = 'sh deposit.sh' 15 | else: # Mac or Linux 16 | run_script_cmd = './deposit.sh' 17 | 18 | install_cmd = run_script_cmd + ' install' 19 | print('[INFO] Creating subprocess 1: installation:' , install_cmd) 20 | proc = await asyncio.create_subprocess_shell( 21 | install_cmd, 22 | ) 23 | await proc.wait() 24 | print('[INFO] Installed') 25 | 26 | cmd_args = [ 27 | run_script_cmd, 28 | '--language', 'english', 29 | '--non_interactive', 30 | 'generate-bls-to-execution-change', 31 | '--bls_to_execution_changes_folder', my_folder_path, 32 | '--chain', 'mainnet', 33 | '--mnemonic', '\"sister protect peanut hill ready work profit fit wish want small inflict flip member tail between sick setup bright duck morning sell paper worry\"', 34 | '--bls_withdrawal_credentials_list', '0x00bd0b5a34de5fb17df08410b5e615dda87caf4fb72d0aac91ce5e52fc6aa8de', 35 | '--validator_start_index', '0', 36 | '--validator_indices', '1', 37 | '--execution_address', '0x3434343434343434343434343434343434343434', 38 | ] 39 | proc = await asyncio.create_subprocess_shell( 40 | ' '.join(cmd_args), 41 | stdin=asyncio.subprocess.PIPE, 42 | stdout=asyncio.subprocess.PIPE, 43 | stderr=asyncio.subprocess.PIPE, 44 | ) 45 | seed_phrase = '' 46 | parsing = False 47 | async for out in proc.stdout: 48 | output = out.decode('utf-8').rstrip() 49 | if output.startswith("***Using the tool"): 50 | parsing = True 51 | elif output.startswith("This is your mnemonic"): 52 | parsing = True 53 | elif output.startswith("Please type your mnemonic"): 54 | parsing = False 55 | elif parsing: 56 | seed_phrase += output 57 | if len(seed_phrase) > 0: 58 | encoded_phrase = seed_phrase.encode() 59 | proc.stdin.write(encoded_phrase) 60 | proc.stdin.write(b'\n') 61 | print(output) 62 | 63 | async for out in proc.stderr: 64 | output = out.decode('utf-8').rstrip() 65 | print(f'[stderr] {output}') 66 | 67 | assert len(seed_phrase) > 0 68 | 69 | # Check files 70 | validator_keys_folder_path = os.path.join(my_folder_path, DEFAULT_VALIDATOR_KEYS_FOLDER_NAME) 71 | _, _, key_files = next(os.walk(validator_keys_folder_path)) 72 | 73 | # Clean up 74 | for key_file_name in key_files: 75 | os.remove(os.path.join(validator_keys_folder_path, key_file_name)) 76 | os.rmdir(validator_keys_folder_path) 77 | os.rmdir(my_folder_path) 78 | 79 | 80 | if os.name == 'nt': # Windows 81 | loop = asyncio.ProactorEventLoop() 82 | asyncio.set_event_loop(loop) 83 | loop.run_until_complete(main()) 84 | else: 85 | asyncio.run(main()) 86 | -------------------------------------------------------------------------------- /engram-deposit-cli/test_deposit_script.py: -------------------------------------------------------------------------------- 1 | import asyncio 2 | import os 3 | 4 | # For not importing staking_deposit here 5 | DEFAULT_VALIDATOR_KEYS_FOLDER_NAME = 'validator_keys' 6 | 7 | 8 | async def main(): 9 | my_folder_path = os.path.join(os.getcwd(), 'TESTING_TEMP_FOLDER') 10 | if not os.path.exists(my_folder_path): 11 | os.mkdir(my_folder_path) 12 | 13 | if os.name == 'nt': # Windows 14 | run_script_cmd = 'sh deposit.sh' 15 | else: # Mac or Linux 16 | run_script_cmd = './deposit.sh' 17 | 18 | install_cmd = run_script_cmd + ' install' 19 | print('[INFO] Creating subprocess 1: installation:' , install_cmd) 20 | proc = await asyncio.create_subprocess_shell( 21 | install_cmd, 22 | ) 23 | await proc.wait() 24 | print('[INFO] Installed') 25 | 26 | cmd_args = [ 27 | run_script_cmd, 28 | '--language', 'english', 29 | '--non_interactive', 30 | 'new-mnemonic', 31 | '--num_validators', '1', 32 | '--mnemonic_language', 'english', 33 | '--chain', 'mainnet', 34 | '--keystore_password', 'MyPassword', 35 | '--folder', my_folder_path, 36 | ] 37 | proc = await asyncio.create_subprocess_shell( 38 | ' '.join(cmd_args), 39 | stdin=asyncio.subprocess.PIPE, 40 | stdout=asyncio.subprocess.PIPE, 41 | stderr=asyncio.subprocess.PIPE, 42 | ) 43 | seed_phrase = '' 44 | parsing = False 45 | async for out in proc.stdout: 46 | output = out.decode('utf-8').rstrip() 47 | if output.startswith("This is your mnemonic"): 48 | parsing = True 49 | elif output.startswith("Please type your mnemonic"): 50 | parsing = False 51 | elif parsing: 52 | seed_phrase += output 53 | if len(seed_phrase) > 0: 54 | encoded_phrase = seed_phrase.encode() 55 | proc.stdin.write(encoded_phrase) 56 | proc.stdin.write(b'\n') 57 | print(output) 58 | 59 | async for out in proc.stderr: 60 | output = out.decode('utf-8').rstrip() 61 | print(f'[stderr] {output}') 62 | 63 | assert len(seed_phrase) > 0 64 | 65 | # Check files 66 | validator_keys_folder_path = os.path.join(my_folder_path, DEFAULT_VALIDATOR_KEYS_FOLDER_NAME) 67 | _, _, key_files = next(os.walk(validator_keys_folder_path)) 68 | 69 | # Clean up 70 | for key_file_name in key_files: 71 | os.remove(os.path.join(validator_keys_folder_path, key_file_name)) 72 | os.rmdir(validator_keys_folder_path) 73 | os.rmdir(my_folder_path) 74 | 75 | 76 | if os.name == 'nt': # Windows 77 | loop = asyncio.ProactorEventLoop() 78 | asyncio.set_event_loop(loop) 79 | loop.run_until_complete(main()) 80 | else: 81 | asyncio.run(main()) 82 | -------------------------------------------------------------------------------- /engram-deposit-cli/testnet_deposit_0_1.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/engram-network/tokio-docker/14c03b1d1d5b98f085922f6ed6905c98f3699a8d/engram-deposit-cli/testnet_deposit_0_1.txt -------------------------------------------------------------------------------- /engram-deposit-cli/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/engram-network/tokio-docker/14c03b1d1d5b98f085922f6ed6905c98f3699a8d/engram-deposit-cli/tests/__init__.py -------------------------------------------------------------------------------- /engram-deposit-cli/tests/test_cli/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/engram-network/tokio-docker/14c03b1d1d5b98f085922f6ed6905c98f3699a8d/engram-deposit-cli/tests/test_cli/__init__.py -------------------------------------------------------------------------------- /engram-deposit-cli/tests/test_cli/helpers.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from staking_deposit.key_handling.keystore import Keystore 4 | from staking_deposit.utils.constants import ( 5 | DEFAULT_BLS_TO_EXECUTION_CHANGES_FOLDER_NAME, 6 | DEFAULT_VALIDATOR_KEYS_FOLDER_NAME, 7 | ) 8 | 9 | 10 | def clean_key_folder(my_folder_path: str) -> None: 11 | sub_folder_path = os.path.join(my_folder_path, DEFAULT_VALIDATOR_KEYS_FOLDER_NAME) 12 | clean_folder(my_folder_path, sub_folder_path) 13 | 14 | 15 | def clean_btec_folder(my_folder_path: str) -> None: 16 | sub_folder_path = os.path.join(my_folder_path, DEFAULT_BLS_TO_EXECUTION_CHANGES_FOLDER_NAME) 17 | clean_folder(my_folder_path, sub_folder_path) 18 | 19 | 20 | def clean_folder(primary_folder_path: str, sub_folder_path: str) -> None: 21 | if not os.path.exists(sub_folder_path): 22 | return 23 | 24 | _, _, key_files = next(os.walk(sub_folder_path)) 25 | for key_file_name in key_files: 26 | os.remove(os.path.join(sub_folder_path, key_file_name)) 27 | os.rmdir(sub_folder_path) 28 | os.rmdir(primary_folder_path) 29 | 30 | 31 | def get_uuid(key_file: str) -> str: 32 | keystore = Keystore.from_file(key_file) 33 | return keystore.uuid 34 | 35 | 36 | def get_permissions(path: str, file_name: str) -> str: 37 | return oct(os.stat(os.path.join(path, file_name)).st_mode & 0o777) 38 | 39 | 40 | def verify_file_permission(os_ref, folder_path, files): 41 | if os_ref.name == 'posix': 42 | for file_name in files: 43 | assert get_permissions(folder_path, file_name) == '0o440' 44 | 45 | 46 | def prepare_testing_folder(os_ref, testing_folder_name='TESTING_TEMP_FOLDER'): 47 | my_folder_path = os_ref.path.join(os_ref.getcwd(), testing_folder_name) 48 | clean_btec_folder(my_folder_path) 49 | if not os_ref.path.exists(my_folder_path): 50 | os_ref.mkdir(my_folder_path) 51 | return my_folder_path 52 | -------------------------------------------------------------------------------- /engram-deposit-cli/tests/test_cli/test_generate_bls_to_execution_change.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | from click.testing import CliRunner 4 | 5 | from staking_deposit.deposit import cli 6 | from staking_deposit.utils.constants import DEFAULT_BLS_TO_EXECUTION_CHANGES_FOLDER_NAME 7 | from .helpers import ( 8 | clean_btec_folder, 9 | prepare_testing_folder, 10 | verify_file_permission, 11 | ) 12 | 13 | 14 | def test_existing_mnemonic_bls_withdrawal() -> None: 15 | # Prepare folder 16 | my_folder_path = prepare_testing_folder(os) 17 | 18 | runner = CliRunner() 19 | inputs = [] 20 | data = '\n'.join(inputs) 21 | arguments = [ 22 | '--language', 'english', 23 | '--non_interactive', 24 | 'generate-bls-to-execution-change', 25 | '--bls_to_execution_changes_folder', my_folder_path, 26 | '--chain', 'mainnet', 27 | '--mnemonic', 'sister protect peanut hill ready work profit fit wish want small inflict flip member tail between sick setup bright duck morning sell paper worry', # noqa: E501 28 | '--bls_withdrawal_credentials_list', '0x00bd0b5a34de5fb17df08410b5e615dda87caf4fb72d0aac91ce5e52fc6aa8de', 29 | '--validator_start_index', '0', 30 | '--validator_indices', '1', 31 | '--execution_address', '0x3434343434343434343434343434343434343434', 32 | ] 33 | result = runner.invoke(cli, arguments, input=data) 34 | assert result.exit_code == 0 35 | 36 | # Check files 37 | bls_to_execution_changes_folder_path = os.path.join(my_folder_path, DEFAULT_BLS_TO_EXECUTION_CHANGES_FOLDER_NAME) 38 | _, _, btec_files = next(os.walk(bls_to_execution_changes_folder_path)) 39 | 40 | # TODO verify file content 41 | assert len(set(btec_files)) == 1 42 | 43 | # Verify file permissions 44 | verify_file_permission(os, folder_path=bls_to_execution_changes_folder_path, files=btec_files) 45 | 46 | # Clean up 47 | clean_btec_folder(my_folder_path) 48 | 49 | 50 | def test_existing_mnemonic_bls_withdrawal_interactive() -> None: 51 | # Prepare folder 52 | my_folder_path = prepare_testing_folder(os) 53 | 54 | runner = CliRunner() 55 | inputs = [ 56 | 'mainnet', # network/chain 57 | 'sister protect peanut hill ready work profit fit wish want small inflict flip member tail between sick setup bright duck morning sell paper worry', # noqa: E501 58 | '0', # validator_start_index 59 | '1', # validator_index 60 | '0x00bd0b5a34de5fb17df08410b5e615dda87caf4fb72d0aac91ce5e52fc6aa8de', 61 | '0x3434343434343434343434343434343434343434', 62 | '0x3434343434343434343434343434343434343434', 63 | 64 | ] 65 | data = '\n'.join(inputs) 66 | arguments = [ 67 | '--language', 'english', 68 | 'generate-bls-to-execution-change', 69 | '--bls_to_execution_changes_folder', my_folder_path, 70 | ] 71 | result = runner.invoke(cli, arguments, input=data) 72 | assert result.exit_code == 0 73 | 74 | # Check files 75 | bls_to_execution_changes_folder_path = os.path.join(my_folder_path, DEFAULT_BLS_TO_EXECUTION_CHANGES_FOLDER_NAME) 76 | _, _, btec_files = next(os.walk(bls_to_execution_changes_folder_path)) 77 | 78 | # TODO verify file content 79 | assert len(set(btec_files)) == 1 80 | 81 | # Verify file permissions 82 | verify_file_permission(os, folder_path=bls_to_execution_changes_folder_path, files=btec_files) 83 | 84 | # Clean up 85 | clean_btec_folder(my_folder_path) 86 | 87 | 88 | def test_existing_mnemonic_bls_withdrawal_multiple() -> None: 89 | # Prepare folder 90 | my_folder_path = prepare_testing_folder(os) 91 | 92 | runner = CliRunner() 93 | inputs = [] 94 | data = '\n'.join(inputs) 95 | arguments = [ 96 | '--language', 'english', 97 | '--non_interactive', 98 | 'generate-bls-to-execution-change', 99 | '--bls_to_execution_changes_folder', my_folder_path, 100 | '--chain', 'mainnet', 101 | '--mnemonic', 'sister protect peanut hill ready work profit fit wish want small inflict flip member tail between sick setup bright duck morning sell paper worry', # noqa: E501 102 | '--bls_withdrawal_credentials_list', '0x00bd0b5a34de5fb17df08410b5e615dda87caf4fb72d0aac91ce5e52fc6aa8de, 0x00a75d83f169fa6923f3dd78386d9608fab710d8f7fcf71ba9985893675d5382', # noqa: E501 103 | '--validator_start_index', '0', 104 | '--validator_indices', '1,2', 105 | '--execution_address', '0x3434343434343434343434343434343434343434', 106 | ] 107 | result = runner.invoke(cli, arguments, input=data) 108 | assert result.exit_code == 0 109 | 110 | # Check files 111 | bls_to_execution_changes_folder_path = os.path.join(my_folder_path, DEFAULT_BLS_TO_EXECUTION_CHANGES_FOLDER_NAME) 112 | _, _, btec_files = next(os.walk(bls_to_execution_changes_folder_path)) 113 | 114 | # TODO verify file content 115 | assert len(set(btec_files)) == 1 116 | 117 | # Verify file permissions 118 | verify_file_permission(os, folder_path=bls_to_execution_changes_folder_path, files=btec_files) 119 | 120 | # Clean up 121 | clean_btec_folder(my_folder_path) 122 | -------------------------------------------------------------------------------- /engram-deposit-cli/tests/test_cli/test_regeneration.py: -------------------------------------------------------------------------------- 1 | import json 2 | import os 3 | from pathlib import Path 4 | 5 | from click.testing import CliRunner 6 | from staking_deposit.cli import new_mnemonic 7 | from staking_deposit.deposit import cli 8 | from staking_deposit.utils.constants import DEFAULT_VALIDATOR_KEYS_FOLDER_NAME 9 | from .helpers import clean_key_folder, get_permissions, get_uuid 10 | 11 | 12 | def test_regeneration(monkeypatch) -> None: 13 | # Part 1: new-mnemonic 14 | 15 | # monkeypatch get_mnemonic 16 | mock_mnemonic = "legal winner thank year wave sausage worth useful legal winner thank yellow" 17 | 18 | def mock_get_mnemonic(language, words_path, entropy=None) -> str: 19 | return mock_mnemonic 20 | 21 | monkeypatch.setattr(new_mnemonic, "get_mnemonic", mock_get_mnemonic) 22 | 23 | # Prepare folder 24 | folder_path_1 = os.path.join(os.getcwd(), 'TESTING_TEMP_FOLDER_1') 25 | folder_path_2 = os.path.join(os.getcwd(), 'TESTING_TEMP_FOLDER_2') 26 | clean_key_folder(folder_path_1) 27 | clean_key_folder(folder_path_2) 28 | if not os.path.exists(folder_path_1): 29 | os.mkdir(folder_path_1) 30 | if not os.path.exists(folder_path_2): 31 | os.mkdir(folder_path_2) 32 | 33 | runner = CliRunner() 34 | # Create index 0 and 1 35 | my_password = "MyPassword" 36 | inputs = ['english', 'english', '2', 'mainnet', my_password, my_password, mock_mnemonic] 37 | data = '\n'.join(inputs) 38 | result = runner.invoke(cli, ['new-mnemonic', '--folder', folder_path_1], input=data) 39 | assert result.exit_code == 0 40 | 41 | # Check files 42 | validator_keys_folder_path_1 = os.path.join(folder_path_1, DEFAULT_VALIDATOR_KEYS_FOLDER_NAME) 43 | _, _, files = next(os.walk(validator_keys_folder_path_1)) 44 | part_1_key_files = sorted([key_file for key_file in files if key_file.startswith('keystore')]) 45 | 46 | all_uuid = [get_uuid(validator_keys_folder_path_1 + '/' + key_file) 47 | for key_file in part_1_key_files] 48 | assert len(set(all_uuid)) == 2 49 | 50 | # Verify file permissions 51 | if os.name == 'posix': 52 | for file_name in part_1_key_files: 53 | assert get_permissions(validator_keys_folder_path_1, file_name) == '0o440' 54 | 55 | # Part 2: existing-mnemonic 56 | runner = CliRunner() 57 | # Create index 1 and 2 58 | inputs = [ 59 | 'english', 60 | mock_mnemonic, 61 | '1', '1', '2', 'mainnet', 'MyPassword', 'MyPassword'] 62 | data = '\n'.join(inputs) 63 | arguments = ['existing-mnemonic', '--folder', folder_path_2] 64 | result = runner.invoke(cli, arguments, input=data) 65 | 66 | assert result.exit_code == 0 67 | 68 | # Check files 69 | validator_keys_folder_path_2 = os.path.join(folder_path_2, DEFAULT_VALIDATOR_KEYS_FOLDER_NAME) 70 | _, _, files = next(os.walk(validator_keys_folder_path_2)) 71 | part_2_key_files = sorted([key_file for key_file in files if key_file.startswith('keystore')]) 72 | 73 | all_uuid = [get_uuid(validator_keys_folder_path_2 + '/' + key_file) 74 | for key_file in part_2_key_files] 75 | assert len(set(all_uuid)) == 2 76 | 77 | # Finally: 78 | # Check the index=1 files have the same pubkey 79 | assert '1_0_0' in part_1_key_files[1] and '1_0_0' in part_2_key_files[0] 80 | with open(Path(validator_keys_folder_path_1 + '/' + part_1_key_files[1])) as f: 81 | keystore_1_1 = json.load(f) 82 | with open(Path(validator_keys_folder_path_2 + '/' + part_2_key_files[0])) as f: 83 | keystore_2_0 = json.load(f) 84 | assert keystore_1_1['pubkey'] == keystore_2_0['pubkey'] 85 | assert keystore_1_1['path'] == keystore_2_0['path'] 86 | 87 | # Verify file permissions 88 | if os.name == 'posix': 89 | for file_name in part_2_key_files: 90 | assert get_permissions(validator_keys_folder_path_2, file_name) == '0o440' 91 | 92 | # Clean up 93 | clean_key_folder(folder_path_1) 94 | clean_key_folder(folder_path_2) 95 | -------------------------------------------------------------------------------- /engram-deposit-cli/tests/test_credentials.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from staking_deposit.credentials import CredentialList 4 | from staking_deposit.settings import MainnetSetting 5 | 6 | 7 | def test_from_mnemonic() -> None: 8 | with pytest.raises(ValueError): 9 | CredentialList.from_mnemonic( 10 | mnemonic="", 11 | mnemonic_password="", 12 | num_keys=1, 13 | amounts=[32, 32], 14 | chain_setting=MainnetSetting, 15 | start_index=1, 16 | hex_eth1_withdrawal_address=None, 17 | ) 18 | -------------------------------------------------------------------------------- /engram-deposit-cli/tests/test_intl/schemas/cli/existing_mnemonic.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "type": "object", 4 | "properties": { 5 | "validate_mnemonic": { 6 | "type": "object", 7 | "properties": { 8 | "err_invalid_mnemonic": { 9 | "type": "string" 10 | } 11 | }, 12 | "required": [ 13 | "err_invalid_mnemonic" 14 | ] 15 | }, 16 | "existing_mnemonic": { 17 | "type": "object", 18 | "properties": { 19 | "arg_existing_mnemonic": { 20 | "type": "object", 21 | "properties": { 22 | "help": { 23 | "type": "string" 24 | } 25 | }, 26 | "required": [ 27 | "help" 28 | ] 29 | }, 30 | "arg_mnemonic": { 31 | "type": "object", 32 | "properties": { 33 | "help": { 34 | "type": "string" 35 | }, 36 | "prompt": { 37 | "type": "string" 38 | } 39 | }, 40 | "required": [ 41 | "help", 42 | "prompt" 43 | ] 44 | }, 45 | "arg_mnemonic_password": { 46 | "type": "object", 47 | "properties": { 48 | "help": { 49 | "type": "string" 50 | }, 51 | "confirm": { 52 | "type": "string" 53 | } 54 | }, 55 | "required": [ 56 | "help", 57 | "confirm" 58 | ] 59 | }, 60 | "arg_validator_start_index": { 61 | "type": "object", 62 | "properties": { 63 | "help": { 64 | "type": "string" 65 | }, 66 | "prompt": { 67 | "type": "string" 68 | }, 69 | "confirm":{ 70 | "type": "string" 71 | } 72 | }, 73 | "required": [ 74 | "help", 75 | "prompt", 76 | "confirm" 77 | ] 78 | } 79 | }, 80 | "required": [ 81 | "arg_existing_mnemonic", 82 | "arg_mnemonic", 83 | "arg_mnemonic_password", 84 | "arg_validator_start_index" 85 | ] 86 | } 87 | }, 88 | "required": [ 89 | "validate_mnemonic", 90 | "existing_mnemonic" 91 | ] 92 | } -------------------------------------------------------------------------------- /engram-deposit-cli/tests/test_intl/schemas/cli/generate_keys.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "type": "object", 4 | "properties": { 5 | "generate_keys_arguments_decorator": { 6 | "type": "object", 7 | "properties": { 8 | "num_validators": { 9 | "type": "object", 10 | "properties": { 11 | "help": { 12 | "type": "string" 13 | }, 14 | "prompt": { 15 | "type": "string" 16 | } 17 | }, 18 | "required": [ 19 | "help", 20 | "prompt" 21 | ] 22 | }, 23 | "folder": { 24 | "type": "object", 25 | "properties": { 26 | "help": { 27 | "type": "string" 28 | } 29 | } 30 | }, 31 | "chain": { 32 | "type": "object", 33 | "properties": { 34 | "help": { 35 | "type": "string" 36 | }, 37 | "prompt": { 38 | "type": "string" 39 | } 40 | }, 41 | "required": [ 42 | "help", 43 | "prompt" 44 | ] 45 | }, 46 | "keystore_password": { 47 | "type": "object", 48 | "properties": { 49 | "help": { 50 | "type": "string" 51 | }, 52 | "prompt": { 53 | "type": "string" 54 | }, 55 | "confirm": { 56 | "type": "string" 57 | }, 58 | "mismatch": { 59 | "type": "string" 60 | } 61 | }, 62 | "required": [ 63 | "help", 64 | "prompt", 65 | "confirm", 66 | "mismatch" 67 | ] 68 | } 69 | }, 70 | "required": [ 71 | "num_validators", 72 | "chain", 73 | "keystore_password" 74 | ] 75 | }, 76 | "generate_keys": { 77 | "type": "object", 78 | "properties": { 79 | "msg_key_creation": { 80 | "type": "string" 81 | }, 82 | "msg_creation_success": { 83 | "type": "string" 84 | }, 85 | "msg_pause": { 86 | "type": "string" 87 | }, 88 | "err_verify_keystores": { 89 | "type": "string" 90 | }, 91 | "err_verify_deposit": { 92 | "type": "string" 93 | } 94 | }, 95 | "required": [ 96 | "msg_key_creation", 97 | "msg_creation_success", 98 | "msg_pause", 99 | "err_verify_keystores", 100 | "err_verify_deposit" 101 | ] 102 | } 103 | }, 104 | "required": [ 105 | "generate_keys_arguments_decorator", 106 | "generate_keys" 107 | ] 108 | } -------------------------------------------------------------------------------- /engram-deposit-cli/tests/test_intl/schemas/cli/new_mnemonic.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "type": "object", 4 | "properties": { 5 | "new_mnemonic": { 6 | "type": "object", 7 | "properties": { 8 | "arg_new_mnemonic": { 9 | "type": "object", 10 | "properties": { 11 | "help": { 12 | "type": "string" 13 | } 14 | }, 15 | "required": [ 16 | "help" 17 | ] 18 | }, 19 | "arg_mnemonic_language": { 20 | "type": "object", 21 | "properties": { 22 | "default": { 23 | "type": "string" 24 | }, 25 | "help": { 26 | "type": "string" 27 | }, 28 | "prompt": { 29 | "type": "string" 30 | } 31 | }, 32 | "required": [ 33 | "default", 34 | "help", 35 | "prompt" 36 | ] 37 | }, 38 | "msg_mnemonic_presentation": { 39 | "type": "string" 40 | }, 41 | "msg_press_any_key": { 42 | "type": "string" 43 | }, 44 | "msg_mnemonic_retype_prompt": { 45 | "type": "string" 46 | } 47 | }, 48 | "required": [ 49 | "arg_new_mnemonic", 50 | "arg_mnemonic_language", 51 | "msg_mnemonic_presentation", 52 | "msg_press_any_key", 53 | "msg_mnemonic_retype_prompt" 54 | ] 55 | } 56 | }, 57 | "required": [ 58 | "new_mnemonic" 59 | ] 60 | } -------------------------------------------------------------------------------- /engram-deposit-cli/tests/test_intl/schemas/credentials.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "type": "object", 4 | "properties": { 5 | "from_mnemonic": { 6 | "type": "object", 7 | "properties": { 8 | "msg_key_creation": { 9 | "type": "string" 10 | } 11 | }, 12 | "required": [ 13 | "msg_key_creation" 14 | ] 15 | }, 16 | "export_keystores": { 17 | "type": "object", 18 | "properties": { 19 | "msg_keystore_creation": { 20 | "type": "string" 21 | } 22 | }, 23 | "required": [ 24 | "msg_keystore_creation" 25 | ] 26 | }, 27 | "export_deposit_data_json": { 28 | "type": "object", 29 | "properties": { 30 | "msg_depositdata_creation": { 31 | "type": "string" 32 | } 33 | }, 34 | "required": [ 35 | "msg_depositdata_creation" 36 | ] 37 | }, 38 | "verify_keystores": { 39 | "type": "object", 40 | "properties": { 41 | "msg_keystore_verification": { 42 | "type": "string" 43 | } 44 | }, 45 | "required": [ 46 | "msg_keystore_verification" 47 | ] 48 | } 49 | }, 50 | "required": [ 51 | "from_mnemonic", 52 | "export_keystores", 53 | "export_deposit_data_json", 54 | "verify_keystores" 55 | ] 56 | } -------------------------------------------------------------------------------- /engram-deposit-cli/tests/test_intl/schemas/deposit.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "type": "object", 4 | "properties": { 5 | "check_python_version": { 6 | "type": "object", 7 | "properties": { 8 | "err_python_version": { 9 | "type": "string" 10 | } 11 | }, 12 | "required": [ 13 | "err_python_version" 14 | ] 15 | } 16 | }, 17 | "required": [ 18 | "check_python_version" 19 | ] 20 | } -------------------------------------------------------------------------------- /engram-deposit-cli/tests/test_intl/schemas/utils/validation.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "http://json-schema.org/draft-04/schema#", 3 | "type": "object", 4 | "properties": { 5 | "verify_deposit_data_json": { 6 | "type": "object", 7 | "properties": { 8 | "msg_deposit_verification": { 9 | "type": "string" 10 | } 11 | }, 12 | "required": [ 13 | "msg_deposit_verification" 14 | ] 15 | }, 16 | "validate_password_strength": { 17 | "type": "object", 18 | "properties": { 19 | "msg_password_length": { 20 | "type": "string" 21 | } 22 | }, 23 | "required": [ 24 | "msg_password_length" 25 | ] 26 | } 27 | }, 28 | "required": [ 29 | "verify_deposit_data_json", 30 | "validate_password_strength" 31 | ] 32 | } -------------------------------------------------------------------------------- /engram-deposit-cli/tests/test_intl/test_json_schema.py: -------------------------------------------------------------------------------- 1 | import json 2 | import jsonschema 3 | import os 4 | import pytest 5 | import re 6 | from typing import ( 7 | List, 8 | ) 9 | 10 | from staking_deposit.utils.constants import INTL_CONTENT_PATH 11 | 12 | 13 | TEST_SCHEMAS_FOLDER = os.path.join(os.path.dirname(__file__), 'schemas') 14 | 15 | 16 | def files_to_check(root_dir: str) -> List[str]: 17 | file_list = [] 18 | for dir_, _, files in os.walk(root_dir): 19 | for file_name in files: 20 | rel_dir = os.path.relpath(dir_, root_dir) 21 | rel_file = os.path.join(rel_dir, file_name) 22 | file_list.append(rel_file) 23 | return file_list 24 | 25 | 26 | def languages_to_check(root_dir: str) -> List[str]: 27 | dirs = next(os.walk(root_dir))[1] 28 | regex = re.compile('([A-Za-z]){2}(-([A-Za-z]){2})?') 29 | return [d for d in dirs if re.fullmatch(regex, d)] 30 | 31 | 32 | @pytest.mark.parametrize( 33 | 'lang, schema_path', 34 | [ 35 | (lang, schema) 36 | for schema in files_to_check(TEST_SCHEMAS_FOLDER) 37 | for lang in languages_to_check(INTL_CONTENT_PATH) 38 | ] 39 | ) 40 | def test_language_schemas(lang: str, schema_path: str) -> None: 41 | with open(os.path.join(TEST_SCHEMAS_FOLDER, schema_path)) as schema_file: 42 | schema = json.load(schema_file) 43 | with open(os.path.join(INTL_CONTENT_PATH, lang, schema_path)) as lang_file: 44 | lang_json = json.load(lang_file) 45 | jsonschema.validate(lang_json, schema) 46 | -------------------------------------------------------------------------------- /engram-deposit-cli/tests/test_key_handling/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/engram-network/tokio-docker/14c03b1d1d5b98f085922f6ed6905c98f3699a8d/engram-deposit-cli/tests/test_key_handling/__init__.py -------------------------------------------------------------------------------- /engram-deposit-cli/tests/test_key_handling/keystore_test_vectors/test0.json: -------------------------------------------------------------------------------- 1 | { 2 | "crypto": { 3 | "kdf": { 4 | "function": "pbkdf2", 5 | "params": { 6 | "dklen": 32, 7 | "c": 262144, 8 | "prf": "hmac-sha256", 9 | "salt": "d4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3" 10 | }, 11 | "message": "" 12 | }, 13 | "checksum": { 14 | "function": "sha256", 15 | "params": {}, 16 | "message": "8a9f5d9912ed7e75ea794bc5a89bca5f193721d30868ade6f73043c6ea6febf1" 17 | }, 18 | "cipher": { 19 | "function": "aes-128-ctr", 20 | "params": { 21 | "iv": "264daa3f303d7259501c93d997d84fe6" 22 | }, 23 | "message": "cee03fde2af33149775b7223e7845e4fb2c8ae1792e5f99fe9ecf474cc8c16ad" 24 | } 25 | }, 26 | "description": "This is a test keystore that uses PBKDF2 to secure the secret.", 27 | "pubkey": "9612d7a727c9d0a22e185a1c768478dfe919cada9266988cb32359c11f2b7b27f4ae4040902382ae2910c15e2b420d07", 28 | "path": "m/12381/60/0/0", 29 | "uuid": "64625def-3331-4eea-ab6f-782f3ed16a83", 30 | "version": 4 31 | } -------------------------------------------------------------------------------- /engram-deposit-cli/tests/test_key_handling/keystore_test_vectors/test1.json: -------------------------------------------------------------------------------- 1 | { 2 | "crypto": { 3 | "kdf": { 4 | "function": "scrypt", 5 | "params": { 6 | "dklen": 32, 7 | "n": 262144, 8 | "p": 1, 9 | "r": 8, 10 | "salt": "d4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3" 11 | }, 12 | "message": "" 13 | }, 14 | "checksum": { 15 | "function": "sha256", 16 | "params": {}, 17 | "message": "d2217fe5f3e9a1e34581ef8a78f7c9928e436d36dacc5e846690a5581e8ea484" 18 | }, 19 | "cipher": { 20 | "function": "aes-128-ctr", 21 | "params": { 22 | "iv": "264daa3f303d7259501c93d997d84fe6" 23 | }, 24 | "message": "06ae90d55fe0a6e9c5c3bc5b170827b2e5cce3929ed3f116c2811e6366dfe20f" 25 | } 26 | }, 27 | "description": "This is a test keystore that uses scrypt to secure the secret.", 28 | "pubkey": "9612d7a727c9d0a22e185a1c768478dfe919cada9266988cb32359c11f2b7b27f4ae4040902382ae2910c15e2b420d07", 29 | "path": "m/12381/60/3141592653/589793238", 30 | "uuid": "1d85ae20-35c5-4611-98e8-aa14a633906f", 31 | "version": 4 32 | } -------------------------------------------------------------------------------- /engram-deposit-cli/tests/test_key_handling/test_key_derivation/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/engram-network/tokio-docker/14c03b1d1d5b98f085922f6ed6905c98f3699a8d/engram-deposit-cli/tests/test_key_handling/test_key_derivation/__init__.py -------------------------------------------------------------------------------- /engram-deposit-cli/tests/test_key_handling/test_key_derivation/test_mnemonic.py: -------------------------------------------------------------------------------- 1 | import os 2 | import pytest 3 | import json 4 | from typing import ( 5 | Sequence, 6 | ) 7 | 8 | from staking_deposit.utils.constants import ( 9 | MNEMONIC_LANG_OPTIONS, 10 | ) 11 | from staking_deposit.key_handling.key_derivation.mnemonic import ( 12 | _index_to_word, 13 | _get_word_list, 14 | abbreviate_words, 15 | get_seed, 16 | get_mnemonic, 17 | reconstruct_mnemonic, 18 | ) 19 | 20 | 21 | WORD_LISTS_PATH = os.path.join(os.getcwd(), 'staking_deposit', 'key_handling', 'key_derivation', 'word_lists') 22 | all_languages = MNEMONIC_LANG_OPTIONS.keys() 23 | 24 | test_vector_filefolder = os.path.join('tests', 'test_key_handling', 25 | 'test_key_derivation', 'test_vectors', 'mnemonic.json') 26 | with open(test_vector_filefolder, 'r', encoding='utf-8') as f: 27 | test_vectors = json.load(f) 28 | 29 | 30 | @pytest.mark.parametrize( 31 | 'language,test', 32 | [(language, test) for language, language_test_vectors in test_vectors.items() for test in language_test_vectors] 33 | ) 34 | def test_bip39(language: str, test: Sequence[str]) -> None: 35 | test_entropy = bytes.fromhex(test[0]) 36 | test_mnemonic = test[1] 37 | test_seed = bytes.fromhex(test[2]) 38 | 39 | assert get_mnemonic(language=language, words_path=WORD_LISTS_PATH, entropy=test_entropy) == test_mnemonic 40 | assert get_seed(mnemonic=test_mnemonic, password='TREZOR') == test_seed 41 | 42 | 43 | @pytest.mark.parametrize( 44 | 'test_mnemonic', 45 | [(test_mnemonic[1]) 46 | for _, language_test_vectors in test_vectors.items() 47 | for test_mnemonic in language_test_vectors] 48 | ) 49 | def test_reconstruct_mnemonic(test_mnemonic: str) -> None: 50 | assert reconstruct_mnemonic(test_mnemonic, WORD_LISTS_PATH) is not None 51 | 52 | 53 | def abbreviate_mnemonic(mnemonic: str) -> str: 54 | words = str.split(mnemonic) 55 | words = abbreviate_words(words) 56 | assert all([len(word) <= 4 for word in words]) 57 | return str.join(' ', words) 58 | 59 | 60 | @pytest.mark.parametrize( 61 | 'test_mnemonic', 62 | [abbreviate_mnemonic(test_mnemonic[1]) 63 | for _, language_test_vectors in test_vectors.items() 64 | for test_mnemonic in language_test_vectors] 65 | ) 66 | def test_reconstruct_abbreviated_mnemonic(test_mnemonic: str) -> None: 67 | assert reconstruct_mnemonic(test_mnemonic, WORD_LISTS_PATH) is not None 68 | 69 | 70 | @pytest.mark.parametrize( 71 | 'language', ['english'] 72 | ) 73 | @pytest.mark.parametrize( 74 | 'index, valid', 75 | [ 76 | (0, True), 77 | (2047, True), 78 | (2048, False), 79 | ] 80 | ) 81 | def test_get_word(language: str, index: int, valid: bool) -> None: 82 | word_list = _get_word_list(language, WORD_LISTS_PATH) 83 | if valid: 84 | _index_to_word(word_list=word_list, index=index) 85 | else: 86 | with pytest.raises(IndexError): 87 | _index_to_word(word_list=word_list, index=index) 88 | -------------------------------------------------------------------------------- /engram-deposit-cli/tests/test_key_handling/test_key_derivation/test_path.py: -------------------------------------------------------------------------------- 1 | import os 2 | import json 3 | import pytest 4 | 5 | from staking_deposit.key_handling.key_derivation.tree import ( 6 | _flip_bits_256, 7 | _IKM_to_lamport_SK, 8 | _parent_SK_to_lamport_PK, 9 | _HKDF_mod_r, 10 | ) 11 | 12 | from staking_deposit.key_handling.key_derivation.path import ( 13 | mnemonic_and_path_to_key, 14 | path_to_nodes, 15 | ) 16 | 17 | test_vector_filefolder = os.path.join(os.getcwd(), 'tests', 'test_key_handling', 'test_key_derivation', 18 | 'test_vectors', 'tree_kdf_intermediate.json') 19 | with open(test_vector_filefolder, 'r') as f: 20 | test_vector_dict = json.load(f) 21 | 22 | 23 | @pytest.mark.parametrize( 24 | 'test_vector', 25 | [test_vector_dict] 26 | ) 27 | def test_flip_bits_256(test_vector) -> None: 28 | test_vector_int = int(test_vector['seed'][:64], 16) # 64 comes from string chars containing .5 bytes 29 | assert test_vector_int & _flip_bits_256(test_vector_int) == 0 30 | 31 | 32 | @pytest.mark.parametrize( 33 | 'test_vector', 34 | [test_vector_dict] 35 | ) 36 | def test_IKM_to_lamport_SK(test_vector) -> None: 37 | test_vector_lamport_0 = [bytes.fromhex(x) for x in test_vector['lamport_0']] 38 | test_vector_lamport_1 = [bytes.fromhex(x) for x in test_vector['lamport_1']] 39 | salt = test_vector['child_index'].to_bytes(4, 'big') 40 | IKM = test_vector['master_SK'].to_bytes(32, 'big') 41 | lamport_0 = _IKM_to_lamport_SK(IKM=IKM, salt=salt) 42 | not_IKM = _flip_bits_256(test_vector['master_SK']).to_bytes(32, 'big') 43 | lamport_1 = _IKM_to_lamport_SK(IKM=not_IKM, salt=salt) 44 | assert test_vector_lamport_0 == lamport_0 45 | assert test_vector_lamport_1 == lamport_1 46 | 47 | 48 | @pytest.mark.parametrize( 49 | 'test_vector', 50 | [test_vector_dict] 51 | ) 52 | def test_parent_SK_to_lamport_PK(test_vector) -> None: 53 | parent_SK = test_vector['master_SK'] 54 | index = test_vector['child_index'] 55 | lamport_PK = bytes.fromhex(test_vector['compressed_lamport_PK']) 56 | assert lamport_PK == _parent_SK_to_lamport_PK(parent_SK=parent_SK, index=index) 57 | 58 | 59 | @pytest.mark.parametrize( 60 | 'test_vector', 61 | [test_vector_dict] 62 | ) 63 | def test_HKDF_mod_r(test_vector) -> None: 64 | test_0 = (bytes.fromhex(test_vector['seed']), test_vector['master_SK']) 65 | test_1 = (bytes.fromhex(test_vector['compressed_lamport_PK']), test_vector['child_SK']) 66 | for test in (test_0, test_1): 67 | assert _HKDF_mod_r(IKM=test[0]) == test[1] 68 | 69 | 70 | @pytest.mark.parametrize( 71 | 'test_vector', 72 | [test_vector_dict] 73 | ) 74 | def test_mnemonic_and_path_to_key(test_vector) -> None: 75 | mnemonic = test_vector['mnemonic'] 76 | password = test_vector['password'] 77 | path = test_vector['path'] 78 | key = test_vector['child_SK'] 79 | assert mnemonic_and_path_to_key(mnemonic=mnemonic, path=path, password=password) == key 80 | 81 | 82 | @pytest.mark.parametrize( 83 | 'path, valid', 84 | [ 85 | ("m/12381/3600/0/0/0", True), 86 | ("x/12381/3600/0/0/0", False), 87 | ("m/qwert/3600/0/0/0", False), 88 | ] 89 | ) 90 | def test_path_to_nodes(path, valid): 91 | if valid: 92 | path_to_nodes(path) 93 | else: 94 | with pytest.raises(ValueError): 95 | path_to_nodes(path) 96 | -------------------------------------------------------------------------------- /engram-deposit-cli/tests/test_key_handling/test_key_derivation/test_tree.py: -------------------------------------------------------------------------------- 1 | import os 2 | import json 3 | from py_ecc.bls import G2ProofOfPossession as bls 4 | import pytest 5 | 6 | 7 | from staking_deposit.key_handling.key_derivation.tree import ( 8 | _HKDF_mod_r, 9 | derive_child_SK, 10 | derive_master_SK, 11 | ) 12 | 13 | 14 | test_vector_filefolder = os.path.join(os.getcwd(), 'tests', 'test_key_handling', 15 | 'test_key_derivation', 'test_vectors', 'tree_kdf.json') 16 | with open(test_vector_filefolder, 'r') as f: 17 | test_vectors = json.load(f)['kdf_tests'] 18 | 19 | 20 | @pytest.mark.parametrize( 21 | 'test', 22 | test_vectors 23 | ) 24 | def test_hkdf_mod_r(test) -> None: 25 | seed = bytes.fromhex(test['seed']) 26 | assert bls.KeyGen(seed) == _HKDF_mod_r(IKM=seed) 27 | 28 | 29 | @pytest.mark.parametrize( 30 | 'seed', 31 | [b'\x00' * 32] 32 | ) 33 | @pytest.mark.parametrize( 34 | 'key_info', 35 | [b'\x00' * 32, b'\x01\x23\x45\x67\x89\xAB\xBC\xDE\xFF', b'\xFF' * 16] 36 | ) 37 | def test_hkdf_mod_r_key_info(seed: bytes, key_info: bytes) -> None: 38 | assert bls.KeyGen(seed, key_info) == _HKDF_mod_r(IKM=seed, key_info=key_info) 39 | 40 | 41 | @pytest.mark.parametrize( 42 | 'test', 43 | test_vectors 44 | ) 45 | @pytest.mark.parametrize( 46 | 'is_valid_seed', 47 | (True, False) 48 | ) 49 | def test_derive_master_SK(test, is_valid_seed) -> None: 50 | master_SK = test['master_SK'] 51 | if is_valid_seed: 52 | seed = bytes.fromhex(test['seed']) 53 | assert derive_master_SK(seed=seed) == master_SK 54 | else: 55 | seed = "\x12" * 31 56 | with pytest.raises(ValueError): 57 | derive_master_SK(seed=seed) 58 | 59 | 60 | @pytest.mark.parametrize( 61 | 'test', 62 | test_vectors 63 | ) 64 | @pytest.mark.parametrize( 65 | 'is_valid_index', 66 | (True, False) 67 | ) 68 | def test_derive_child_SK_valid(test, is_valid_index) -> None: 69 | parent_SK = test['master_SK'] 70 | child_SK = test['child_SK'] 71 | if is_valid_index: 72 | index = test['child_index'] 73 | assert derive_child_SK(parent_SK=parent_SK, index=index) == child_SK 74 | else: 75 | index = 2**32 76 | with pytest.raises(IndexError): 77 | derive_child_SK(parent_SK=parent_SK, index=index) 78 | -------------------------------------------------------------------------------- /engram-deposit-cli/tests/test_key_handling/test_key_derivation/test_vectors/tree_kdf.json: -------------------------------------------------------------------------------- 1 | { 2 | "kdf_tests": [ 3 | { 4 | "seed": "c55257c360c07c72029aebc1b53c05ed0362ada38ead3e3e9efa3708e53495531f09a6987599d18264c1e1c92f2cf141630c7a3c4ab7c81b2f001698e7463b04", 5 | "master_SK": 6083874454709270928345386274498605044986640685124978867557563392430687146096, 6 | "child_index": 0, 7 | "child_SK": 20397789859736650942317412262472558107875392172444076792671091975210932703118 8 | }, 9 | { 10 | "seed": "3141592653589793238462643383279502884197169399375105820974944592", 11 | "master_SK": 29757020647961307431480504535336562678282505419141012933316116377660817309383, 12 | "child_index": 3141592653, 13 | "child_SK": 25457201688850691947727629385191704516744796114925897962676248250929345014287 14 | }, 15 | { 16 | "seed": "0099FF991111002299DD7744EE3355BBDD8844115566CC55663355668888CC00", 17 | "master_SK": 27580842291869792442942448775674722299803720648445448686099262467207037398656, 18 | "child_index": 4294967295, 19 | "child_SK": 29358610794459428860402234341874281240803786294062035874021252734817515685787 20 | }, 21 | { 22 | "seed": "d4e56740f876aef8c010b86a40d5f56745a118d0906a34e69aec8c0db1cb8fa3", 23 | "master_SK": 19022158461524446591288038168518313374041767046816487870552872741050760015818, 24 | "child_index": 42, 25 | "child_SK": 31372231650479070279774297061823572166496564838472787488249775572789064611981 26 | } 27 | ] 28 | } -------------------------------------------------------------------------------- /engram-deposit-cli/tests/test_key_handling/test_keystore.py: -------------------------------------------------------------------------------- 1 | import os 2 | import json 3 | import pytest 4 | 5 | from staking_deposit.key_handling.keystore import ( 6 | Keystore, 7 | ScryptKeystore, 8 | Pbkdf2Keystore, 9 | ) 10 | 11 | test_vector_password = '𝔱𝔢𝔰𝔱𝔭𝔞𝔰𝔰𝔴𝔬𝔯𝔡🔑' 12 | test_vector_secret = bytes.fromhex('000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f') 13 | test_vector_folder = os.path.join(os.getcwd(), 'tests', 'test_key_handling', 'keystore_test_vectors') 14 | _, _, test_vector_files = next(os.walk(test_vector_folder)) # type: ignore 15 | 16 | test_vector_keystores = [Keystore.from_file(os.path.join(test_vector_folder, f)) for f in test_vector_files] 17 | 18 | 19 | def test_json_serialization() -> None: 20 | for keystore, keystore_json_file in zip(test_vector_keystores, test_vector_files): 21 | keystore_json_path = os.path.join(test_vector_folder, keystore_json_file) 22 | with open(keystore_json_path) as f: 23 | assert json.loads(keystore.as_json()) == json.load(f) 24 | 25 | 26 | def test_encrypt_decrypt_test_vectors() -> None: 27 | for tv in test_vector_keystores: 28 | aes_iv = tv.crypto.cipher.params['iv'] 29 | kdf_salt = tv.crypto.kdf.params['salt'] 30 | keystore = Pbkdf2Keystore if 'pbkdf' in tv.crypto.kdf.function else ScryptKeystore 31 | generated_keystore = keystore.encrypt( 32 | secret=test_vector_secret, 33 | password=test_vector_password, 34 | aes_iv=aes_iv, 35 | kdf_salt=kdf_salt) 36 | assert generated_keystore.decrypt(test_vector_password) == test_vector_secret 37 | 38 | 39 | def test_generated_keystores() -> None: 40 | for tv in test_vector_keystores: 41 | aes_iv = tv.crypto.cipher.params['iv'] 42 | kdf_salt = tv.crypto.kdf.params['salt'] 43 | keystore = Pbkdf2Keystore if 'pbkdf' in tv.crypto.kdf.function else ScryptKeystore 44 | generated_keystore = keystore.encrypt( 45 | secret=test_vector_secret, 46 | password=test_vector_password, 47 | aes_iv=aes_iv, 48 | kdf_salt=kdf_salt) 49 | assert generated_keystore.crypto == tv.crypto 50 | 51 | 52 | def test_encrypt_decrypt_pbkdf2_random_iv() -> None: 53 | generated_keystore = Pbkdf2Keystore.encrypt(secret=test_vector_secret, password=test_vector_password) 54 | assert generated_keystore.decrypt(test_vector_password) == test_vector_secret 55 | 56 | 57 | def test_encrypt_decrypt_scrypt_random_iv() -> None: 58 | generated_keystore = ScryptKeystore.encrypt(secret=test_vector_secret, password=test_vector_password) 59 | assert generated_keystore.decrypt(test_vector_password) == test_vector_secret 60 | 61 | 62 | def test_encrypt_decrypt_incorrect_password() -> None: 63 | generated_keystore = ScryptKeystore.encrypt(secret=test_vector_secret, password=test_vector_password) 64 | incorrect_password = test_vector_password + 'incorrect' 65 | with pytest.raises(ValueError): 66 | generated_keystore.decrypt(incorrect_password) 67 | 68 | 69 | @pytest.mark.parametrize( 70 | 'password,processed_password', 71 | [ 72 | ['\a', b''], ['\b', b''], ['\t', b''], 73 | ['a', b'a'], ['abc', b'abc'], ['a\bc', b'ac'], 74 | ] 75 | ) 76 | def test_process_password(password: str, processed_password: bytes) -> None: 77 | assert Keystore._process_password(password) == processed_password 78 | -------------------------------------------------------------------------------- /engram-deposit-cli/tests/test_utils/test_constants.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from typing import ( 3 | Dict, 4 | List, 5 | ) 6 | 7 | from staking_deposit.utils.constants import _add_index_to_options 8 | 9 | 10 | @pytest.mark.parametrize( 11 | 'arg, test', [ 12 | ({'en': ['English', 'en']}, {'en': ['1. English', '1', 'English', 'en']}), 13 | ({'a': ['a'], 'b': ['b'], 'c': ['c']}, 14 | {'a': ['1. a', '1', 'a'], 'b': ['2. b', '2', 'b'], 'c': ['3. c', '3', 'c']}) 15 | ] 16 | ) 17 | def test_add_index_to_options(arg: Dict[str, List[str]], test: Dict[str, List[str]]) -> None: 18 | assert _add_index_to_options(arg) == test 19 | -------------------------------------------------------------------------------- /engram-deposit-cli/tests/test_utils/test_crypto.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from staking_deposit.utils.crypto import ( 4 | scrypt, 5 | PBKDF2, 6 | AES_128_CTR, 7 | ) 8 | 9 | 10 | @pytest.mark.parametrize( 11 | 'n, r, valid', 12 | [ 13 | (int(2**(128 * 1 / 8)) * 2, 8, True), 14 | (int(2**(128 * 1 / 8)) * 1, 8, False), # Unsafe Parameters 15 | (int(2**(128 * 1 / 8)) * 1, 1, False), # Invalid n 16 | ] 17 | ) 18 | def test_scrypt_invalid_params(n, r, valid): 19 | if valid: 20 | scrypt( 21 | password="mypassword", 22 | salt="mysalt", 23 | n=n, 24 | r=r, 25 | p=1, 26 | dklen=32, 27 | ) 28 | else: 29 | with pytest.raises(ValueError): 30 | scrypt( 31 | password="mypassword", 32 | salt="mysalt", 33 | n=n, 34 | r=r, 35 | p=1, 36 | dklen=32, 37 | ) 38 | 39 | 40 | @pytest.mark.parametrize( 41 | 'prf, valid', 42 | [ 43 | ("sha512", True), 44 | ("512", False), 45 | ] 46 | ) 47 | def test_PBKDF2_invalid_prf(prf, valid): 48 | if valid: 49 | PBKDF2( 50 | password="mypassword", 51 | salt="mysalt", 52 | dklen=64, 53 | c=2048, 54 | prf=prf 55 | ) 56 | else: 57 | with pytest.raises(ValueError): 58 | PBKDF2( 59 | password="mypassword", 60 | salt="mysalt", 61 | dklen=64, 62 | c=2048, 63 | prf=prf, 64 | ) 65 | 66 | 67 | @pytest.mark.parametrize( 68 | 'count, prf, valid', 69 | [ 70 | (2**18, "sha256", True), 71 | (2**17, "sha256", False), 72 | (2**11, "sha512", True), 73 | ] 74 | ) 75 | def test_PBKDF2_invalid_count(count, prf, valid): 76 | if valid: 77 | PBKDF2( 78 | password="mypassword", 79 | salt="mysalt", 80 | dklen=64, 81 | c=count, 82 | prf=prf 83 | ) 84 | else: 85 | with pytest.raises(ValueError): 86 | PBKDF2( 87 | password="mypassword", 88 | salt="mysalt", 89 | dklen=64, 90 | c=2048, 91 | prf=prf, 92 | ) 93 | 94 | 95 | @pytest.mark.parametrize( 96 | 'key, iv, valid', 97 | [ 98 | (b'\x12' * 16, bytes.fromhex("edc2606468f9660ad222690db8836a9d"), True), 99 | (b'\x12' * 15, bytes.fromhex("edc2606468f9660ad222690db8836a9d"), False), 100 | ] 101 | ) 102 | def test_AES_128_CTR(key, iv, valid): 103 | if valid: 104 | AES_128_CTR(key=key, iv=iv) 105 | else: 106 | with pytest.raises(ValueError): 107 | AES_128_CTR(key=key, iv=iv) 108 | -------------------------------------------------------------------------------- /engram-deposit-cli/tests/test_utils/test_intl.py: -------------------------------------------------------------------------------- 1 | import os 2 | import pytest 3 | from typing import ( 4 | List, 5 | ) 6 | 7 | from staking_deposit.utils.constants import ( 8 | INTL_LANG_OPTIONS, 9 | MNEMONIC_LANG_OPTIONS, 10 | ) 11 | from staking_deposit.utils.intl import ( 12 | fuzzy_reverse_dict_lookup, 13 | get_first_options, 14 | load_text, 15 | ) 16 | 17 | 18 | @pytest.mark.parametrize( 19 | 'params, file_path, func, lang, found_str', [ 20 | (['arg_mnemonic_language', 'prompt'], os.path.join('staking_deposit', 'cli', 'new_mnemonic.json'), 21 | 'new_mnemonic', 'en', 'Please choose the language of the mnemonic word list'), 22 | (['arg_mnemonic_language', 'prompt'], os.path.join('staking_deposit', 'cli', 'new_mnemonic.json'), 23 | 'new_mnemonic', 'ja', 'ニーモニックの言語を選択してください'), 24 | ] 25 | ) 26 | def test_load_text(params: List[str], file_path: str, func: str, lang: str, found_str: str) -> None: 27 | assert found_str in load_text(params, file_path, func, lang) 28 | 29 | 30 | @pytest.mark.parametrize( 31 | 'params, file_path, func, lang, valid', [ 32 | (['arg_mnemonic_language', 'prompt'], os.path.join('staking_deposit', 'cli', 'new_mnemonic.json'), 33 | 'new_mnemonic', 'zz', True), # invalid language, should revert to english 34 | (['arg_mnemonic_language'], os.path.join('staking_deposit', 'cli', 'new_mnemonic.json'), 35 | 'new_mnemonic', 'en', False), # incomplete params 36 | (['arg_mnemonic_language', 'prompt'], os.path.join('staking_deposit', 'cli', 'invalid.json'), 37 | 'new_mnemonic', 'en', False), # invalid json path 38 | (['arg_mnemonic_language', 'prompt'], os.path.join('staking_deposit', 'cli', 'invalid.json'), 39 | 'new_mnemonic', 'zz', False), # invalid json path in invalid language 40 | ] 41 | ) 42 | def test_load_text_en_fallover(params: List[str], file_path: str, func: str, lang: str, valid: bool) -> None: 43 | if valid: 44 | assert load_text(params, file_path, func, lang) == load_text(params, file_path, func, 'en') 45 | else: 46 | try: 47 | load_text(params, file_path, func, lang) 48 | except KeyError: 49 | pass 50 | else: 51 | assert False 52 | 53 | 54 | @pytest.mark.parametrize( 55 | 'options, first_options', [ 56 | ({'a': ['a', 1], 'b': range(5), 'c': [chr(i) for i in range(65, 90)]}, ['a', 0, 'A']), 57 | ] 58 | ) 59 | def test_get_first_options(options, first_options): 60 | assert get_first_options(options) == first_options 61 | 62 | 63 | @pytest.mark.parametrize( 64 | 'test, match, options', [ 65 | ('English', 'english', MNEMONIC_LANG_OPTIONS), 66 | ('한국어', 'korean', MNEMONIC_LANG_OPTIONS), 67 | ('Roman', 'ro', INTL_LANG_OPTIONS), 68 | ] 69 | ) 70 | def test_fuzzy_reverse_dict_lookup(test, match, options): 71 | assert fuzzy_reverse_dict_lookup(test, options) == match 72 | -------------------------------------------------------------------------------- /engram-deposit-cli/tests/test_utils/test_ssz.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | 3 | from staking_deposit.utils.ssz import ( 4 | DepositMessage, 5 | compute_deposit_domain, 6 | compute_deposit_fork_data_root, 7 | compute_signing_root, 8 | ) 9 | 10 | 11 | @pytest.mark.parametrize( 12 | 'fork_version, valid, result', 13 | [ 14 | (b"\x12" * 4, True, b'\x03\x00\x00\x00\rf`\x8a\xf5W\xf4\xfa\xdb\xfc\xe2H\xac7\xf6\xe7c\x9c\xe3q\x10\x0cC\xd1Z\xad\x05\xcb'), # noqa: E501 15 | (b"\x12" * 5, False, None), 16 | (b"\x12" * 3, False, None), 17 | ] 18 | ) 19 | def test_compute_deposit_domain(fork_version, valid, result): 20 | if valid: 21 | assert compute_deposit_domain(fork_version) == result 22 | else: 23 | with pytest.raises(ValueError): 24 | compute_deposit_domain(fork_version) 25 | 26 | 27 | @pytest.mark.parametrize( 28 | 'current_version, valid, result', 29 | [ 30 | (b"\x12" * 4, True, b'\rf`\x8a\xf5W\xf4\xfa\xdb\xfc\xe2H\xac7\xf6\xe7c\x9c\xe3q\x10\x0cC\xd1Z\xad\x05\xcb\x08\xac\x1d\xc2'), # noqa: E501 31 | (b"\x12" * 5, False, None), 32 | (b"\x12" * 3, False, None), 33 | ] 34 | ) 35 | def test_compute_deposit_fork_data_root(current_version, valid, result): 36 | if valid: 37 | assert compute_deposit_fork_data_root(current_version=current_version) == result 38 | else: 39 | with pytest.raises(ValueError): 40 | compute_deposit_fork_data_root(current_version=current_version) 41 | 42 | 43 | @pytest.mark.parametrize( 44 | 'domain, valid, result', 45 | [ 46 | (b"\x12" * 32, True, b'g\xa33\x0f\xf8{\xdbF\xbb{\x80\xcazd\x1e9\x8dj\xc4\xe8zhVR|\xac\xc8)\xfba\x89o'), # noqa: E501 47 | (b"\x12" * 31, False, None), 48 | (b"\x12" * 33, False, None), 49 | ] 50 | ) 51 | def test_compute_signing_root(domain, valid, result): 52 | deposit_message = DepositMessage( 53 | pubkey=b'\x12' * 48, 54 | withdrawal_credentials=b'\x12' * 32, 55 | amount=100, 56 | ) 57 | if valid: 58 | assert compute_signing_root(deposit_message, domain) == result 59 | else: 60 | with pytest.raises(ValueError): 61 | compute_signing_root(deposit_message, domain) 62 | -------------------------------------------------------------------------------- /engram-deposit-cli/tests/test_utils/test_validation.py: -------------------------------------------------------------------------------- 1 | import pytest 2 | from typing import ( 3 | Any, 4 | ) 5 | 6 | from staking_deposit.exceptions import ValidationError 7 | from staking_deposit.utils.validation import ( 8 | normalize_input_list, 9 | validate_int_range, 10 | validate_password_strength, 11 | ) 12 | 13 | 14 | @pytest.mark.parametrize( 15 | 'password, valid', 16 | [ 17 | ('12345678', True), 18 | ('1234567', False), 19 | ] 20 | ) 21 | def test_validate_password_strength(password, valid): 22 | if valid: 23 | validate_password_strength(password=password) 24 | else: 25 | with pytest.raises(ValidationError): 26 | validate_password_strength(password=password) 27 | 28 | 29 | @pytest.mark.parametrize( 30 | 'num, low, high, valid', 31 | [ 32 | (2, 0, 4, True), 33 | (0, 0, 4, True), 34 | (-1, 0, 4, False), 35 | (4, 0, 4, False), 36 | (0.2, 0, 4, False), 37 | ('0', 0, 4, True), 38 | ('a', 0, 4, False), 39 | ] 40 | ) 41 | def test_validate_int_range(num: Any, low: int, high: int, valid: bool) -> None: 42 | if valid: 43 | validate_int_range(num, low, high) 44 | else: 45 | with pytest.raises(ValidationError): 46 | validate_int_range(num, low, high) 47 | 48 | 49 | @pytest.mark.parametrize( 50 | 'input, result', 51 | [ 52 | ('1', ['1']), 53 | ('1,2,3', ['1', '2', '3']), 54 | ('[1,2,3]', ['1', '2', '3']), 55 | ('(1,2,3)', ['1', '2', '3']), 56 | ('{1,2,3}', ['1', '2', '3']), 57 | ('1 2 3', ['1', '2', '3']), 58 | ('1 2 3', ['1', '2', '3']), 59 | ] 60 | ) 61 | def test_normalize_input_list(input, result): 62 | assert normalize_input_list(input) == result 63 | -------------------------------------------------------------------------------- /engram-deposit-cli/tox.ini: -------------------------------------------------------------------------------- 1 | [tox] 2 | envlist= 3 | py{310,38}-core 4 | py{310,38}-lint 5 | py{310,38}-script 6 | 7 | [testenv] 8 | passenv= 9 | PYTEST_ADDOPTS 10 | basepython= 11 | py310: python3.10 12 | py38: python3.8 13 | 14 | [common-install] 15 | deps= 16 | -r{toxinidir}/requirements.txt 17 | -r{toxinidir}/requirements_test.txt 18 | 19 | [common-core] 20 | deps={[common-install]deps} 21 | commands= 22 | pytest {posargs:tests} 23 | 24 | [common-lint] 25 | deps={[common-install]deps} 26 | commands= 27 | flake8 --config={toxinidir}/flake8.ini {toxinidir}/tests 28 | mypy --config-file {toxinidir}/mypy.ini -p staking_deposit 29 | 30 | [common-script] 31 | deps= 32 | -r{toxinidir}/requirements_test.txt # for async-pytest 33 | commands= 34 | python {toxinidir}/test_deposit_script.py 35 | python {toxinidir}/test_btec_script.py 36 | 37 | [testenv:py310-core] 38 | deps={[common-core]deps} 39 | commands={[common-core]commands} 40 | 41 | [testenv:py38-core] 42 | deps={[common-core]deps} 43 | commands={[common-core]commands} 44 | 45 | [testenv:py310-lint] 46 | deps={[common-lint]deps} 47 | commands={[common-lint]commands} 48 | 49 | [testenv:py38-lint] 50 | deps={[common-lint]deps} 51 | commands={[common-lint]commands} 52 | 53 | [testenv:py310-script] 54 | deps={[common-script]deps} 55 | commands={[common-script]commands} 56 | 57 | [testenv:py38-script] 58 | deps={[common-script]deps} 59 | commands={[common-script]commands} 60 | -------------------------------------------------------------------------------- /scripts/clean.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | # pruning and clean docker images and dangling images 4 | docker system prune -a 5 | 6 | # delete all data files 7 | sudo rm -rf ./consensus/* 8 | sudo rm -rf ./execution/* -------------------------------------------------------------------------------- /scripts/install-asdf.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | printf "Installing All Dependencies...\n"; 4 | sudo apt-get install gcc jq clang curl wget llvm chrony g++ -y 5 | 6 | # Clone the asdf repository 7 | git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.13.1 8 | 9 | # Add asdf to the current shell session 10 | . "$HOME/.asdf/asdf.sh" >> $HOME/.bashrc 11 | . "$HOME/.asdf/completions/asdf.bash" >> $HOME/.bashrc 12 | 13 | # Source the updated .bashrc 14 | source $HOME/.bashrc 15 | 16 | # Display a message indicating successful installation 17 | echo "asdf-vm installed successfully." 18 | 19 | # Download Golang binary using asdf-vm 20 | asdf plugin add golang https://github.com/asdf-community/asdf-golang.git 21 | asdf install golang 1.21.3 22 | asdf global golang 1.21.3 23 | 24 | # Installing eth2-val-tools to adding new mnemonics 25 | go install github.com/protolambda/eth2-val-tools@latest 26 | go install github.com/wealdtech/ethereal@latest 27 | 28 | # Move eth2-val-tools 29 | sudo mv $HOME/.asdf/installs/golang/1.21.3/packages/bin/eth2-val-tools /usr/local/bin 30 | sudo mv $HOME/.asdf/installs/golang/1.21.3/packages/bin/ethereal /usr/local/bin 31 | -------------------------------------------------------------------------------- /scripts/install-docker.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Download and execute the Docker installation script 4 | curl -fsSL https://get.docker.com | bash 5 | sudo sh get-docker.sh 6 | 7 | # Set Permission Docker 8 | sudo chmod 666 /var/run/docker.sock 9 | -------------------------------------------------------------------------------- /scripts/validator-build.sh: -------------------------------------------------------------------------------- 1 | docker run -it --rm -v $(pwd)/validator_keys:/app/validator_keys engramnet/staking-deposit-cli:dencun existing-mnemonic --num_validators=1 --validator_start_index=0 2 | -------------------------------------------------------------------------------- /scripts/validator-deposit-data.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | amount=32000000000 4 | smin=0 5 | smax=1 6 | 7 | eth2-val-tools deposit-data \ 8 | --source-min=$smin \ 9 | --source-max=$smax \ 10 | --amount=$amount \ 11 | --fork-version=0x10000131 \ 12 | --withdrawals-mnemonic="test test test test test test test test test test test junk" \ 13 | --validators-mnemonic="test test test test test test test test test test test junk" > testnet_deposit_$smin\_$smax.txt 14 | 15 | while read x; do 16 | account_name="$(echo "$x" | jq '.account')" 17 | pubkey="$(echo "$x" | jq '.pubkey')" 18 | echo "Sending deposit for validator $account_name $pubkey" 19 | ethereal beacon deposit \ 20 | --allow-unknown-contract=true \ 21 | --address="0x4242424242424242424242424242424242424242" \ 22 | --connection=https://tokio-archive.engram.tech \ 23 | --data="$x" \ 24 | --allow-excessive-deposit \ 25 | --value="$amount" \ 26 | --from="0x000000000000000000000000000000000000000b" \ 27 | --privatekey="0x000000000000.....................0000000000000" 28 | echo "Sent deposit for validator $account_name $pubkey" 29 | sleep 2 30 | done < testnet_deposit_$smin\_$smax.txt 31 | --------------------------------------------------------------------------------