diff --git a/.circleci/config.yml b/.circleci/config.yml index 60752fa7..0e9cb4d7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -102,7 +102,7 @@ jobs: - run: name: Run deposit script on Windows" command: python ./test_deposit_script.py - build-linux: + build-linux-amd64: machine: image: ubuntu-1604:202007-01 working_directory: ~/repo @@ -119,15 +119,73 @@ jobs: command: | export PYTHONHASHSEED=42 export CIRCLE_SHORT_SHA1=$(eval echo $CIRCLE_SHA1 | cut -c -7) - export BUILD_FILE_NAME=eth2deposit-cli-${CIRCLE_SHORT_SHA1}-linux-amd64; + export BUILD_FILE_NAME=staking_deposit-cli-${CIRCLE_SHORT_SHA1}-linux-amd64; mkdir ${BUILD_FILE_NAME}; pyenv global 3.7.5; pyinstaller --distpath ./${BUILD_FILE_NAME} ./build_configs/linux/build.spec; + - run: + name: Test executable binaries + command: | + export PYTHONHASHSEED=42 + export CIRCLE_SHORT_SHA1=$(eval echo $CIRCLE_SHA1 | cut -c -7) + export BUILD_FILE_NAME=staking_deposit-cli-${CIRCLE_SHORT_SHA1}-linux-amd64; + export TEST_FOLDER_NAME=TMP_TEST_FOLDER + mkdir ${TEST_FOLDER_NAME} + cp -r ${BUILD_FILE_NAME} ${TEST_FOLDER_NAME} + cp test_binary_script.py ${TEST_FOLDER_NAME} + cd ${TEST_FOLDER_NAME} + python test_binary_script.py ./${BUILD_FILE_NAME}; + - run: + name: Compress the file + command: | + export PYTHONHASHSEED=42 + export CIRCLE_SHORT_SHA1=$(eval echo $CIRCLE_SHA1 | cut -c -7) + export BUILD_FILE_NAME=staking_deposit-cli-${CIRCLE_SHORT_SHA1}-linux-amd64; + tar -zcvf ${BUILD_FILE_NAME}.tar.gz ./${BUILD_FILE_NAME}; + mkdir /tmp/artifacts; + cp ${BUILD_FILE_NAME}.tar.gz /tmp/artifacts; + sha256sum ${BUILD_FILE_NAME}.tar.gz | head -c 64 > /tmp/artifacts/${BUILD_FILE_NAME}.sha256 + - store_artifacts: + path: /tmp/artifacts + build-linux-arm64: + machine: + image: ubuntu-2004:202101-01 + resource_class: arm.medium + working_directory: ~/repo + steps: + - checkout + - run: + name: Install building requirements on Linux ARM64 + command: | + env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.7.5; + pyenv global 3.7.5; + pip install -r ./build_configs/linux/requirements.txt; + - run: + name: Build with build.spec + command: | + export PYTHONHASHSEED=42 + export CIRCLE_SHORT_SHA1=$(eval echo $CIRCLE_SHA1 | cut -c -7) + export BUILD_FILE_NAME=staking_deposit-cli-${CIRCLE_SHORT_SHA1}-linux-arm64; + mkdir ${BUILD_FILE_NAME}; + pyenv global 3.7.5; + pyinstaller --distpath ./${BUILD_FILE_NAME} ./build_configs/linux/build.spec; + - run: + name: Test executable binaries + command: | + export PYTHONHASHSEED=42 + export CIRCLE_SHORT_SHA1=$(eval echo $CIRCLE_SHA1 | cut -c -7) + export BUILD_FILE_NAME=staking_deposit-cli-${CIRCLE_SHORT_SHA1}-linux-arm64; + export TEST_FOLDER_NAME=TMP_TEST_FOLDER + mkdir ${TEST_FOLDER_NAME} + cp -r ${BUILD_FILE_NAME} ${TEST_FOLDER_NAME} + cp test_binary_script.py ${TEST_FOLDER_NAME} + cd ${TEST_FOLDER_NAME} + python test_binary_script.py ./${BUILD_FILE_NAME}; - run: name: Compress the file command: | export CIRCLE_SHORT_SHA1=$(eval echo $CIRCLE_SHA1 | cut -c -7) - export BUILD_FILE_NAME=eth2deposit-cli-${CIRCLE_SHORT_SHA1}-linux-amd64; + export BUILD_FILE_NAME=staking_deposit-cli-${CIRCLE_SHORT_SHA1}-linux-arm64; tar -zcvf ${BUILD_FILE_NAME}.tar.gz ./${BUILD_FILE_NAME}; mkdir /tmp/artifacts; cp ${BUILD_FILE_NAME}.tar.gz /tmp/artifacts; @@ -148,15 +206,28 @@ jobs: command: | $PYTHONHASHSEED = 42 $CIRCLE_SHORT_SHA1 = $env:CIRCLE_SHA1.substring(0,7) - $BUILD_FILE_NAME = "eth2deposit-cli-" + $CIRCLE_SHORT_SHA1 + "-windows-amd64" + $BUILD_FILE_NAME = "staking_deposit-cli-" + $CIRCLE_SHORT_SHA1 + "-windows-amd64" mkdir $BUILD_FILE_NAME $BUILD_FILE_NAME_PATH = ".\" + $BUILD_FILE_NAME pyinstaller --distpath $BUILD_FILE_NAME_PATH .\build_configs\windows\build.spec + - run: + name: Test executable binaries + command: | + $PYTHONHASHSEED = 42 + $CIRCLE_SHORT_SHA1 = $env:CIRCLE_SHA1.substring(0,7) + $BUILD_FILE_NAME = "staking_deposit-cli-" + $CIRCLE_SHORT_SHA1 + "-windows-amd64" + $TEST_FOLDER_NAME = "TMP_TEST_FOLDER" + mkdir ${TEST_FOLDER_NAME} + Copy-item ${BUILD_FILE_NAME} -destination ${TEST_FOLDER_NAME} -recurse + copy test_binary_script.py ${TEST_FOLDER_NAME} + cd ${TEST_FOLDER_NAME} + python test_binary_script.py ${BUILD_FILE_NAME} - run: name: Compress the file command: | + $PYTHONHASHSEED = 42 $CIRCLE_SHORT_SHA1 = $env:CIRCLE_SHA1.substring(0,7) - $BUILD_FILE_NAME = "eth2deposit-cli-" + $CIRCLE_SHORT_SHA1 + "-windows-amd64" + $BUILD_FILE_NAME = "staking_deposit-cli-" + $CIRCLE_SHORT_SHA1 + "-windows-amd64" $BUILD_FILE_NAME_PATH = ".\" + $BUILD_FILE_NAME $ZIP_FILE_NAME = $BUILD_FILE_NAME + ".zip" Compress-Archive -Path $BUILD_FILE_NAME_PATH -DestinationPath $ZIP_FILE_NAME @@ -168,7 +239,7 @@ jobs: path: /tmp/artifacts build-macos: macos: - xcode: 11.3.0 + xcode: 12.4.0 working_directory: ~/repo steps: - run: xcodebuild -version @@ -182,14 +253,27 @@ jobs: command: | export PYTHONHASHSEED=42 export CIRCLE_SHORT_SHA1=$(eval echo $CIRCLE_SHA1 | cut -c -7) - export BUILD_FILE_NAME=eth2deposit-cli-${CIRCLE_SHORT_SHA1}-darwin-amd64; + export BUILD_FILE_NAME=staking_deposit-cli-${CIRCLE_SHORT_SHA1}-darwin-amd64; mkdir ${BUILD_FILE_NAME}; pyinstaller --distpath ./${BUILD_FILE_NAME} ./build_configs/macos/build.spec; + - run: + name: Test executable binaries + command: | + export PYTHONHASHSEED=42 + export CIRCLE_SHORT_SHA1=$(eval echo $CIRCLE_SHA1 | cut -c -7) + export BUILD_FILE_NAME=staking_deposit-cli-${CIRCLE_SHORT_SHA1}-darwin-amd64; + export TEST_FOLDER_NAME=TMP_TEST_FOLDER + mkdir ${TEST_FOLDER_NAME} + cp -r ${BUILD_FILE_NAME} ${TEST_FOLDER_NAME} + cp test_binary_script.py ${TEST_FOLDER_NAME} + cd ${TEST_FOLDER_NAME} + python3 test_binary_script.py ./${BUILD_FILE_NAME}; - run: name: Compress the file command: | + export PYTHONHASHSEED=42 export CIRCLE_SHORT_SHA1=$(eval echo $CIRCLE_SHA1 | cut -c -7) - export BUILD_FILE_NAME=eth2deposit-cli-${CIRCLE_SHORT_SHA1}-darwin-amd64; + export BUILD_FILE_NAME=staking_deposit-cli-${CIRCLE_SHORT_SHA1}-darwin-amd64; tar -zcvf ${BUILD_FILE_NAME}.tar.gz ./${BUILD_FILE_NAME}; mkdir /tmp/artifacts; cp ${BUILD_FILE_NAME}.tar.gz /tmp/artifacts; @@ -215,7 +299,8 @@ workflows: - win-py37-script build_linux: jobs: - - build-linux + - build-linux-amd64 + - build-linux-arm64 build_windows: jobs: - build-windows diff --git a/Dockerfile b/Dockerfile index 81e2b253..73039d74 100644 --- a/Dockerfile +++ b/Dockerfile @@ -4,7 +4,7 @@ WORKDIR /app COPY requirements.txt setup.py ./ -COPY eth2deposit ./eth2deposit +COPY staking_deposit ./staking_deposit RUN apk add --update gcc libc-dev linux-headers @@ -14,6 +14,6 @@ RUN python3 setup.py install ARG cli_command -ENTRYPOINT [ "python3", "./eth2deposit/deposit.py" ] +ENTRYPOINT [ "python3", "./staking_deposit/deposit.py" ] CMD [ $cli_command ] diff --git a/Makefile b/Makefile index a1e4ad8f..aa118b17 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ VENV_NAME?=venv VENV_ACTIVATE=. $(VENV_NAME)/bin/activate PYTHON=${VENV_NAME}/bin/python3.8 -DOCKER_IMAGE="ethereum/eth2.0-deposit-cli:latest" +DOCKER_IMAGE="ethereum/staking-deposit-cli:latest" help: @echo "clean - remove build and Python file artifacts" @@ -35,13 +35,13 @@ venv_build_test: venv_build ${VENV_NAME}/bin/python -m pip install -r requirements_test.txt venv_test: venv_build_test - $(VENV_ACTIVATE) && python -m pytest . + $(VENV_ACTIVATE) && python -m pytest ./tests venv_lint: venv_build_test - $(VENV_ACTIVATE) && flake8 --config=flake8.ini ./eth2deposit ./tests && mypy --config-file mypy.ini -p eth2deposit + $(VENV_ACTIVATE) && flake8 --config=flake8.ini ./staking_deposit ./tests && mypy --config-file mypy.ini -p staking_deposit venv_deposit: venv_build - $(VENV_ACTIVATE) && python ./eth2deposit/deposit.py $(filter-out $@,$(MAKECMDGOALS)) + $(VENV_ACTIVATE) && python ./staking_deposit/deposit.py $(filter-out $@,$(MAKECMDGOALS)) build_macos: venv_build ${VENV_NAME}/bin/python -m pip install -r ./build_configs/macos/requirements.txt diff --git a/README.md b/README.md index 40639994..45d732a2 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,17 @@ -# eth2.0-deposit-cli +# staking-deposit-cli - - [Introduction](#introduction) - [Tutorial for users](#tutorial-for-users) - [Build requirements](#build-requirements) - [For Linux or MacOS users](#for-linux-or-macos-users) + - [File Permissions](#file-permissions) - [Option 1. Download binary executable file](#option-1-download-binary-executable-file) - [Step 1. Installation](#step-1-installation) - [Step 2. Create keys and `deposit_data-*.json`](#step-2-create-keys-and-deposit_data-json) + - [language Argument](#language-argument) - [Commands](#commands) - [`new-mnemonic` Arguments](#new-mnemonic-arguments) - [`existing-mnemonic` Arguments](#existing-mnemonic-arguments) @@ -19,6 +20,7 @@ - [Step 0. Python version checking](#step-0-python-version-checking) - [Step 1. Installation](#step-1-installation-1) - [Step 2. Create keys and `deposit_data-*.json`](#step-2-create-keys-and-deposit_data-json-1) + - [Language Argument](#language-argument) - [Commands](#commands-1) - [Arguments](#arguments) - [Successful message](#successful-message-1) @@ -26,6 +28,7 @@ - [Step 0. Python version checking](#step-0-python-version-checking-1) - [Step 1. Installation](#step-1-installation-2) - [Step 2. Create keys and `deposit_data-*.json`](#step-2-create-keys-and-deposit_data-json-2) + - [Language Argument](#language-argument-1) - [Commands](#commands-2) - [Arguments](#arguments-1) - [Option 4. Use Docker image](#option-4-use-docker-image) @@ -37,30 +40,35 @@ - [Option 1. Download binary executable file](#option-1-download-binary-executable-file-1) - [Step 1. Installation](#step-1-installation-3) - [Step 2. Create keys and `deposit_data-*.json`](#step-2-create-keys-and-deposit_data-json-4) + - [Language Argument](#language-argument-2) - [Commands](#commands-3) - [Arguments](#arguments-3) - [Option 2. Build `deposit-cli` with native Python](#option-2-build-deposit-cli-with-native-python-1) - [Step 0. Python version checking](#step-0-python-version-checking-2) - [Step 1. Installation](#step-1-installation-4) - [Step 2. Create keys and `deposit_data-*.json`](#step-2-create-keys-and-deposit_data-json-5) + - [Language Argument](#language-argument-3) - [Commands](#commands-4) - [Arguments](#arguments-4) - [Option 3. Build `deposit-cli` with `virtualenv`](#option-3-build-deposit-cli-with-virtualenv-1) - [Step 0. Python version checking](#step-0-python-version-checking-3) - [Step 1. Installation](#step-1-installation-5) - [Step 2. Create keys and `deposit_data-*.json`](#step-2-create-keys-and-deposit_data-json-6) + - [Language Argument](#language-argument-4) - [Commands](#commands-5) - [Arguments](#arguments-5) - [Development](#development) - [Install basic requirements](#install-basic-requirements) - [Install testing requirements](#install-testing-requirements) - [Run tests](#run-tests) + - [Building Binaries](#building-binaries) + - [Mac M1 Binaries](#mac-m1-binaries) ## Introduction -`deposit-cli` is a tool for creating [EIP-2335 format](https://eips.ethereum.org/EIPS/eip-2335) BLS12-381 keystores and a corresponding `deposit_data*.json` file for [Ethereum 2.0 Launchpad](https://github.com/ethereum/eth2.0-deposit). +`deposit-cli` is a tool for creating [EIP-2335 format](https://eips.ethereum.org/EIPS/eip-2335) BLS12-381 keystores and a corresponding `deposit_data*.json` file for [Ethereum 2.0 Launchpad](https://github.com/ethereum/staking-launchpad). - **Warning: Please generate your keystores on your own safe, completely offline device.** - **Warning: Please backup your mnemonic, keystores, and password securely.** @@ -86,7 +94,7 @@ On Unix-based systems, keystores and the `deposit_data*.json` have `440`/`-r--r- ##### Step 1. Installation -See [releases page](https://github.com/ethereum/eth2.0-deposit-cli/releases) to download and decompress the corresponding binary files. +See [releases page](https://github.com/ethereum/staking-deposit-cli/releases) to download and decompress the corresponding binary files. ##### Step 2. Create keys and `deposit_data-*.json` @@ -102,6 +110,14 @@ or run the following command to enter the interactive CLI and generate keys from ./deposit existing-mnemonic ``` +###### language Argument + +The Launchpad offers many language/internationalization options. If you wish to select one as a CLI argument, it must be passed in before one of the commands is chosen. + +| Argument | Type | Description | +| -------- | -------- | -------- | +| `--language` | String. Options: `العربية`, `ελληνικά`, `English`, `Français`, `Bahasa melayu`, `Italiano`, `日本語`, `한국어`, `Português do Brasil`, `român`, `简体中文`. Default to `English` | The language you wish to use the CLI in. | + ###### Commands The CLI offers different commands depending on what you want to do with the tool. @@ -118,7 +134,7 @@ You can use `new-mnemonic --help` to see all arguments. Note that if there are m | Argument | Type | Description | | -------- | -------- | -------- | | `--num_validators` | Non-negative integer | The number of signing keys you want to generate. Note that the child key(s) are generated via the same master key. | -| `--mnemonic_language` | String. Options: `chinese_simplified`, `chinese_traditional`, `czech`, `english`, `italian`, `korean`, `portuguese`, `spanish`. Default to `english` | The mnemonic language | +| `--mnemonic_language` | String. Options: `简体中文`, `繁體中文`, `český jazyk`, `English`, `Italiano`, `한국어`, `Português`, `Español`. Default to `English` | The mnemonic language | | `--folder` | String. Pointing to `./validator_keys` by default | The folder path for the keystore(s) and deposit(s) | | `--chain` | String. `mainnet` by default | The chain setting for the signing domain. | | `--eth1_withdrawal_address` | String. Eth1 address in hexadecimal encoded form | If this field is set and valid, the given Eth1 address will be used to create the withdrawal credentials. Otherwise, it will generate withdrawal credentials with the mnemonic-derived withdrawal public key in [EIP-2334 format](https://eips.ethereum.org/EIPS/eip-2334#eth2-specific-parameters). | @@ -130,7 +146,7 @@ You can use `existing-mnemonic --help` to see all arguments. Note that if there | Argument | Type | Description | | -------- | -------- | -------- | | `--validator_start_index` | Non-negative integer | The index of the first validator's keys you wish to generate. If this is your first time generating keys with this mnemonic, use 0. If you have generated keys using this mnemonic before, use the next index from which you want to start generating keys from (eg, if you've generated 4 keys before (keys #0, #1, #2, #3), then enter 4 here.| -| `--num_validators` | Non-negative integer | The number of signing keys you want to generate. Note that the child key(s) are generated via the same master key. | +| `--num_validators` | Non-negative integer | The number of new signing keys you want to generate. Note that the child key(s) are generated via the same master key. | | `--folder` | String. Pointing to `./validator_keys` by default | The folder path for the keystore(s) and deposit(s) | | `--chain` | String. `mainnet` by default | The chain setting for the signing domain. | | `--eth1_withdrawal_address` | String. Eth1 address in hexadecimal encoded form | If this field is set and valid, the given Eth1 address will be used to create the withdrawal credentials. Otherwise, it will generate withdrawal credentials with the mnemonic-derived withdrawal public key in [EIP-2334 format](https://eips.ethereum.org/EIPS/eip-2334#eth2-specific-parameters). | @@ -199,6 +215,9 @@ You can also run the tool with optional arguments: ./deposit.sh existing-mnemonic --num_validators= --validator_start_index= --chain= --folder= ``` +###### Language Argument + +See [here](#language_argument) for `--language` arguments. ###### Commands See [here](#commands) @@ -243,25 +262,29 @@ pip3 install -r requirements.txt Run one of the following command to enter the interactive CLI: ```sh -python3 ./eth2deposit/deposit.py new-mnemonic +python3 ./staking_deposit/deposit.py new-mnemonic ``` or ```sh -python3 ./eth2deposit/deposit.py existing-mnemonic +python3 ./staking_deposit/deposit.py existing-mnemonic ``` You can also run the tool with optional arguments: ```sh -python3 ./eth2deposit/deposit.py new-mnemonic --num_validators= --mnemonic_language=english --chain= --folder= +python3 ./staking_deposit/deposit.py new-mnemonic --num_validators= --mnemonic_language=english --chain= --folder= ``` ```sh -python3 ./eth2deposit/deposit.py existing-mnemonic --num_validators= --validator_start_index= --chain= --folder= +python3 ./staking_deposit/deposit.py existing-mnemonic --num_validators= --validator_start_index= --chain= --folder= ``` +###### Language Argument + +See [here](#language_argument) for `--language` arguments. + ###### Commands See [here](#commands) @@ -286,19 +309,19 @@ make build_docker Run the following command to enter the interactive CLI: ```sh -docker run -it --rm -v $(pwd)/validator_keys:/app/validator_keys ethereum/eth2.0-deposit-cli +docker run -it --rm -v $(pwd)/validator_keys:/app/validator_keys ethereum/staking-deposit-cli ``` You can also run the tool with optional arguments: ```sh -docker run -it --rm -v $(pwd)/validator_keys:/app/validator_keys ethereum/eth2.0-deposit-cli new-mnemonic --num_validators= --mnemonic_language=english --folder= +docker run -it --rm -v $(pwd)/validator_keys:/app/validator_keys ethereum/staking-deposit-cli new-mnemonic --num_validators= --mnemonic_language=english --folder= ``` Example for 1 validator on the [Prater testnet](https://prater.launchpad.ethereum.org/) using english: ```sh -docker run -it --rm -v $(pwd)/validator_keys:/app/validator_keys ethereum/eth2.0-deposit-cli new-mnemonic --num_validators=1 --mnemonic_language=english --chain=prater +docker run -it --rm -v $(pwd)/validator_keys:/app/validator_keys ethereum/staking-deposit-cli new-mnemonic --num_validators=1 --mnemonic_language=english --chain=prater ``` ###### Arguments @@ -315,7 +338,7 @@ See [here](#successful-message) ##### Step 1. Installation -See [releases page](https://github.com/ethereum/eth2.0-deposit-cli/releases) to download and decompress the corresponding binary files. +See [releases page](https://github.com/ethereum/staking-deposit-cli/releases) to download and decompress the corresponding binary files. ##### Step 2. Create keys and `deposit_data-*.json` @@ -341,6 +364,10 @@ deposit.exe new-mnemonic --num_validators= --mnemonic_language=e deposit.exe existing-mnemonic --num_validators= --validator_start_index= --chain= --folder= ``` +###### Language Argument + +See [here](#language_argument) for `--language` arguments. + ###### Commands See [here](#commands) @@ -399,6 +426,10 @@ You can also run the tool with optional arguments: ./deposit.sh existing-mnemonic --num_validators= --validator_start_index= --chain= --folder= ``` +###### Language Argument + +See [here](#language_argument) for `--language` arguments. + ###### Commands See [here](#commands) @@ -440,25 +471,29 @@ pip3 install -r requirements.txt Run one of the following command to enter the interactive CLI: ```cmd -python .\eth2deposit\deposit.py new-mnemonic +python .\staking_deposit\deposit.py new-mnemonic ``` or ```cmd -python .\eth2deposit\deposit.py existing-mnemonic +python .\staking_deposit\deposit.py existing-mnemonic ``` You can also run the tool with optional arguments: ```cmd -python .\eth2deposit\deposit.py new-mnemonic --num_validators= --mnemonic_language=english --chain= --folder= +python .\staking_deposit\deposit.py new-mnemonic --num_validators= --mnemonic_language=english --chain= --folder= ``` ```cmd -python .\eth2deposit\deposit.pyexisting-mnemonic --num_validators= --validator_start_index= --chain= --folder= +python .\staking_deposit\deposit.pyexisting-mnemonic --num_validators= --validator_start_index= --chain= --folder= ``` +###### Language Argument + +See [here](#language_argument) for `--language` arguments. + ###### Commands See [here](#commands) @@ -488,3 +523,13 @@ python3 -m pip install -r requirements_test.txt ```sh python3 -m pytest . ``` + +### Building Binaries +**Developers Only** +##### Mac M1 Binaries + +👋This is not the section you are looking for.👋 +If you are trying to **build the binary** on macos with an M1 Mac and you are using pyenv to manage your python version. You'll probably need to reinstall a given python version using: +``` +env PYTHON_CONFIGURE_OPTS="--enable-framework" pyenv install 3.10.2 +``` \ No newline at end of file diff --git a/build_configs/linux/build.spec b/build_configs/linux/build.spec index aff6396f..2b2b3643 100644 --- a/build_configs/linux/build.spec +++ b/build_configs/linux/build.spec @@ -3,13 +3,16 @@ block_cipher = None -a = Analysis(['../../eth2deposit/deposit.py'], +a = Analysis(['../../staking_deposit/deposit.py'], binaries=[], - datas=[('../../eth2deposit/key_handling/key_derivation/word_lists/*.txt', './eth2deposit/key_handling/key_derivation/word_lists/')], + datas=[ + ('../../staking_deposit/key_handling/key_derivation/word_lists/*.txt', './staking_deposit/key_handling/key_derivation/word_lists/'), + ('../../staking_deposit/intl', './staking_deposit/intl'), + ], hiddenimports=[], hookspath=[], runtime_hooks=[], - excludes=[], + excludes=['FixTk', 'tcl', 'tk', '_tkinter', 'tkinter', 'Tkinter'], win_no_prefer_redirects=False, win_private_assemblies=False, cipher=block_cipher, diff --git a/build_configs/linux/requirements.txt b/build_configs/linux/requirements.txt index d00dd0d3..28b6bb3c 100644 --- a/build_configs/linux/requirements.txt +++ b/build_configs/linux/requirements.txt @@ -2,40 +2,72 @@ -r ../../requirements.txt # Build tools for binary distribution -PyInstaller==3.6 \ - --hash=sha256:3730fa80d088f8bb7084d32480eb87cbb4ddb64123363763cf8f2a1378c1c4b7 +pyinstaller==4.8 \ + --hash=sha256:15d9266d78dc757c103962826e62bce1513825078160be580534ead2ef53087c \ + --hash=sha256:44783d58ac4cb0a74a4f2180da4dacbe6a7a013a62b3aa10be6082252e296954 \ + --hash=sha256:4c848720a65a5bd41249bc804d1bd3dd089bb56aef7f1c5e11f774f11e649443 \ + --hash=sha256:53ed05214dd67624756fe4e82e861857921a79d0392debf8c9f5bb0ba5a479b6 \ + --hash=sha256:5c2fd5f18c0397f3d9160446035556afc7f6446fd88048887fdf46eadf85c5ec \ + --hash=sha256:6f5cdc39fbdec7b2e0c46cc0f5bd0071bb85e592e324bf4e15375c5ff19e55fc \ + --hash=sha256:7ae868bbcc502832a2c802c84a1dbb9f48b44445c50144c29bfcd7b760140e13 \ + --hash=sha256:9fbb05f5f67862005234da8c7eac69ef87e086f90e345749260051b031774c52 \ + --hash=sha256:b0b3a31aa60292469f9595f298e2c147cba29c30edcd92a38fdce27727809625 \ + --hash=sha256:b720853a00bd9547b7d6403d85f23b7f7e451e41bc907673d9fc7f8d9d274594 \ + --hash=sha256:f00e1296abac71f3b5bb9fdc2e0d4c079201d62faeeeb894ccadd0616179fee3 setuptools==49.2.0 \ --hash=sha256:272c7f48f5cddc5af5901f4265274c421c7eede5c8bc454ac2903d3f8fc365e9 \ --hash=sha256:afe9e81fee0270d3f60d52608549cc8ec4c46dada8c95640c1a00160f577acf2 -cffi==1.14.0 \ - --hash=sha256:001bf3242a1bb04d985d63e138230802c6c8d4db3668fb545fb5005ddf5bb5ff \ - --hash=sha256:00789914be39dffba161cfc5be31b55775de5ba2235fe49aa28c148236c4e06b \ - --hash=sha256:028a579fc9aed3af38f4892bdcc7390508adabc30c6af4a6e4f611b0c680e6ac \ - --hash=sha256:14491a910663bf9f13ddf2bc8f60562d6bc5315c1f09c704937ef17293fb85b0 \ - --hash=sha256:1cae98a7054b5c9391eb3249b86e0e99ab1e02bb0cc0575da191aedadbdf4384 \ - --hash=sha256:2089ed025da3919d2e75a4d963d008330c96751127dd6f73c8dc0c65041b4c26 \ - --hash=sha256:2d384f4a127a15ba701207f7639d94106693b6cd64173d6c8988e2c25f3ac2b6 \ - --hash=sha256:337d448e5a725bba2d8293c48d9353fc68d0e9e4088d62a9571def317797522b \ - --hash=sha256:399aed636c7d3749bbed55bc907c3288cb43c65c4389964ad5ff849b6370603e \ - --hash=sha256:3b911c2dbd4f423b4c4fcca138cadde747abdb20d196c4a48708b8a2d32b16dd \ - --hash=sha256:3d311bcc4a41408cf5854f06ef2c5cab88f9fded37a3b95936c9879c1640d4c2 \ - --hash=sha256:62ae9af2d069ea2698bf536dcfe1e4eed9090211dbaafeeedf5cb6c41b352f66 \ - --hash=sha256:66e41db66b47d0d8672d8ed2708ba91b2f2524ece3dee48b5dfb36be8c2f21dc \ - --hash=sha256:675686925a9fb403edba0114db74e741d8181683dcf216be697d208857e04ca8 \ - --hash=sha256:7e63cbcf2429a8dbfe48dcc2322d5f2220b77b2e17b7ba023d6166d84655da55 \ - --hash=sha256:8a6c688fefb4e1cd56feb6c511984a6c4f7ec7d2a1ff31a10254f3c817054ae4 \ - --hash=sha256:8c0ffc886aea5df6a1762d0019e9cb05f825d0eec1f520c51be9d198701daee5 \ - --hash=sha256:95cd16d3dee553f882540c1ffe331d085c9e629499ceadfbda4d4fde635f4b7d \ - --hash=sha256:99f748a7e71ff382613b4e1acc0ac83bf7ad167fb3802e35e90d9763daba4d78 \ - --hash=sha256:b8c78301cefcf5fd914aad35d3c04c2b21ce8629b5e4f4e45ae6812e461910fa \ - --hash=sha256:c420917b188a5582a56d8b93bdd8e0f6eca08c84ff623a4c16e809152cd35793 \ - --hash=sha256:c43866529f2f06fe0edc6246eb4faa34f03fe88b64a0a9a942561c8e22f4b71f \ - --hash=sha256:cab50b8c2250b46fe738c77dbd25ce017d5e6fb35d3407606e7a4180656a5a6a \ - --hash=sha256:cef128cb4d5e0b3493f058f10ce32365972c554572ff821e175dbc6f8ff6924f \ - --hash=sha256:cf16e3cf6c0a5fdd9bc10c21687e19d29ad1fe863372b5543deaec1039581a30 \ - --hash=sha256:e56c744aa6ff427a607763346e4170629caf7e48ead6921745986db3692f987f \ - --hash=sha256:e577934fc5f8779c554639376beeaa5657d54349096ef24abe8c74c5d9c117c3 \ - --hash=sha256:f2b0fa0c01d8a0c7483afd9f31d7ecf2d71760ca24499c8697aeb5ca37dc090c +cffi==1.15.0 \ + --hash=sha256:00c878c90cb53ccfaae6b8bc18ad05d2036553e6d9d1d9dbcf323bbe83854ca3 \ + --hash=sha256:0104fb5ae2391d46a4cb082abdd5c69ea4eab79d8d44eaaf79f1b1fd806ee4c2 \ + --hash=sha256:06c48159c1abed75c2e721b1715c379fa3200c7784271b3c46df01383b593636 \ + --hash=sha256:0808014eb713677ec1292301ea4c81ad277b6cdf2fdd90fd540af98c0b101d20 \ + --hash=sha256:10dffb601ccfb65262a27233ac273d552ddc4d8ae1bf93b21c94b8511bffe728 \ + --hash=sha256:14cd121ea63ecdae71efa69c15c5543a4b5fbcd0bbe2aad864baca0063cecf27 \ + --hash=sha256:17771976e82e9f94976180f76468546834d22a7cc404b17c22df2a2c81db0c66 \ + --hash=sha256:181dee03b1170ff1969489acf1c26533710231c58f95534e3edac87fff06c443 \ + --hash=sha256:23cfe892bd5dd8941608f93348c0737e369e51c100d03718f108bf1add7bd6d0 \ + --hash=sha256:263cc3d821c4ab2213cbe8cd8b355a7f72a8324577dc865ef98487c1aeee2bc7 \ + --hash=sha256:2756c88cbb94231c7a147402476be2c4df2f6078099a6f4a480d239a8817ae39 \ + --hash=sha256:27c219baf94952ae9d50ec19651a687b826792055353d07648a5695413e0c605 \ + --hash=sha256:2a23af14f408d53d5e6cd4e3d9a24ff9e05906ad574822a10563efcef137979a \ + --hash=sha256:31fb708d9d7c3f49a60f04cf5b119aeefe5644daba1cd2a0fe389b674fd1de37 \ + --hash=sha256:3415c89f9204ee60cd09b235810be700e993e343a408693e80ce7f6a40108029 \ + --hash=sha256:3773c4d81e6e818df2efbc7dd77325ca0dcb688116050fb2b3011218eda36139 \ + --hash=sha256:3b96a311ac60a3f6be21d2572e46ce67f09abcf4d09344c49274eb9e0bf345fc \ + --hash=sha256:3f7d084648d77af029acb79a0ff49a0ad7e9d09057a9bf46596dac9514dc07df \ + --hash=sha256:41d45de54cd277a7878919867c0f08b0cf817605e4eb94093e7516505d3c8d14 \ + --hash=sha256:4238e6dab5d6a8ba812de994bbb0a79bddbdf80994e4ce802b6f6f3142fcc880 \ + --hash=sha256:45db3a33139e9c8f7c09234b5784a5e33d31fd6907800b316decad50af323ff2 \ + --hash=sha256:45e8636704eacc432a206ac7345a5d3d2c62d95a507ec70d62f23cd91770482a \ + --hash=sha256:4958391dbd6249d7ad855b9ca88fae690783a6be9e86df65865058ed81fc860e \ + --hash=sha256:4a306fa632e8f0928956a41fa8e1d6243c71e7eb59ffbd165fc0b41e316b2474 \ + --hash=sha256:57e9ac9ccc3101fac9d6014fba037473e4358ef4e89f8e181f8951a2c0162024 \ + --hash=sha256:59888172256cac5629e60e72e86598027aca6bf01fa2465bdb676d37636573e8 \ + --hash=sha256:5e069f72d497312b24fcc02073d70cb989045d1c91cbd53979366077959933e0 \ + --hash=sha256:64d4ec9f448dfe041705426000cc13e34e6e5bb13736e9fd62e34a0b0c41566e \ + --hash=sha256:6dc2737a3674b3e344847c8686cf29e500584ccad76204efea14f451d4cc669a \ + --hash=sha256:74fdfdbfdc48d3f47148976f49fab3251e550a8720bebc99bf1483f5bfb5db3e \ + --hash=sha256:75e4024375654472cc27e91cbe9eaa08567f7fbdf822638be2814ce059f58032 \ + --hash=sha256:786902fb9ba7433aae840e0ed609f45c7bcd4e225ebb9c753aa39725bb3e6ad6 \ + --hash=sha256:8b6c2ea03845c9f501ed1313e78de148cd3f6cad741a75d43a29b43da27f2e1e \ + --hash=sha256:91d77d2a782be4274da750752bb1650a97bfd8f291022b379bb8e01c66b4e96b \ + --hash=sha256:91ec59c33514b7c7559a6acda53bbfe1b283949c34fe7440bcf917f96ac0723e \ + --hash=sha256:920f0d66a896c2d99f0adbb391f990a84091179542c205fa53ce5787aff87954 \ + --hash=sha256:a5263e363c27b653a90078143adb3d076c1a748ec9ecc78ea2fb916f9b861962 \ + --hash=sha256:abb9a20a72ac4e0fdb50dae135ba5e77880518e742077ced47eb1499e29a443c \ + --hash=sha256:c2051981a968d7de9dd2d7b87bcb9c939c74a34626a6e2f8181455dd49ed69e4 \ + --hash=sha256:c21c9e3896c23007803a875460fb786118f0cdd4434359577ea25eb556e34c55 \ + --hash=sha256:c2502a1a03b6312837279c8c1bd3ebedf6c12c4228ddbad40912d671ccc8a962 \ + --hash=sha256:d4d692a89c5cf08a8557fdeb329b82e7bf609aadfaed6c0d79f5a449a3c7c023 \ + --hash=sha256:da5db4e883f1ce37f55c667e5c0de439df76ac4cb55964655906306918e7363c \ + --hash=sha256:e7022a66d9b55e93e1a845d8c9eba2a1bebd4966cd8bfc25d9cd07d515b33fa6 \ + --hash=sha256:ef1f279350da2c586a69d32fc8733092fd32cc8ac95139a00377841f59a3f8d8 \ + --hash=sha256:f54a64f8b0c8ff0b64d18aa76675262e1700f3995182267998c31ae974fbc382 \ + --hash=sha256:f5c7150ad32ba43a07c4479f40241756145a1f03b43480e058cfd862bf5041c7 \ + --hash=sha256:f6f824dc3bce0edab5f427efcfb1d63ee75b6fcb7282900ccaf925be84efb0fc \ + --hash=sha256:fd8a250edc26254fe5b33be00402e6d287f562b6a5b2152dec302fa15bb3e997 \ + --hash=sha256:ffaa5c925128e29efbde7301d8ecaf35c8c60ffbcd6a1ffd3a552177c8e5e796 pycparser==2.20 \ --hash=sha256:2d475327684562c3a96cc71adf7dc8c4f0565175cf86b6d7a404ff4c771f15f0 \ --hash=sha256:7582ad22678f0fcd81102833f60ef8d0e57288b6b5fb00323d101be910e35705 @@ -45,3 +77,16 @@ altgraph==0.17 \ macholib==1.14 \ --hash=sha256:0c436bc847e7b1d9bda0560351bf76d7caf930fb585a828d13608839ef42c432 \ --hash=sha256:c500f02867515e6c60a27875b408920d18332ddf96b4035ef03beddd782d4281 +pyinstaller-hooks-contrib==2022.0 \ + --hash=sha256:29f0bd8fbb2ff6f2df60a0c147e5b5ad65ae5c1a982d90641a5f712de03fa161 \ + --hash=sha256:61b667f51b2525377fae30793f38fd9752a08032c72b209effabf707c840cc38 +importlib-metadata==3.10.0 \ + --hash=sha256:c9db46394197244adf2f0b08ec5bc3cf16757e9590b02af1fca085c16c0d600a \ + --hash=sha256:d2d46ef77ffc85cbf7dac7e81dd663fde71c45326131bea8033b9bad42268ebe +zipp==3.4.1 \ + --hash=sha256:3607921face881ba3e026887d8150cca609d517579abe052ac81fc5aeffdbd76 \ + --hash=sha256:51cb66cc54621609dd593d1787f286ee42a5c0adbb4b29abea5a63edc3e03098 +typing-extensions==3.7.4.3 \ + --hash=sha256:7cb407020f00f7bfc3cb3e7881628838e69d8f3fcab2f64742a5e76b2f841918 \ + --hash=sha256:99d4073b617d30288f569d3f13d2bd7548c3a7e4c8de87db09a9d29bb3a4a60c \ + --hash=sha256:dafc7639cde7f1b6e1acc0f457842a83e722ccca8eef5270af2d74792619a89f diff --git a/build_configs/macos/build.spec b/build_configs/macos/build.spec index bd82fe84..aad4b18a 100644 --- a/build_configs/macos/build.spec +++ b/build_configs/macos/build.spec @@ -3,13 +3,16 @@ block_cipher = None -a = Analysis(['../../eth2deposit/deposit.py'], - binaries=[('/System/Library/Frameworks/Tk.framework/Tk', 'tk'), ('/System/Library/Frameworks/Tcl.framework/Tcl', 'tcl')], - datas=[('../../eth2deposit/key_handling/key_derivation/word_lists/*.txt', './eth2deposit/key_handling/key_derivation/word_lists/')], +a = Analysis(['../../staking_deposit/deposit.py'], + binaries=None, + datas=[ + ('../../staking_deposit/key_handling/key_derivation/word_lists/*.txt', './staking_deposit/key_handling/key_derivation/word_lists/'), + ('../../staking_deposit/intl', './staking_deposit/intl'), + ], hiddenimports=[], hookspath=[], runtime_hooks=[], - excludes=[], + excludes=['FixTk', 'tcl', 'tk', '_tkinter', 'tkinter', 'Tkinter'], win_no_prefer_redirects=False, win_private_assemblies=False, cipher=block_cipher, diff --git a/build_configs/macos/requirements.txt b/build_configs/macos/requirements.txt index d00dd0d3..28b6bb3c 100644 --- a/build_configs/macos/requirements.txt +++ b/build_configs/macos/requirements.txt @@ -2,40 +2,72 @@ -r ../../requirements.txt # Build tools for binary distribution -PyInstaller==3.6 \ - --hash=sha256:3730fa80d088f8bb7084d32480eb87cbb4ddb64123363763cf8f2a1378c1c4b7 +pyinstaller==4.8 \ + --hash=sha256:15d9266d78dc757c103962826e62bce1513825078160be580534ead2ef53087c \ + --hash=sha256:44783d58ac4cb0a74a4f2180da4dacbe6a7a013a62b3aa10be6082252e296954 \ + --hash=sha256:4c848720a65a5bd41249bc804d1bd3dd089bb56aef7f1c5e11f774f11e649443 \ + --hash=sha256:53ed05214dd67624756fe4e82e861857921a79d0392debf8c9f5bb0ba5a479b6 \ + --hash=sha256:5c2fd5f18c0397f3d9160446035556afc7f6446fd88048887fdf46eadf85c5ec \ + --hash=sha256:6f5cdc39fbdec7b2e0c46cc0f5bd0071bb85e592e324bf4e15375c5ff19e55fc \ + --hash=sha256:7ae868bbcc502832a2c802c84a1dbb9f48b44445c50144c29bfcd7b760140e13 \ + --hash=sha256:9fbb05f5f67862005234da8c7eac69ef87e086f90e345749260051b031774c52 \ + --hash=sha256:b0b3a31aa60292469f9595f298e2c147cba29c30edcd92a38fdce27727809625 \ + --hash=sha256:b720853a00bd9547b7d6403d85f23b7f7e451e41bc907673d9fc7f8d9d274594 \ + --hash=sha256:f00e1296abac71f3b5bb9fdc2e0d4c079201d62faeeeb894ccadd0616179fee3 setuptools==49.2.0 \ --hash=sha256:272c7f48f5cddc5af5901f4265274c421c7eede5c8bc454ac2903d3f8fc365e9 \ --hash=sha256:afe9e81fee0270d3f60d52608549cc8ec4c46dada8c95640c1a00160f577acf2 -cffi==1.14.0 \ - --hash=sha256:001bf3242a1bb04d985d63e138230802c6c8d4db3668fb545fb5005ddf5bb5ff \ - --hash=sha256:00789914be39dffba161cfc5be31b55775de5ba2235fe49aa28c148236c4e06b \ - --hash=sha256:028a579fc9aed3af38f4892bdcc7390508adabc30c6af4a6e4f611b0c680e6ac \ - --hash=sha256:14491a910663bf9f13ddf2bc8f60562d6bc5315c1f09c704937ef17293fb85b0 \ - --hash=sha256:1cae98a7054b5c9391eb3249b86e0e99ab1e02bb0cc0575da191aedadbdf4384 \ - --hash=sha256:2089ed025da3919d2e75a4d963d008330c96751127dd6f73c8dc0c65041b4c26 \ - --hash=sha256:2d384f4a127a15ba701207f7639d94106693b6cd64173d6c8988e2c25f3ac2b6 \ - --hash=sha256:337d448e5a725bba2d8293c48d9353fc68d0e9e4088d62a9571def317797522b \ - --hash=sha256:399aed636c7d3749bbed55bc907c3288cb43c65c4389964ad5ff849b6370603e \ - --hash=sha256:3b911c2dbd4f423b4c4fcca138cadde747abdb20d196c4a48708b8a2d32b16dd \ - --hash=sha256:3d311bcc4a41408cf5854f06ef2c5cab88f9fded37a3b95936c9879c1640d4c2 \ - --hash=sha256:62ae9af2d069ea2698bf536dcfe1e4eed9090211dbaafeeedf5cb6c41b352f66 \ - --hash=sha256:66e41db66b47d0d8672d8ed2708ba91b2f2524ece3dee48b5dfb36be8c2f21dc \ - --hash=sha256:675686925a9fb403edba0114db74e741d8181683dcf216be697d208857e04ca8 \ - --hash=sha256:7e63cbcf2429a8dbfe48dcc2322d5f2220b77b2e17b7ba023d6166d84655da55 \ - --hash=sha256:8a6c688fefb4e1cd56feb6c511984a6c4f7ec7d2a1ff31a10254f3c817054ae4 \ - --hash=sha256:8c0ffc886aea5df6a1762d0019e9cb05f825d0eec1f520c51be9d198701daee5 \ - --hash=sha256:95cd16d3dee553f882540c1ffe331d085c9e629499ceadfbda4d4fde635f4b7d \ - --hash=sha256:99f748a7e71ff382613b4e1acc0ac83bf7ad167fb3802e35e90d9763daba4d78 \ - --hash=sha256:b8c78301cefcf5fd914aad35d3c04c2b21ce8629b5e4f4e45ae6812e461910fa \ - --hash=sha256:c420917b188a5582a56d8b93bdd8e0f6eca08c84ff623a4c16e809152cd35793 \ - --hash=sha256:c43866529f2f06fe0edc6246eb4faa34f03fe88b64a0a9a942561c8e22f4b71f \ - --hash=sha256:cab50b8c2250b46fe738c77dbd25ce017d5e6fb35d3407606e7a4180656a5a6a \ - --hash=sha256:cef128cb4d5e0b3493f058f10ce32365972c554572ff821e175dbc6f8ff6924f \ - --hash=sha256:cf16e3cf6c0a5fdd9bc10c21687e19d29ad1fe863372b5543deaec1039581a30 \ - --hash=sha256:e56c744aa6ff427a607763346e4170629caf7e48ead6921745986db3692f987f \ - --hash=sha256:e577934fc5f8779c554639376beeaa5657d54349096ef24abe8c74c5d9c117c3 \ - --hash=sha256:f2b0fa0c01d8a0c7483afd9f31d7ecf2d71760ca24499c8697aeb5ca37dc090c +cffi==1.15.0 \ + --hash=sha256:00c878c90cb53ccfaae6b8bc18ad05d2036553e6d9d1d9dbcf323bbe83854ca3 \ + --hash=sha256:0104fb5ae2391d46a4cb082abdd5c69ea4eab79d8d44eaaf79f1b1fd806ee4c2 \ + --hash=sha256:06c48159c1abed75c2e721b1715c379fa3200c7784271b3c46df01383b593636 \ + --hash=sha256:0808014eb713677ec1292301ea4c81ad277b6cdf2fdd90fd540af98c0b101d20 \ + --hash=sha256:10dffb601ccfb65262a27233ac273d552ddc4d8ae1bf93b21c94b8511bffe728 \ + --hash=sha256:14cd121ea63ecdae71efa69c15c5543a4b5fbcd0bbe2aad864baca0063cecf27 \ + --hash=sha256:17771976e82e9f94976180f76468546834d22a7cc404b17c22df2a2c81db0c66 \ + --hash=sha256:181dee03b1170ff1969489acf1c26533710231c58f95534e3edac87fff06c443 \ + --hash=sha256:23cfe892bd5dd8941608f93348c0737e369e51c100d03718f108bf1add7bd6d0 \ + --hash=sha256:263cc3d821c4ab2213cbe8cd8b355a7f72a8324577dc865ef98487c1aeee2bc7 \ + --hash=sha256:2756c88cbb94231c7a147402476be2c4df2f6078099a6f4a480d239a8817ae39 \ + --hash=sha256:27c219baf94952ae9d50ec19651a687b826792055353d07648a5695413e0c605 \ + --hash=sha256:2a23af14f408d53d5e6cd4e3d9a24ff9e05906ad574822a10563efcef137979a \ + --hash=sha256:31fb708d9d7c3f49a60f04cf5b119aeefe5644daba1cd2a0fe389b674fd1de37 \ + --hash=sha256:3415c89f9204ee60cd09b235810be700e993e343a408693e80ce7f6a40108029 \ + --hash=sha256:3773c4d81e6e818df2efbc7dd77325ca0dcb688116050fb2b3011218eda36139 \ + --hash=sha256:3b96a311ac60a3f6be21d2572e46ce67f09abcf4d09344c49274eb9e0bf345fc \ + --hash=sha256:3f7d084648d77af029acb79a0ff49a0ad7e9d09057a9bf46596dac9514dc07df \ + --hash=sha256:41d45de54cd277a7878919867c0f08b0cf817605e4eb94093e7516505d3c8d14 \ + --hash=sha256:4238e6dab5d6a8ba812de994bbb0a79bddbdf80994e4ce802b6f6f3142fcc880 \ + --hash=sha256:45db3a33139e9c8f7c09234b5784a5e33d31fd6907800b316decad50af323ff2 \ + --hash=sha256:45e8636704eacc432a206ac7345a5d3d2c62d95a507ec70d62f23cd91770482a \ + --hash=sha256:4958391dbd6249d7ad855b9ca88fae690783a6be9e86df65865058ed81fc860e \ + --hash=sha256:4a306fa632e8f0928956a41fa8e1d6243c71e7eb59ffbd165fc0b41e316b2474 \ + --hash=sha256:57e9ac9ccc3101fac9d6014fba037473e4358ef4e89f8e181f8951a2c0162024 \ + --hash=sha256:59888172256cac5629e60e72e86598027aca6bf01fa2465bdb676d37636573e8 \ + --hash=sha256:5e069f72d497312b24fcc02073d70cb989045d1c91cbd53979366077959933e0 \ + --hash=sha256:64d4ec9f448dfe041705426000cc13e34e6e5bb13736e9fd62e34a0b0c41566e \ + --hash=sha256:6dc2737a3674b3e344847c8686cf29e500584ccad76204efea14f451d4cc669a \ + --hash=sha256:74fdfdbfdc48d3f47148976f49fab3251e550a8720bebc99bf1483f5bfb5db3e \ + --hash=sha256:75e4024375654472cc27e91cbe9eaa08567f7fbdf822638be2814ce059f58032 \ + --hash=sha256:786902fb9ba7433aae840e0ed609f45c7bcd4e225ebb9c753aa39725bb3e6ad6 \ + --hash=sha256:8b6c2ea03845c9f501ed1313e78de148cd3f6cad741a75d43a29b43da27f2e1e \ + --hash=sha256:91d77d2a782be4274da750752bb1650a97bfd8f291022b379bb8e01c66b4e96b \ + --hash=sha256:91ec59c33514b7c7559a6acda53bbfe1b283949c34fe7440bcf917f96ac0723e \ + --hash=sha256:920f0d66a896c2d99f0adbb391f990a84091179542c205fa53ce5787aff87954 \ + --hash=sha256:a5263e363c27b653a90078143adb3d076c1a748ec9ecc78ea2fb916f9b861962 \ + --hash=sha256:abb9a20a72ac4e0fdb50dae135ba5e77880518e742077ced47eb1499e29a443c \ + --hash=sha256:c2051981a968d7de9dd2d7b87bcb9c939c74a34626a6e2f8181455dd49ed69e4 \ + --hash=sha256:c21c9e3896c23007803a875460fb786118f0cdd4434359577ea25eb556e34c55 \ + --hash=sha256:c2502a1a03b6312837279c8c1bd3ebedf6c12c4228ddbad40912d671ccc8a962 \ + --hash=sha256:d4d692a89c5cf08a8557fdeb329b82e7bf609aadfaed6c0d79f5a449a3c7c023 \ + --hash=sha256:da5db4e883f1ce37f55c667e5c0de439df76ac4cb55964655906306918e7363c \ + --hash=sha256:e7022a66d9b55e93e1a845d8c9eba2a1bebd4966cd8bfc25d9cd07d515b33fa6 \ + --hash=sha256:ef1f279350da2c586a69d32fc8733092fd32cc8ac95139a00377841f59a3f8d8 \ + --hash=sha256:f54a64f8b0c8ff0b64d18aa76675262e1700f3995182267998c31ae974fbc382 \ + --hash=sha256:f5c7150ad32ba43a07c4479f40241756145a1f03b43480e058cfd862bf5041c7 \ + --hash=sha256:f6f824dc3bce0edab5f427efcfb1d63ee75b6fcb7282900ccaf925be84efb0fc \ + --hash=sha256:fd8a250edc26254fe5b33be00402e6d287f562b6a5b2152dec302fa15bb3e997 \ + --hash=sha256:ffaa5c925128e29efbde7301d8ecaf35c8c60ffbcd6a1ffd3a552177c8e5e796 pycparser==2.20 \ --hash=sha256:2d475327684562c3a96cc71adf7dc8c4f0565175cf86b6d7a404ff4c771f15f0 \ --hash=sha256:7582ad22678f0fcd81102833f60ef8d0e57288b6b5fb00323d101be910e35705 @@ -45,3 +77,16 @@ altgraph==0.17 \ macholib==1.14 \ --hash=sha256:0c436bc847e7b1d9bda0560351bf76d7caf930fb585a828d13608839ef42c432 \ --hash=sha256:c500f02867515e6c60a27875b408920d18332ddf96b4035ef03beddd782d4281 +pyinstaller-hooks-contrib==2022.0 \ + --hash=sha256:29f0bd8fbb2ff6f2df60a0c147e5b5ad65ae5c1a982d90641a5f712de03fa161 \ + --hash=sha256:61b667f51b2525377fae30793f38fd9752a08032c72b209effabf707c840cc38 +importlib-metadata==3.10.0 \ + --hash=sha256:c9db46394197244adf2f0b08ec5bc3cf16757e9590b02af1fca085c16c0d600a \ + --hash=sha256:d2d46ef77ffc85cbf7dac7e81dd663fde71c45326131bea8033b9bad42268ebe +zipp==3.4.1 \ + --hash=sha256:3607921face881ba3e026887d8150cca609d517579abe052ac81fc5aeffdbd76 \ + --hash=sha256:51cb66cc54621609dd593d1787f286ee42a5c0adbb4b29abea5a63edc3e03098 +typing-extensions==3.7.4.3 \ + --hash=sha256:7cb407020f00f7bfc3cb3e7881628838e69d8f3fcab2f64742a5e76b2f841918 \ + --hash=sha256:99d4073b617d30288f569d3f13d2bd7548c3a7e4c8de87db09a9d29bb3a4a60c \ + --hash=sha256:dafc7639cde7f1b6e1acc0f457842a83e722ccca8eef5270af2d74792619a89f diff --git a/build_configs/windows/build.spec b/build_configs/windows/build.spec index 48725a5a..586f0de8 100644 --- a/build_configs/windows/build.spec +++ b/build_configs/windows/build.spec @@ -3,13 +3,16 @@ block_cipher = None -a = Analysis(['..\\..\\eth2deposit\\deposit.py'], +a = Analysis(['..\\..\\staking_deposit\\deposit.py'], binaries=[], - datas=[('..\\..\\eth2deposit\\key_handling\\key_derivation\\word_lists\\*.txt', '.\\eth2deposit\\key_handling\\key_derivation\\word_lists')], + datas=[ + ('..\\..\\staking_deposit\\key_handling\\key_derivation\\word_lists\\*.txt', '.\\staking_deposit\\key_handling\\key_derivation\\word_lists'), + ('..\\..\\staking_deposit\\intl', '.\\staking_deposit\\intl'), + ], hiddenimports=[], hookspath=[], runtime_hooks=[], - excludes=[], + excludes=['FixTk', 'tcl', 'tk', '_tkinter', 'tkinter', 'Tkinter'], win_no_prefer_redirects=False, win_private_assemblies=False, cipher=block_cipher, diff --git a/build_configs/windows/requirements.txt b/build_configs/windows/requirements.txt index c5528544..5b04b2ce 100644 --- a/build_configs/windows/requirements.txt +++ b/build_configs/windows/requirements.txt @@ -2,40 +2,72 @@ -r ../../requirements.txt # Build tools for binary distribution -PyInstaller==3.6 \ - --hash=sha256:3730fa80d088f8bb7084d32480eb87cbb4ddb64123363763cf8f2a1378c1c4b7 +pyinstaller==4.8 \ + --hash=sha256:15d9266d78dc757c103962826e62bce1513825078160be580534ead2ef53087c \ + --hash=sha256:44783d58ac4cb0a74a4f2180da4dacbe6a7a013a62b3aa10be6082252e296954 \ + --hash=sha256:4c848720a65a5bd41249bc804d1bd3dd089bb56aef7f1c5e11f774f11e649443 \ + --hash=sha256:53ed05214dd67624756fe4e82e861857921a79d0392debf8c9f5bb0ba5a479b6 \ + --hash=sha256:5c2fd5f18c0397f3d9160446035556afc7f6446fd88048887fdf46eadf85c5ec \ + --hash=sha256:6f5cdc39fbdec7b2e0c46cc0f5bd0071bb85e592e324bf4e15375c5ff19e55fc \ + --hash=sha256:7ae868bbcc502832a2c802c84a1dbb9f48b44445c50144c29bfcd7b760140e13 \ + --hash=sha256:9fbb05f5f67862005234da8c7eac69ef87e086f90e345749260051b031774c52 \ + --hash=sha256:b0b3a31aa60292469f9595f298e2c147cba29c30edcd92a38fdce27727809625 \ + --hash=sha256:b720853a00bd9547b7d6403d85f23b7f7e451e41bc907673d9fc7f8d9d274594 \ + --hash=sha256:f00e1296abac71f3b5bb9fdc2e0d4c079201d62faeeeb894ccadd0616179fee3 setuptools==49.2.0 \ --hash=sha256:272c7f48f5cddc5af5901f4265274c421c7eede5c8bc454ac2903d3f8fc365e9 \ --hash=sha256:afe9e81fee0270d3f60d52608549cc8ec4c46dada8c95640c1a00160f577acf2 -cffi==1.14.0 \ - --hash=sha256:001bf3242a1bb04d985d63e138230802c6c8d4db3668fb545fb5005ddf5bb5ff \ - --hash=sha256:00789914be39dffba161cfc5be31b55775de5ba2235fe49aa28c148236c4e06b \ - --hash=sha256:028a579fc9aed3af38f4892bdcc7390508adabc30c6af4a6e4f611b0c680e6ac \ - --hash=sha256:14491a910663bf9f13ddf2bc8f60562d6bc5315c1f09c704937ef17293fb85b0 \ - --hash=sha256:1cae98a7054b5c9391eb3249b86e0e99ab1e02bb0cc0575da191aedadbdf4384 \ - --hash=sha256:2089ed025da3919d2e75a4d963d008330c96751127dd6f73c8dc0c65041b4c26 \ - --hash=sha256:2d384f4a127a15ba701207f7639d94106693b6cd64173d6c8988e2c25f3ac2b6 \ - --hash=sha256:337d448e5a725bba2d8293c48d9353fc68d0e9e4088d62a9571def317797522b \ - --hash=sha256:399aed636c7d3749bbed55bc907c3288cb43c65c4389964ad5ff849b6370603e \ - --hash=sha256:3b911c2dbd4f423b4c4fcca138cadde747abdb20d196c4a48708b8a2d32b16dd \ - --hash=sha256:3d311bcc4a41408cf5854f06ef2c5cab88f9fded37a3b95936c9879c1640d4c2 \ - --hash=sha256:62ae9af2d069ea2698bf536dcfe1e4eed9090211dbaafeeedf5cb6c41b352f66 \ - --hash=sha256:66e41db66b47d0d8672d8ed2708ba91b2f2524ece3dee48b5dfb36be8c2f21dc \ - --hash=sha256:675686925a9fb403edba0114db74e741d8181683dcf216be697d208857e04ca8 \ - --hash=sha256:7e63cbcf2429a8dbfe48dcc2322d5f2220b77b2e17b7ba023d6166d84655da55 \ - --hash=sha256:8a6c688fefb4e1cd56feb6c511984a6c4f7ec7d2a1ff31a10254f3c817054ae4 \ - --hash=sha256:8c0ffc886aea5df6a1762d0019e9cb05f825d0eec1f520c51be9d198701daee5 \ - --hash=sha256:95cd16d3dee553f882540c1ffe331d085c9e629499ceadfbda4d4fde635f4b7d \ - --hash=sha256:99f748a7e71ff382613b4e1acc0ac83bf7ad167fb3802e35e90d9763daba4d78 \ - --hash=sha256:b8c78301cefcf5fd914aad35d3c04c2b21ce8629b5e4f4e45ae6812e461910fa \ - --hash=sha256:c420917b188a5582a56d8b93bdd8e0f6eca08c84ff623a4c16e809152cd35793 \ - --hash=sha256:c43866529f2f06fe0edc6246eb4faa34f03fe88b64a0a9a942561c8e22f4b71f \ - --hash=sha256:cab50b8c2250b46fe738c77dbd25ce017d5e6fb35d3407606e7a4180656a5a6a \ - --hash=sha256:cef128cb4d5e0b3493f058f10ce32365972c554572ff821e175dbc6f8ff6924f \ - --hash=sha256:cf16e3cf6c0a5fdd9bc10c21687e19d29ad1fe863372b5543deaec1039581a30 \ - --hash=sha256:e56c744aa6ff427a607763346e4170629caf7e48ead6921745986db3692f987f \ - --hash=sha256:e577934fc5f8779c554639376beeaa5657d54349096ef24abe8c74c5d9c117c3 \ - --hash=sha256:f2b0fa0c01d8a0c7483afd9f31d7ecf2d71760ca24499c8697aeb5ca37dc090c +cffi==1.15.0 \ + --hash=sha256:00c878c90cb53ccfaae6b8bc18ad05d2036553e6d9d1d9dbcf323bbe83854ca3 \ + --hash=sha256:0104fb5ae2391d46a4cb082abdd5c69ea4eab79d8d44eaaf79f1b1fd806ee4c2 \ + --hash=sha256:06c48159c1abed75c2e721b1715c379fa3200c7784271b3c46df01383b593636 \ + --hash=sha256:0808014eb713677ec1292301ea4c81ad277b6cdf2fdd90fd540af98c0b101d20 \ + --hash=sha256:10dffb601ccfb65262a27233ac273d552ddc4d8ae1bf93b21c94b8511bffe728 \ + --hash=sha256:14cd121ea63ecdae71efa69c15c5543a4b5fbcd0bbe2aad864baca0063cecf27 \ + --hash=sha256:17771976e82e9f94976180f76468546834d22a7cc404b17c22df2a2c81db0c66 \ + --hash=sha256:181dee03b1170ff1969489acf1c26533710231c58f95534e3edac87fff06c443 \ + --hash=sha256:23cfe892bd5dd8941608f93348c0737e369e51c100d03718f108bf1add7bd6d0 \ + --hash=sha256:263cc3d821c4ab2213cbe8cd8b355a7f72a8324577dc865ef98487c1aeee2bc7 \ + --hash=sha256:2756c88cbb94231c7a147402476be2c4df2f6078099a6f4a480d239a8817ae39 \ + --hash=sha256:27c219baf94952ae9d50ec19651a687b826792055353d07648a5695413e0c605 \ + --hash=sha256:2a23af14f408d53d5e6cd4e3d9a24ff9e05906ad574822a10563efcef137979a \ + --hash=sha256:31fb708d9d7c3f49a60f04cf5b119aeefe5644daba1cd2a0fe389b674fd1de37 \ + --hash=sha256:3415c89f9204ee60cd09b235810be700e993e343a408693e80ce7f6a40108029 \ + --hash=sha256:3773c4d81e6e818df2efbc7dd77325ca0dcb688116050fb2b3011218eda36139 \ + --hash=sha256:3b96a311ac60a3f6be21d2572e46ce67f09abcf4d09344c49274eb9e0bf345fc \ + --hash=sha256:3f7d084648d77af029acb79a0ff49a0ad7e9d09057a9bf46596dac9514dc07df \ + --hash=sha256:41d45de54cd277a7878919867c0f08b0cf817605e4eb94093e7516505d3c8d14 \ + --hash=sha256:4238e6dab5d6a8ba812de994bbb0a79bddbdf80994e4ce802b6f6f3142fcc880 \ + --hash=sha256:45db3a33139e9c8f7c09234b5784a5e33d31fd6907800b316decad50af323ff2 \ + --hash=sha256:45e8636704eacc432a206ac7345a5d3d2c62d95a507ec70d62f23cd91770482a \ + --hash=sha256:4958391dbd6249d7ad855b9ca88fae690783a6be9e86df65865058ed81fc860e \ + --hash=sha256:4a306fa632e8f0928956a41fa8e1d6243c71e7eb59ffbd165fc0b41e316b2474 \ + --hash=sha256:57e9ac9ccc3101fac9d6014fba037473e4358ef4e89f8e181f8951a2c0162024 \ + --hash=sha256:59888172256cac5629e60e72e86598027aca6bf01fa2465bdb676d37636573e8 \ + --hash=sha256:5e069f72d497312b24fcc02073d70cb989045d1c91cbd53979366077959933e0 \ + --hash=sha256:64d4ec9f448dfe041705426000cc13e34e6e5bb13736e9fd62e34a0b0c41566e \ + --hash=sha256:6dc2737a3674b3e344847c8686cf29e500584ccad76204efea14f451d4cc669a \ + --hash=sha256:74fdfdbfdc48d3f47148976f49fab3251e550a8720bebc99bf1483f5bfb5db3e \ + --hash=sha256:75e4024375654472cc27e91cbe9eaa08567f7fbdf822638be2814ce059f58032 \ + --hash=sha256:786902fb9ba7433aae840e0ed609f45c7bcd4e225ebb9c753aa39725bb3e6ad6 \ + --hash=sha256:8b6c2ea03845c9f501ed1313e78de148cd3f6cad741a75d43a29b43da27f2e1e \ + --hash=sha256:91d77d2a782be4274da750752bb1650a97bfd8f291022b379bb8e01c66b4e96b \ + --hash=sha256:91ec59c33514b7c7559a6acda53bbfe1b283949c34fe7440bcf917f96ac0723e \ + --hash=sha256:920f0d66a896c2d99f0adbb391f990a84091179542c205fa53ce5787aff87954 \ + --hash=sha256:a5263e363c27b653a90078143adb3d076c1a748ec9ecc78ea2fb916f9b861962 \ + --hash=sha256:abb9a20a72ac4e0fdb50dae135ba5e77880518e742077ced47eb1499e29a443c \ + --hash=sha256:c2051981a968d7de9dd2d7b87bcb9c939c74a34626a6e2f8181455dd49ed69e4 \ + --hash=sha256:c21c9e3896c23007803a875460fb786118f0cdd4434359577ea25eb556e34c55 \ + --hash=sha256:c2502a1a03b6312837279c8c1bd3ebedf6c12c4228ddbad40912d671ccc8a962 \ + --hash=sha256:d4d692a89c5cf08a8557fdeb329b82e7bf609aadfaed6c0d79f5a449a3c7c023 \ + --hash=sha256:da5db4e883f1ce37f55c667e5c0de439df76ac4cb55964655906306918e7363c \ + --hash=sha256:e7022a66d9b55e93e1a845d8c9eba2a1bebd4966cd8bfc25d9cd07d515b33fa6 \ + --hash=sha256:ef1f279350da2c586a69d32fc8733092fd32cc8ac95139a00377841f59a3f8d8 \ + --hash=sha256:f54a64f8b0c8ff0b64d18aa76675262e1700f3995182267998c31ae974fbc382 \ + --hash=sha256:f5c7150ad32ba43a07c4479f40241756145a1f03b43480e058cfd862bf5041c7 \ + --hash=sha256:f6f824dc3bce0edab5f427efcfb1d63ee75b6fcb7282900ccaf925be84efb0fc \ + --hash=sha256:fd8a250edc26254fe5b33be00402e6d287f562b6a5b2152dec302fa15bb3e997 \ + --hash=sha256:ffaa5c925128e29efbde7301d8ecaf35c8c60ffbcd6a1ffd3a552177c8e5e796 pycparser==2.20 \ --hash=sha256:2d475327684562c3a96cc71adf7dc8c4f0565175cf86b6d7a404ff4c771f15f0 \ --hash=sha256:7582ad22678f0fcd81102833f60ef8d0e57288b6b5fb00323d101be910e35705 @@ -49,19 +81,30 @@ pefile==2019.4.18 \ --hash=sha256:a5d6e8305c6b210849b47a6174ddf9c452b2888340b8177874b862ba6c207645 future==0.18.2 \ --hash=sha256:b1bead90b70cf6ec3f0710ae53a525360fa360d306a86583adc6bf83a4db537d -pywin32==228 \ - --hash=sha256:00eaf43dbd05ba6a9b0080c77e161e0b7a601f9a3f660727a952e40140537de7 \ - --hash=sha256:11cb6610efc2f078c9e6d8f5d0f957620c333f4b23466931a247fb945ed35e89 \ - --hash=sha256:1f45db18af5d36195447b2cffacd182fe2d296849ba0aecdab24d3852fbf3f80 \ - --hash=sha256:37dc9935f6a383cc744315ae0c2882ba1768d9b06700a70f35dc1ce73cd4ba9c \ - --hash=sha256:6e38c44097a834a4707c1b63efa9c2435f5a42afabff634a17f563bc478dfcc8 \ - --hash=sha256:8319bafdcd90b7202c50d6014efdfe4fde9311b3ff15fd6f893a45c0868de203 \ - --hash=sha256:9b3466083f8271e1a5eb0329f4e0d61925d46b40b195a33413e0905dccb285e8 \ - --hash=sha256:a60d795c6590a5b6baeacd16c583d91cce8038f959bd80c53bd9a68f40130f2d \ - --hash=sha256:af40887b6fc200eafe4d7742c48417529a8702dcc1a60bf89eee152d1d11209f \ - --hash=sha256:ec16d44b49b5f34e99eb97cf270806fdc560dff6f84d281eb2fcb89a014a56a9 \ - --hash=sha256:ed74b72d8059a6606f64842e7917aeee99159ebd6b8d6261c518d002837be298 \ - --hash=sha256:fa6ba028909cfc64ce9e24bcf22f588b14871980d9787f1e2002c99af8f1850c +pywin32==303 \ + --hash=sha256:51cb52c5ec6709f96c3f26e7795b0bf169ee0d8395b2c1d7eb2c029a5008ed51 \ + --hash=sha256:5f9ec054f5a46a0f4dfd72af2ce1372f3d5a6e4052af20b858aa7df2df7d355b \ + --hash=sha256:6fed4af057039f309263fd3285d7b8042d41507343cd5fa781d98fcc5b90e8bb \ + --hash=sha256:793bf74fce164bcffd9d57bb13c2c15d56e43c9542a7b9687b4fccf8f8a41aba \ + --hash=sha256:79cbb862c11b9af19bcb682891c1b91942ec2ff7de8151e2aea2e175899cda34 \ + --hash=sha256:7d3271c98434617a11921c5ccf74615794d97b079e22ed7773790822735cc352 \ + --hash=sha256:b1675d82bcf6dbc96363fca747bac8bff6f6e4a447a4287ac652aa4b9adc796e \ + --hash=sha256:c268040769b48a13367221fced6d4232ed52f044ffafeda247bd9d2c6bdc29ca \ + --hash=sha256:d9b5d87ca944eb3aa4cd45516203ead4b37ab06b8b777c54aedc35975dec0dee \ + --hash=sha256:fcf44032f5b14fcda86028cdf49b6ebdaea091230eb0a757282aa656e4732439 pywin32-ctypes==0.2.0 \ --hash=sha256:9dc2d991b3479cc2df15930958b674a48a227d5361d413827a4cfd0b5876fc98 \ --hash=sha256:24ffc3b341d457d48e8922352130cf2644024a4ff09762a2261fd34c36ee5942 +pyinstaller-hooks-contrib==2022.0 \ + --hash=sha256:29f0bd8fbb2ff6f2df60a0c147e5b5ad65ae5c1a982d90641a5f712de03fa161 \ + --hash=sha256:61b667f51b2525377fae30793f38fd9752a08032c72b209effabf707c840cc38 +importlib-metadata==3.10.0 \ + --hash=sha256:c9db46394197244adf2f0b08ec5bc3cf16757e9590b02af1fca085c16c0d600a \ + --hash=sha256:d2d46ef77ffc85cbf7dac7e81dd663fde71c45326131bea8033b9bad42268ebe +zipp==3.4.1 \ + --hash=sha256:3607921face881ba3e026887d8150cca609d517579abe052ac81fc5aeffdbd76 \ + --hash=sha256:51cb66cc54621609dd593d1787f286ee42a5c0adbb4b29abea5a63edc3e03098 +typing-extensions==3.7.4.3 \ + --hash=sha256:7cb407020f00f7bfc3cb3e7881628838e69d8f3fcab2f64742a5e76b2f841918 \ + --hash=sha256:99d4073b617d30288f569d3f13d2bd7548c3a7e4c8de87db09a9d29bb3a4a60c \ + --hash=sha256:dafc7639cde7f1b6e1acc0f457842a83e722ccca8eef5270af2d74792619a89f diff --git a/deposit.sh b/deposit.sh index 67caba66..53bc91a3 100755 --- a/deposit.sh +++ b/deposit.sh @@ -9,7 +9,7 @@ if [[ "$OSTYPE" == "linux"* ]] || [[ "$OSTYPE" == "linux-android"* ]] || [[ "$OS exit 1 fi echo "Running deposit-cli..." - python3 ./eth2deposit/deposit.py "$@" + python3 ./staking_deposit/deposit.py "$@" elif [[ "$OSTYPE" == "msys" ]] || [[ "$OSTYPE" == "cygwin" ]]; then echo $OSTYPE @@ -20,10 +20,10 @@ elif [[ "$OSTYPE" == "msys" ]] || [[ "$OSTYPE" == "cygwin" ]]; then exit 1 fi echo "Running deposit-cli..." - python ./eth2deposit/deposit.py "$@" + python ./staking_deposit/deposit.py "$@" else - echo "Sorry, to run deposit-cli on" $(uname -s)", please see the trouble-shooting on https://github.com/ethereum/eth2.0-deposit-cli" + echo "Sorry, to run deposit-cli on" $(uname -s)", please see the trouble-shooting on https://github.com/ethereum/staking-deposit-cli" exit 1 fi diff --git a/eth2deposit/cli/existing_mnemonic.py b/eth2deposit/cli/existing_mnemonic.py deleted file mode 100644 index 2c0970c2..00000000 --- a/eth2deposit/cli/existing_mnemonic.py +++ /dev/null @@ -1,70 +0,0 @@ -import click -from typing import ( - Any, -) - -from eth2deposit.exceptions import ValidationError -from eth2deposit.key_handling.key_derivation.mnemonic import ( - verify_mnemonic, -) -from eth2deposit.utils.constants import ( - WORD_LISTS_PATH, -) -from .generate_keys import ( - generate_keys, - generate_keys_arguments_decorator, -) - - -def validate_mnemonic(cts: click.Context, param: Any, mnemonic: str) -> str: - if verify_mnemonic(mnemonic, WORD_LISTS_PATH): - return mnemonic - else: - raise ValidationError('That is not a valid mnemonic, please check for typos.') - - -@click.command( - help='Generate (or recover) keys from an existing mnemonic', -) -@click.pass_context -@click.option( - '--mnemonic', - callback=validate_mnemonic, - 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.)'), - prompt='Please enter your mnemonic separated by spaces (" ")', - required=True, - type=str, -) -@click.password_option( - '--mnemonic-password', - default='', - 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 intially, 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.'), - prompt=False, -) -@click.option( - '--validator_start_index', - confirmation_prompt=True, - default=0, - 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,'), - 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,'), - type=click.IntRange(0, 2**32 - 1), -) -@generate_keys_arguments_decorator -def existing_mnemonic(ctx: click.Context, mnemonic: str, mnemonic_password: str, **kwargs: Any) -> None: - if mnemonic_password != '': - click.clear() - click.confirm( - ('Are you absolutely certain that you used a mnemonic password? ' - '(This is different from a keystore password!) ' - 'Using one when you are not supposed to can result in loss of funds!'), - abort=True) - - ctx.obj = {'mnemonic': mnemonic, 'mnemonic_password': mnemonic_password} - ctx.forward(generate_keys) diff --git a/eth2deposit/cli/generate_keys.py b/eth2deposit/cli/generate_keys.py deleted file mode 100644 index 4c12c3d9..00000000 --- a/eth2deposit/cli/generate_keys.py +++ /dev/null @@ -1,154 +0,0 @@ -import os -import click -from typing import ( - Any, - Callable, -) - -from eth_typing import HexAddress -from eth_utils import is_hex_address, to_normalized_address - -from eth2deposit.credentials import ( - CredentialList, -) -from eth2deposit.exceptions import ValidationError -from eth2deposit.utils.validation import ( - verify_deposit_data_json, - validate_password_strength, -) -from eth2deposit.utils.constants import ( - MAX_DEPOSIT_AMOUNT, - DEFAULT_VALIDATOR_KEYS_FOLDER_NAME, -) -from eth2deposit.utils.ascii_art import RHINO_0 -from eth2deposit.settings import ( - ALL_CHAINS, - MAINNET, - get_chain_setting, -) - - -def get_password(text: str) -> str: - return click.prompt(text, hide_input=True, show_default=False, type=str) - - -def validate_password(cts: click.Context, param: Any, password: str) -> str: - is_valid_password = False - - # The given password has passed confirmation - try: - validate_password_strength(password) - except ValidationError as e: - click.echo(f'Error: {e} Please retype.') - else: - is_valid_password = True - - while not is_valid_password: - password = get_password(text='Type the password that secures your validator keystore(s)') - try: - validate_password_strength(password) - except ValidationError as e: - click.echo(f'Error: {e} Please retype.') - else: - # Confirm password - password_confirmation = get_password(text='Repeat for confirmation') - if password == password_confirmation: - is_valid_password = True - else: - click.echo('Error: the two entered values do not match. Please retype again.') - - return password - - -def validate_eth1_withdrawal_address(cts: click.Context, param: Any, address: str) -> HexAddress: - if address is None: - return None - if not is_hex_address(address): - raise ValueError("The given Eth1 address is not in hexadecimal encoded form.") - - normalized_address = to_normalized_address(address) - click.echo(f'\n**[Warning] you are setting Eth1 address {normalized_address} as your withdrawal address. ' - 'Please ensure that you have control over this address.**\n') - return normalized_address - - -def generate_keys_arguments_decorator(function: Callable[..., Any]) -> Callable[..., Any]: - ''' - This is a decorator that, when applied to a parent-command, implements the - to obtain the necessary arguments for the generate_keys() subcommand. - ''' - decorators = [ - click.option( - '--num_validators', - prompt='Please choose how many validators you wish to run', - help='The number of validators keys you want to generate (you can always generate more later)', - required=True, - type=click.IntRange(0, 2**32 - 1), - ), - click.option( - '--folder', - default=os.getcwd(), - help='The folder to place the generated keystores and deposit_data.json in', - type=click.Path(exists=True, file_okay=False, dir_okay=True), - ), - click.option( - '--chain', - default=MAINNET, - help='The version of eth2 you are targeting. use "mainnet" if you are depositing ETH', - prompt='Please choose the (mainnet or testnet) network/chain name', - type=click.Choice(ALL_CHAINS.keys(), case_sensitive=False), - ), - click.password_option( - '--keystore_password', - callback=validate_password, - help=('The password that will secure your keystores. You will need to re-enter this to decrypt them when ' - 'you setup your eth2 validators. (It is reccomened 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.)'), - prompt='Type the password that secures your validator keystore(s)', - ), - click.option( - '--eth1_withdrawal_address', - default=None, - callback=validate_eth1_withdrawal_address, - help=('If this field is set and valid, the given Eth1 address will be used to create the ' - 'withdrawal credentials. Otherwise, it will generate withdrawal credentials with the ' - 'mnemonic-derived withdrawal public key.'), - ), - ] - for decorator in reversed(decorators): - function = decorator(function) - return function - - -@click.command() -@click.pass_context -def generate_keys(ctx: click.Context, validator_start_index: int, - num_validators: int, folder: str, chain: str, keystore_password: str, - eth1_withdrawal_address: HexAddress, **kwargs: Any) -> None: - mnemonic = ctx.obj['mnemonic'] - mnemonic_password = ctx.obj['mnemonic_password'] - amounts = [MAX_DEPOSIT_AMOUNT] * num_validators - folder = os.path.join(folder, DEFAULT_VALIDATOR_KEYS_FOLDER_NAME) - chain_setting = get_chain_setting(chain) - if not os.path.exists(folder): - os.mkdir(folder) - click.clear() - click.echo(RHINO_0) - click.echo('Creating your keys.') - credentials = CredentialList.from_mnemonic( - mnemonic=mnemonic, - mnemonic_password=mnemonic_password, - num_keys=num_validators, - amounts=amounts, - chain_setting=chain_setting, - start_index=validator_start_index, - hex_eth1_withdrawal_address=eth1_withdrawal_address, - ) - keystore_filefolders = credentials.export_keystores(password=keystore_password, folder=folder) - deposits_file = credentials.export_deposit_data_json(folder=folder) - if not credentials.verify_keystores(keystore_filefolders=keystore_filefolders, password=keystore_password): - raise ValidationError("Failed to verify the keystores.") - if not verify_deposit_data_json(deposits_file, credentials.credentials): - raise ValidationError("Failed to verify the deposit data JSON files.") - click.echo('\nSuccess!\nYour keys can be found at: %s' % folder) - click.pause('\n\nPress any key.') diff --git a/eth2deposit/cli/new_mnemonic.py b/eth2deposit/cli/new_mnemonic.py deleted file mode 100644 index af278c6c..00000000 --- a/eth2deposit/cli/new_mnemonic.py +++ /dev/null @@ -1,48 +0,0 @@ -import click -from typing import ( - Any, -) - -from eth2deposit.key_handling.key_derivation.mnemonic import ( - get_languages, - get_mnemonic, -) -from eth2deposit.utils.constants import WORD_LISTS_PATH - -from .generate_keys import ( - generate_keys, - generate_keys_arguments_decorator, -) - -languages = get_languages(WORD_LISTS_PATH) - - -@click.command( - help='Generate a new mnemonic and keys', -) -@click.pass_context -@click.option( - '--mnemonic_language', - default='english', - help='The language that your mnemonic is in.', - prompt='Please choose your mnemonic language', - type=click.Choice(languages, case_sensitive=False), -) -@generate_keys_arguments_decorator -def new_mnemonic(ctx: click.Context, mnemonic_language: str, **kwargs: Any) -> None: - mnemonic = get_mnemonic(language=mnemonic_language, words_path=WORD_LISTS_PATH) - test_mnemonic = '' - while mnemonic != test_mnemonic: - click.clear() - click.echo('This is your seed phrase. Write it down and store it safely, it is the ONLY way to retrieve your deposit.') # noqa: E501 - click.echo('\n\n%s\n\n' % mnemonic) - click.pause('Press any key when you have written down your mnemonic.') - - click.clear() - test_mnemonic = click.prompt('Please type your mnemonic (separated by spaces) to confirm you have written it down\n\n') # noqa: E501 - test_mnemonic = test_mnemonic.lower() - click.clear() - # Do NOT use mnemonic_password. - ctx.obj = {'mnemonic': mnemonic, 'mnemonic_password': ''} - ctx.params['validator_start_index'] = 0 - ctx.forward(generate_keys) diff --git a/eth2deposit/deposit.py b/eth2deposit/deposit.py deleted file mode 100644 index 0d2cd403..00000000 --- a/eth2deposit/deposit.py +++ /dev/null @@ -1,28 +0,0 @@ -import sys -import click - -from eth2deposit.cli.existing_mnemonic import existing_mnemonic -from eth2deposit.cli.new_mnemonic import new_mnemonic - - -def check_python_version() -> None: - ''' - Checks that the python version running is sufficient and exits if not. - ''' - if sys.version_info < (3, 7): - click.pause('Your python version is insufficient, please install version 3.7 or greater.') - sys.exit() - - -@click.group() -def cli() -> None: - pass - - -cli.add_command(existing_mnemonic) -cli.add_command(new_mnemonic) - - -if __name__ == '__main__': - check_python_version() - cli() diff --git a/eth2deposit/settings.py b/eth2deposit/settings.py deleted file mode 100644 index d1c185ae..00000000 --- a/eth2deposit/settings.py +++ /dev/null @@ -1,33 +0,0 @@ -from typing import Dict, NamedTuple - - -DEPOSIT_CLI_VERSION = '1.2.0' - - -class BaseChainSetting(NamedTuple): - ETH2_NETWORK_NAME: str - GENESIS_FORK_VERSION: bytes - - -MAINNET = 'mainnet' -PYRMONT = 'pyrmont' -PRATER = 'prater' - - -# Eth2 Mainnet setting -MainnetSetting = BaseChainSetting(ETH2_NETWORK_NAME=MAINNET, GENESIS_FORK_VERSION=bytes.fromhex('00000000')) -# Eth2 pre-launch testnet (spec v1.0.0) -PyrmontSetting = BaseChainSetting(ETH2_NETWORK_NAME=PYRMONT, GENESIS_FORK_VERSION=bytes.fromhex('00002009')) -# Eth2 testnet (spec v1.0.1) -PraterSetting = BaseChainSetting(ETH2_NETWORK_NAME=PRATER, GENESIS_FORK_VERSION=bytes.fromhex('00001020')) - - -ALL_CHAINS: Dict[str, BaseChainSetting] = { - MAINNET: MainnetSetting, - PYRMONT: PyrmontSetting, - PRATER: PraterSetting, -} - - -def get_chain_setting(chain_name: str = MAINNET) -> BaseChainSetting: - return ALL_CHAINS[chain_name] diff --git a/eth2deposit/utils/constants.py b/eth2deposit/utils/constants.py deleted file mode 100644 index 13d1d629..00000000 --- a/eth2deposit/utils/constants.py +++ /dev/null @@ -1,22 +0,0 @@ -import os - - -ZERO_BYTES32 = b'\x00' * 32 - -# Eth2-spec constants taken from https://github.com/ethereum/eth2.0-specs/blob/dev/specs/phase0/beacon-chain.md -DOMAIN_DEPOSIT = bytes.fromhex('03000000') -BLS_WITHDRAWAL_PREFIX = bytes.fromhex('00') -ETH1_ADDRESS_WITHDRAWAL_PREFIX = bytes.fromhex('01') - -ETH2GWEI = 10 ** 9 -MIN_DEPOSIT_AMOUNT = 2 ** 0 * ETH2GWEI -MAX_DEPOSIT_AMOUNT = 2 ** 5 * ETH2GWEI - - -# File/folder constants -WORD_LISTS_PATH = os.path.join('eth2deposit', 'key_handling', 'key_derivation', 'word_lists') -DEFAULT_VALIDATOR_KEYS_FOLDER_NAME = 'validator_keys' - - -# Sundry constants -UNICODE_CONTROL_CHARS = list(range(0x00, 0x20)) + list(range(0x7F, 0xA0)) diff --git a/requirements.txt b/requirements.txt index 52bb25b6..68a8febb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -63,9 +63,8 @@ pyrsistent==0.16.1 \ eth-hash==0.2.0 \ --hash=sha256:1b9cb34dd3cd99c85c2bd6a1420ceae39a2eee8bf080efd264bcda8be3edecc8 \ --hash=sha256:499dc02d098f69856d1a6dd005529c16174157d4fb2a9fe20c41f69e39f8f176 -cytoolz==0.10.1 \ - --hash=sha256:82f5bba81d73a5a6b06f2a3553ff9003d865952fcb32e1df192378dd944d8a5c \ - --hash=sha256:5161bef77f7b69bea64b4e052d0da17845e6adae6d09f91cc7e5acfc5cb2c5c4 +cytoolz==0.11.2 \ + --hash=sha256:ea23663153806edddce7e4153d1d407d62357c05120a4e8485bddf1bd5ab22b4 toolz==0.10.0 \ --hash=sha256:08fdd5ef7c96480ad11c12d472de21acd32359996f69a5259299b540feba4560 \ --hash=sha256:e71d8d91c8902fb7659c23e10e9698a8c5cbea985683b8a378c6fd67b52f2fc4 \ diff --git a/requirements_test.txt b/requirements_test.txt index 7e042617..f4d1a3fc 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -11,22 +11,23 @@ pytest-asyncio==0.14.0 \ flake8==3.8.3 \ --hash=sha256:15e351d19611c887e482fb960eae4d44845013cc142d42896e9862f775d8cf5c \ --hash=sha256:f04b9fcbac03b0a3e58c0ab3a0ecc462e023a9faf046d57794184028123aa208 -mypy==0.782 \ - --hash=sha256:2c6cde8aa3426c1682d35190b59b71f661237d74b053822ea3d748e2c9578a7c \ - --hash=sha256:3fdda71c067d3ddfb21da4b80e2686b71e9e5c72cca65fa216d207a358827f86 \ - --hash=sha256:5dd13ff1f2a97f94540fd37a49e5d255950ebcdf446fb597463a40d0df3fac8b \ - --hash=sha256:6731603dfe0ce4352c555c6284c6db0dc935b685e9ce2e4cf220abe1e14386fd \ - --hash=sha256:6bb93479caa6619d21d6e7160c552c1193f6952f0668cdda2f851156e85186fc \ - --hash=sha256:81c7908b94239c4010e16642c9102bfc958ab14e36048fa77d0be3289dda76ea \ - --hash=sha256:9c7a9a7ceb2871ba4bac1cf7217a7dd9ccd44c27c2950edbc6dc08530f32ad4e \ - --hash=sha256:a4a2cbcfc4cbf45cd126f531dedda8485671545b43107ded25ce952aac6fb308 \ - --hash=sha256:b7fbfabdbcc78c4f6fc4712544b9b0d6bf171069c6e0e3cb82440dd10ced3406 \ - --hash=sha256:c05b9e4fb1d8a41d41dec8786c94f3b95d3c5f528298d769eb8e73d293abc48d \ - --hash=sha256:d7df6eddb6054d21ca4d3c6249cae5578cb4602951fd2b6ee2f5510ffb098707 \ - --hash=sha256:e0b61738ab504e656d1fe4ff0c0601387a5489ca122d55390ade31f9ca0e252d \ - --hash=sha256:eff7d4a85e9eea55afa34888dfeaccde99e7520b51f867ac28a48492c0b1130c \ - --hash=sha256:f05644db6779387ccdb468cc47a44b4356fc2ffa9287135d05b70a98dc83b89a - +mypy==0.931 \ + --hash=sha256:1171f2e0859cfff2d366da2c7092b06130f232c636a3f7301e3feb8b41f6377d \ + --hash=sha256:7b3f6f557ba4afc7f2ce6d3215d5db279bcf120b3cfd0add20a5d4f4abdae5bc \ + --hash=sha256:300717a07ad09525401a508ef5d105e6b56646f7942eb92715a1c8d610149714 \ + --hash=sha256:c89702cac5b302f0c5d33b172d2b55b5df2bede3344a2fbed99ff96bddb2cf00 \ + --hash=sha256:3c5b42d0815e15518b1f0990cff7a705805961613e701db60387e6fb663fe78a \ + --hash=sha256:74f7eccbfd436abe9c352ad9fb65872cc0f1f0a868e9d9c44db0893440f0c697 \ + --hash=sha256:8ca7f8c4b1584d63c9a0f827c37ba7a47226c19a23a753d52e5b5eddb201afcd \ + --hash=sha256:5b56154f8c09427bae082b32275a21f500b24d93c88d69a5e82f3978018a0266 \ + --hash=sha256:ff3bf387c14c805ab1388185dd22d6b210824e164d4bb324b195ff34e322d166 \ + --hash=sha256:d9d2b84b2007cea426e327d2483238f040c49405a6bf4074f605f0156c91a47a \ + --hash=sha256:8c11003aaeaf7cc2d0f1bc101c1cc9454ec4cc9cb825aef3cafff8a5fdf4c799 \ + --hash=sha256:1b06268df7eb53a8feea99cbfff77a6e2b205e70bf31743e786678ef87ee8069 \ + --hash=sha256:f9fe20d0872b26c4bba1c1be02c5340de1019530302cf2dcc85c7f9fc3252ae0 \ + --hash=sha256:d8f1ff62f7a879c9fe5917b3f9eb93a79b78aad47b533911b853a757223f72e7 \ + --hash=sha256:50c7346a46dc76a4ed88f3277d4959de8a2bd0a0fa47fa87a4cde36fe247ac05 \ + --hash=sha256:e839191b8da5b4e5d805f940537efcaa13ea5dd98418f06dc585d2891d228cf0 # Dependencies for the above wcwidth==0.2.5 \ @@ -53,42 +54,38 @@ pyflakes==2.2.0 \ mccabe==0.6.1 \ --hash=sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42 \ --hash=sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f -typing-extensions==3.7.4.3 \ - --hash=sha256:7cb407020f00f7bfc3cb3e7881628838e69d8f3fcab2f64742a5e76b2f841918 \ - --hash=sha256:99d4073b617d30288f569d3f13d2bd7548c3a7e4c8de87db09a9d29bb3a4a60c \ - --hash=sha256:dafc7639cde7f1b6e1acc0f457842a83e722ccca8eef5270af2d74792619a89f -typed-ast==1.4.1 \ - --hash=sha256:0666aa36131496aed8f7be0410ff974562ab7eeac11ef351def9ea6fa28f6355 \ - --hash=sha256:0c2c07682d61a629b68433afb159376e24e5b2fd4641d35424e462169c0a7919 \ - --hash=sha256:249862707802d40f7f29f6e1aad8d84b5aa9e44552d2cc17384b209f091276aa \ - --hash=sha256:24995c843eb0ad11a4527b026b4dde3da70e1f2d8806c99b7b4a7cf491612652 \ - --hash=sha256:269151951236b0f9a6f04015a9004084a5ab0d5f19b57de779f908621e7d8b75 \ - --hash=sha256:4083861b0aa07990b619bd7ddc365eb7fa4b817e99cf5f8d9cf21a42780f6e01 \ - --hash=sha256:498b0f36cc7054c1fead3d7fc59d2150f4d5c6c56ba7fb150c013fbc683a8d2d \ - --hash=sha256:4e3e5da80ccbebfff202a67bf900d081906c358ccc3d5e3c8aea42fdfdfd51c1 \ - --hash=sha256:6daac9731f172c2a22ade6ed0c00197ee7cc1221aa84cfdf9c31defeb059a907 \ - --hash=sha256:715ff2f2df46121071622063fc7543d9b1fd19ebfc4f5c8895af64a77a8c852c \ - --hash=sha256:73d785a950fc82dd2a25897d525d003f6378d1cb23ab305578394694202a58c3 \ - --hash=sha256:8c8aaad94455178e3187ab22c8b01a3837f8ee50e09cf31f1ba129eb293ec30b \ - --hash=sha256:8ce678dbaf790dbdb3eba24056d5364fb45944f33553dd5869b7580cdbb83614 \ - --hash=sha256:aaee9905aee35ba5905cfb3c62f3e83b3bec7b39413f0a7f19be4e547ea01ebb \ - --hash=sha256:bcd3b13b56ea479b3650b82cabd6b5343a625b0ced5429e4ccad28a8973f301b \ - --hash=sha256:c9e348e02e4d2b4a8b2eedb48210430658df6951fa484e59de33ff773fbd4b41 \ - --hash=sha256:d205b1b46085271b4e15f670058ce182bd1199e56b317bf2ec004b6a44f911f6 \ - --hash=sha256:d43943ef777f9a1c42bf4e552ba23ac77a6351de620aa9acf64ad54933ad4d34 \ - --hash=sha256:d5d33e9e7af3b34a40dc05f498939f0ebf187f07c385fd58d591c533ad8562fe \ - --hash=sha256:fc0fea399acb12edbf8a628ba8d2312f583bdbdb3335635db062fa98cf71fca4 \ - --hash=sha256:fe460b922ec15dd205595c9b5b99e2f056fd98ae8f9f56b888e7a17dc2b757e7 \ - --hash=sha256:3791f73e5d75aa9a95274679ab4821bd9d16de623c4ecf4900a77a29864ee144 +typing-extensions==4.0.1 \ + --hash=sha256:4ca091dea149f945ec56afb48dae714f21e8692ef22a395223bcd328961b6a0e \ + --hash=sha256:7f001e5ac290a0c0401508864c7ec868be4e701886d5b573a9528ed3973d9d3b +typed-ast==1.5.2 \ + --hash=sha256:18fe320f354d6f9ad3147859b6e16649a0781425268c4dde596093177660e71a \ + --hash=sha256:bc2542e83ac8399752bc16e0b35e038bdb659ba237f4222616b4e83fb9654985 \ + --hash=sha256:74cac86cc586db8dfda0ce65d8bcd2bf17b58668dfcc3652762f3ef0e6677e76 \ + --hash=sha256:676d051b1da67a852c0447621fdd11c4e104827417bf216092ec3e286f7da596 \ + --hash=sha256:183b183b7771a508395d2cbffd6db67d6ad52958a5fdc99f450d954003900266 \ + --hash=sha256:df05aa5b241e2e8045f5f4367a9f6187b09c4cdf8578bb219861c4e27c443db5 \ + --hash=sha256:42c47c3b43fe3a39ddf8de1d40dbbfca60ac8530a36c9b198ea5b9efac75c09e \ + --hash=sha256:f290617f74a610849bd8f5514e34ae3d09eafd521dceaa6cf68b3f4414266d4e \ + --hash=sha256:1098df9a0592dd4c8c0ccfc2e98931278a6c6c53cb3a3e2cf7e9ee3b06153344 \ + --hash=sha256:33b4a19ddc9fc551ebabca9765d54d04600c4a50eda13893dadf67ed81d9a098 \ + --hash=sha256:da0a98d458010bf4fe535f2d1e367a2e2060e105978873c04c04212fb20543f7 \ + --hash=sha256:c29dd9a3a9d259c9fa19d19738d021632d673f6ed9b35a739f48e5f807f264fb \ + --hash=sha256:58ae097a325e9bb7a684572d20eb3e1809802c5c9ec7108e85da1eb6c1a3331b \ + --hash=sha256:bbebc31bf11762b63bf61aaae232becb41c5bf6b3461b80a4df7e791fabb3aca \ + --hash=sha256:90904d889ab8e81a956f2c0935a523cc4e077c7847a836abee832f868d5c26a4 \ + --hash=sha256:8c08d6625bb258179b6e512f55ad20f9dfef019bbfbe3095247401e053a3ea30 \ + --hash=sha256:c7407cfcad702f0b6c0e0f3e7ab876cd1d2c13b14ce770e412c0c4b9728a0f88 \ + --hash=sha256:f30ddd110634c2d7534b2d4e0e22967e88366b0d356b24de87419cc4410c41b7 \ + --hash=sha256:26a432dc219c6b6f38be20a958cbe1abffcc5492821d7e27f08606ef99e0dffd packaging==20.4 \ --hash=sha256:4357f74f47b9c12db93624a82154e9b120fa8293699949152b22065d556079f8 \ --hash=sha256:998416ba6962ae7fbd6596850b80e17859a5753ba17c32284f67bfff33784181 more-itertools==8.5.0 \ --hash=sha256:6f83822ae94818eae2612063a5101a7311e68ae8002005b5e05f03fd74a86a20 \ --hash=sha256:9b30f12df9393f0d28af9210ff8efe48d10c94f73e5daf886f10c4b0b0b4f03c -py==1.9.0 \ - --hash=sha256:366389d1db726cd2fcfc79732e75410e5fe4d31db13692115529d34069a043c2 \ - --hash=sha256:9ca6883ce56b4e8da7e79ac18787889fa5206c79dcc67fb065376cd2fe03f342 +py==1.10.0 \ + --hash=sha256:3b80836aa6d1feeaa108e046da6423ab8f6ceda6468545ae8d02d9d58d18818a \ + --hash=sha256:21b81bda15b66ef5e1a777a21c4dcd9c20ad3efd0b3f817e7a809035269e1bd3 zipp==3.1.0 \ --hash=sha256:aa36550ff0c0b7ef7fa639055d797116ee891440eac1a56f378e2d3179e0320b \ --hash=sha256:c599e4d75c98f6798c509911d08a22e6c021d074469042177c8c86fb92eefd96 @@ -107,3 +104,9 @@ iniconfig==1.0.1 \ toml==0.10.1 \ --hash=sha256:926b612be1e5ce0634a2ca03470f95169cf16f939018233a670519cb4ac58b0f \ --hash=sha256:bda89d5935c2eac546d648028b9901107a595863cb36bae0c73ac804a9b4ce88 +tomli==2.0.0 \ + --hash=sha256:c292c34f58502a1eb2bbb9f5bbc9a5ebc37bee10ffb8c2d6bbdfa8eb13cc14e1 \ + --hash=sha256:b5bde28da1fed24b9bd1d4d2b8cba62300bfb4ec9a6187a957e8ddb9434c5224 +jsonschema==3.2.0 \ + --hash=sha256:4e5b3cf8216f577bee9ce139cbe72eca3ea4f292ec60928ff24758ce626cd163 \ + --hash=sha256:c8a85b28d377cc7737e46e2d9f2b4f44ee3c0e1deac6bf46ddefc7187d30797a diff --git a/setup.py b/setup.py index 9976c689..ce61b704 100644 --- a/setup.py +++ b/setup.py @@ -5,9 +5,9 @@ """ setup( - name="eth2deposit", - version='1.2.0', - py_modules=["eth2deposit"], + name="staking_deposit", + version='2.0.0', + py_modules=["staking_deposit"], packages=find_packages(exclude=('tests', 'docs')), python_requires=">=3.7,<4", ) diff --git a/eth2deposit/__init__.py b/staking_deposit/__init__.py similarity index 100% rename from eth2deposit/__init__.py rename to staking_deposit/__init__.py diff --git a/eth2deposit/cli/__init__.py b/staking_deposit/cli/__init__.py similarity index 100% rename from eth2deposit/cli/__init__.py rename to staking_deposit/cli/__init__.py diff --git a/staking_deposit/cli/existing_mnemonic.py b/staking_deposit/cli/existing_mnemonic.py new file mode 100644 index 00000000..98e8bcd4 --- /dev/null +++ b/staking_deposit/cli/existing_mnemonic.py @@ -0,0 +1,72 @@ +import click +from typing import ( + Any, +) + +from staking_deposit.exceptions import ValidationError +from staking_deposit.key_handling.key_derivation.mnemonic import ( + verify_mnemonic, +) +from staking_deposit.utils.constants import ( + WORD_LISTS_PATH, +) +from staking_deposit.utils.click import ( + captive_prompt_callback, + jit_option, +) +from staking_deposit.utils.intl import load_text +from staking_deposit.utils.validation import validate_int_range +from .generate_keys import ( + generate_keys, + generate_keys_arguments_decorator, +) + + +def validate_mnemonic(ctx: click.Context, param: Any, mnemonic: str) -> str: + if verify_mnemonic(mnemonic, WORD_LISTS_PATH): + return mnemonic + else: + raise ValidationError(load_text(['err_invalid_mnemonic'])) + + +@click.command( + help=load_text(['arg_existing_mnemonic', 'help'], func='existing_mnemonic'), +) +@jit_option( + callback=validate_mnemonic, + help=lambda: load_text(['arg_mnemonic', 'help'], func='existing_mnemonic'), + param_decls='--mnemonic', + prompt=lambda: load_text(['arg_mnemonic', 'prompt'], func='existing_mnemonic'), + type=str, +) +@jit_option( + callback=captive_prompt_callback( + lambda x: x, + lambda: load_text(['arg_mnemonic_password', 'prompt'], func='existing_mnemonic'), + lambda: load_text(['arg_mnemonic_password', 'confirm'], func='existing_mnemonic'), + lambda: load_text(['arg_mnemonic_password', 'mismatch'], func='existing_mnemonic'), + True, + ), + default='', + help=lambda: load_text(['arg_mnemonic_password', 'help'], func='existing_mnemonic'), + hidden=True, + param_decls='--mnemonic-password', + prompt=False, +) +@jit_option( + callback=captive_prompt_callback( + lambda num: validate_int_range(num, 0, 2**32), + lambda: load_text(['arg_validator_start_index', 'prompt'], func='existing_mnemonic'), + lambda: load_text(['arg_validator_start_index', 'confirm'], func='existing_mnemonic'), + ), + default=0, + help=lambda: load_text(['arg_validator_start_index', 'help'], func='existing_mnemonic'), + param_decls="--validator_start_index", + prompt=lambda: load_text(['arg_validator_start_index', 'prompt'], func='existing_mnemonic'), +) +@generate_keys_arguments_decorator +@click.pass_context +def existing_mnemonic(ctx: click.Context, mnemonic: str, mnemonic_password: str, **kwargs: Any) -> None: + ctx.obj = {} if ctx.obj is None else ctx.obj # Create a new ctx.obj if it doesn't exist + ctx.obj.update({'mnemonic': mnemonic, 'mnemonic_password': mnemonic_password}) + ctx.forward(generate_keys) diff --git a/staking_deposit/cli/generate_keys.py b/staking_deposit/cli/generate_keys.py new file mode 100644 index 00000000..5d8aa582 --- /dev/null +++ b/staking_deposit/cli/generate_keys.py @@ -0,0 +1,149 @@ +import os +import click +from typing import ( + Any, + Callable, +) + +from eth_typing import HexAddress +from eth_utils import is_hex_address, to_normalized_address + +from staking_deposit.credentials import ( + CredentialList, +) +from staking_deposit.exceptions import ValidationError +from staking_deposit.utils.validation import ( + verify_deposit_data_json, + validate_int_range, + validate_password_strength, +) +from staking_deposit.utils.constants import ( + MAX_DEPOSIT_AMOUNT, + DEFAULT_VALIDATOR_KEYS_FOLDER_NAME, +) +from staking_deposit.utils.ascii_art import RHINO_0 +from staking_deposit.utils.click import ( + captive_prompt_callback, + choice_prompt_func, + jit_option, +) +from staking_deposit.utils.intl import ( + closest_match, + load_text, +) +from staking_deposit.settings import ( + ALL_CHAINS, + MAINNET, + get_chain_setting, +) + + +def get_password(text: str) -> str: + return click.prompt(text, hide_input=True, show_default=False, type=str) + + +def validate_eth1_withdrawal_address(cts: click.Context, param: Any, address: str) -> HexAddress: + if address is None: + return None + if not is_hex_address(address): + raise ValueError(load_text(['err_invalid_ECDSA_hex_addr'])) + + normalized_address = to_normalized_address(address) + click.echo('\n%s\n' % load_text(['msg_ECDSA_addr_withdrawal'])) + return normalized_address + + +def generate_keys_arguments_decorator(function: Callable[..., Any]) -> Callable[..., Any]: + ''' + This is a decorator that, when applied to a parent-command, implements the + to obtain the necessary arguments for the generate_keys() subcommand. + ''' + decorators = [ + jit_option( + callback=captive_prompt_callback( + lambda num: validate_int_range(num, 1, 2**32), + lambda: load_text(['num_validators', 'prompt'], func='generate_keys_arguments_decorator') + ), + help=lambda: load_text(['num_validators', 'help'], func='generate_keys_arguments_decorator'), + param_decls="--num_validators", + prompt=lambda: load_text(['num_validators', 'prompt'], func='generate_keys_arguments_decorator'), + ), + jit_option( + default=os.getcwd(), + help=lambda: load_text(['folder', 'help'], func='generate_keys_arguments_decorator'), + param_decls='--folder', + type=click.Path(exists=True, file_okay=False, dir_okay=True), + ), + jit_option( + callback=captive_prompt_callback( + lambda x: closest_match(x, list(ALL_CHAINS.keys())), + choice_prompt_func( + lambda: load_text(['chain', 'prompt'], func='generate_keys_arguments_decorator'), + list(ALL_CHAINS.keys()) + ), + ), + default=MAINNET, + help=lambda: load_text(['chain', 'help'], func='generate_keys_arguments_decorator'), + param_decls='--chain', + prompt=choice_prompt_func( + lambda: load_text(['chain', 'prompt'], func='generate_keys_arguments_decorator'), + list(ALL_CHAINS.keys()) + ), + ), + jit_option( + callback=captive_prompt_callback( + validate_password_strength, + lambda:load_text(['keystore_password', 'prompt'], func='generate_keys_arguments_decorator'), + lambda:load_text(['keystore_password', 'confirm'], func='generate_keys_arguments_decorator'), + lambda: load_text(['keystore_password', 'mismatch'], func='generate_keys_arguments_decorator'), + True, + ), + help=lambda: load_text(['keystore_password', 'help'], func='generate_keys_arguments_decorator'), + hide_input=True, + param_decls='--keystore_password', + prompt=lambda: load_text(['keystore_password', 'prompt'], func='generate_keys_arguments_decorator'), + ), + jit_option( + callback=validate_eth1_withdrawal_address, + default=None, + help=lambda: load_text(['eth1_withdrawal_address', 'help'], func='generate_keys_arguments_decorator'), + param_decls='--eth1_withdrawal_address', + ), + ] + for decorator in reversed(decorators): + function = decorator(function) + return function + + +@click.command() +@click.pass_context +def generate_keys(ctx: click.Context, validator_start_index: int, + num_validators: int, folder: str, chain: str, keystore_password: str, + eth1_withdrawal_address: HexAddress, **kwargs: Any) -> None: + mnemonic = ctx.obj['mnemonic'] + mnemonic_password = ctx.obj['mnemonic_password'] + amounts = [MAX_DEPOSIT_AMOUNT] * num_validators + folder = os.path.join(folder, DEFAULT_VALIDATOR_KEYS_FOLDER_NAME) + chain_setting = get_chain_setting(chain) + if not os.path.exists(folder): + os.mkdir(folder) + click.clear() + click.echo(RHINO_0) + click.echo(load_text(['msg_key_creation'])) + credentials = CredentialList.from_mnemonic( + mnemonic=mnemonic, + mnemonic_password=mnemonic_password, + num_keys=num_validators, + amounts=amounts, + chain_setting=chain_setting, + start_index=validator_start_index, + hex_eth1_withdrawal_address=eth1_withdrawal_address, + ) + keystore_filefolders = credentials.export_keystores(password=keystore_password, folder=folder) + deposits_file = credentials.export_deposit_data_json(folder=folder) + if not credentials.verify_keystores(keystore_filefolders=keystore_filefolders, password=keystore_password): + raise ValidationError(load_text(['err_verify_keystores'])) + if not verify_deposit_data_json(deposits_file, credentials.credentials): + raise ValidationError(load_text(['err_verify_deposit'])) + click.echo(load_text(['msg_creation_success']) + folder) + click.pause(load_text(['msg_pause'])) diff --git a/staking_deposit/cli/new_mnemonic.py b/staking_deposit/cli/new_mnemonic.py new file mode 100644 index 00000000..da2e7134 --- /dev/null +++ b/staking_deposit/cli/new_mnemonic.py @@ -0,0 +1,63 @@ +import click +from typing import ( + Any, +) + +from staking_deposit.key_handling.key_derivation.mnemonic import ( + get_mnemonic, +) +from staking_deposit.utils.click import ( + captive_prompt_callback, + choice_prompt_func, + jit_option, +) +from staking_deposit.utils.constants import ( + MNEMONIC_LANG_OPTIONS, + WORD_LISTS_PATH, +) +from staking_deposit.utils.intl import ( + fuzzy_reverse_dict_lookup, + load_text, + get_first_options, +) + +from .generate_keys import ( + generate_keys, + generate_keys_arguments_decorator, +) + +languages = get_first_options(MNEMONIC_LANG_OPTIONS) + + +@click.command( + help=load_text(['arg_new_mnemonic', 'help'], func='new_mnemonic'), +) +@click.pass_context +@jit_option( + callback=captive_prompt_callback( + lambda mnemonic_language: fuzzy_reverse_dict_lookup(mnemonic_language, MNEMONIC_LANG_OPTIONS), + choice_prompt_func(lambda: load_text(['arg_mnemonic_language', 'prompt'], func='new_mnemonic'), languages), + ), + default=lambda: load_text(['arg_mnemonic_language', 'default'], func='new_mnemonic'), + help=lambda: load_text(['arg_mnemonic_language', 'help'], func='new_mnemonic'), + param_decls='--mnemonic_language', + prompt=choice_prompt_func(lambda: load_text(['arg_mnemonic_language', 'prompt'], func='new_mnemonic'), languages), +) +@generate_keys_arguments_decorator +def new_mnemonic(ctx: click.Context, mnemonic_language: str, **kwargs: Any) -> None: + mnemonic = get_mnemonic(language=mnemonic_language, words_path=WORD_LISTS_PATH) + test_mnemonic = '' + while mnemonic != test_mnemonic: + click.clear() + click.echo(load_text(['msg_mnemonic_presentation'])) + click.echo('\n\n%s\n\n' % mnemonic) + click.pause(load_text(['msg_press_any_key'])) + + click.clear() + test_mnemonic = click.prompt(load_text(['msg_mnemonic_retype_prompt']) + '\n\n') + test_mnemonic = test_mnemonic.lower() + click.clear() + # Do NOT use mnemonic_password. + ctx.obj = {'mnemonic': mnemonic, 'mnemonic_password': ''} + ctx.params['validator_start_index'] = 0 + ctx.forward(generate_keys) diff --git a/eth2deposit/credentials.py b/staking_deposit/credentials.py similarity index 90% rename from eth2deposit/credentials.py rename to staking_deposit/credentials.py index c76b26d0..80a4ef86 100644 --- a/eth2deposit/credentials.py +++ b/staking_deposit/credentials.py @@ -9,22 +9,23 @@ from eth_utils import to_canonical_address from py_ecc.bls import G2ProofOfPossession as bls -from eth2deposit.exceptions import ValidationError -from eth2deposit.key_handling.key_derivation.path import mnemonic_and_path_to_key -from eth2deposit.key_handling.keystore import ( +from staking_deposit.exceptions import ValidationError +from staking_deposit.key_handling.key_derivation.path import mnemonic_and_path_to_key +from staking_deposit.key_handling.keystore import ( Keystore, ScryptKeystore, ) -from eth2deposit.settings import DEPOSIT_CLI_VERSION, BaseChainSetting -from eth2deposit.utils.constants import ( +from staking_deposit.settings import DEPOSIT_CLI_VERSION, BaseChainSetting +from staking_deposit.utils.constants import ( BLS_WITHDRAWAL_PREFIX, ETH1_ADDRESS_WITHDRAWAL_PREFIX, ETH2GWEI, MAX_DEPOSIT_AMOUNT, MIN_DEPOSIT_AMOUNT, ) -from eth2deposit.utils.crypto import SHA256 -from eth2deposit.utils.ssz import ( +from staking_deposit.utils.crypto import SHA256 +from staking_deposit.utils.intl import load_text +from staking_deposit.utils.ssz import ( compute_deposit_domain, compute_signing_root, DepositData, @@ -138,7 +139,7 @@ def deposit_datum_dict(self) -> Dict[str, bytes]: datum_dict.update({'deposit_message_root': self.deposit_message.hash_tree_root}) datum_dict.update({'deposit_data_root': signed_deposit_datum.hash_tree_root}) datum_dict.update({'fork_version': self.chain_setting.GENESIS_FORK_VERSION}) - datum_dict.update({'eth2_network_name': self.chain_setting.ETH2_NETWORK_NAME}) + datum_dict.update({'network_name': self.chain_setting.NETWORK_NAME}) datum_dict.update({'deposit_cli_version': DEPOSIT_CLI_VERSION}) return datum_dict @@ -180,7 +181,7 @@ def from_mnemonic(cls, f"The number of keys ({num_keys}) doesn't equal to the corresponding deposit amounts ({len(amounts)})." ) key_indices = range(start_index, start_index + num_keys) - with click.progressbar(key_indices, label='Creating your keys:\t\t', + with click.progressbar(key_indices, label=load_text(['msg_key_creation']), show_percent=False, show_pos=True) as indices: return cls([Credential(mnemonic=mnemonic, mnemonic_password=mnemonic_password, index=index, amount=amounts[index - start_index], chain_setting=chain_setting, @@ -188,12 +189,12 @@ def from_mnemonic(cls, for index in indices]) def export_keystores(self, password: str, folder: str) -> List[str]: - with click.progressbar(self.credentials, label='Creating your keystores:\t', + with click.progressbar(self.credentials, label=load_text(['msg_keystore_creation']), show_percent=False, show_pos=True) as credentials: return [credential.save_signing_keystore(password=password, folder=folder) for credential in credentials] def export_deposit_data_json(self, folder: str) -> str: - with click.progressbar(self.credentials, label='Creating your depositdata:\t', + with click.progressbar(self.credentials, label=load_text(['msg_depositdata_creation']), show_percent=False, show_pos=True) as credentials: deposit_data = [cred.deposit_datum_dict for cred in credentials] filefolder = os.path.join(folder, 'deposit_data-%i.json' % time.time()) @@ -204,7 +205,8 @@ def export_deposit_data_json(self, folder: str) -> str: return filefolder def verify_keystores(self, keystore_filefolders: List[str], password: str) -> bool: - with click.progressbar(zip(self.credentials, keystore_filefolders), label='Verifying your keystores:\t', + with click.progressbar(zip(self.credentials, keystore_filefolders), + label=load_text(['msg_keystore_verification']), length=len(self.credentials), show_percent=False, show_pos=True) as items: return all(credential.verify_keystore(keystore_filefolder=filefolder, password=password) for credential, filefolder in items) diff --git a/staking_deposit/deposit.py b/staking_deposit/deposit.py new file mode 100644 index 00000000..c224bfd2 --- /dev/null +++ b/staking_deposit/deposit.py @@ -0,0 +1,60 @@ +import click +import sys + +from staking_deposit.cli.existing_mnemonic import existing_mnemonic +from staking_deposit.cli.new_mnemonic import new_mnemonic +from staking_deposit.utils.click import ( + captive_prompt_callback, + choice_prompt_func, + jit_option, +) +from staking_deposit.utils import config +from staking_deposit.utils.constants import INTL_LANG_OPTIONS +from staking_deposit.utils.intl import ( + get_first_options, + fuzzy_reverse_dict_lookup, + load_text, +) + + +def check_python_version() -> None: + ''' + Checks that the python version running is sufficient and exits if not. + ''' + if sys.version_info < (3, 7): + click.pause(load_text(['err_python_version'])) + sys.exit() + + +@click.group() +@click.pass_context +@jit_option( + '--language', + callback=captive_prompt_callback( + lambda language: fuzzy_reverse_dict_lookup(language, INTL_LANG_OPTIONS), + choice_prompt_func(lambda: 'Please choose your language', get_first_options(INTL_LANG_OPTIONS)), + ), + default='English', + help='The language you wish to use the CLI in.', + prompt=choice_prompt_func(lambda: 'Please choose your language', get_first_options(INTL_LANG_OPTIONS))(), + type=str, +) +@click.option( + '--non_interactive', + default=False, + is_flag=True, + help='Disables interactive prompts.', + hidden=True, +) +def cli(ctx: click.Context, language: str, non_interactive: bool) -> None: + config.language = language + config.non_interactive = non_interactive # Remove interactive commands + + +cli.add_command(existing_mnemonic) +cli.add_command(new_mnemonic) + + +if __name__ == '__main__': + check_python_version() + cli() diff --git a/eth2deposit/exceptions.py b/staking_deposit/exceptions.py similarity index 100% rename from eth2deposit/exceptions.py rename to staking_deposit/exceptions.py diff --git a/eth2deposit/key_handling/__init__.py b/staking_deposit/intl/__init__.py similarity index 100% rename from eth2deposit/key_handling/__init__.py rename to staking_deposit/intl/__init__.py diff --git a/staking_deposit/intl/ar/cli/existing_mnemonic.json b/staking_deposit/intl/ar/cli/existing_mnemonic.json new file mode 100644 index 00000000..504e6514 --- /dev/null +++ b/staking_deposit/intl/ar/cli/existing_mnemonic.json @@ -0,0 +1,23 @@ +{ + "validate_mnemonic": { + "err_invalid_mnemonic": "هذا ليس مساعد ذاكرة صالحا، يرجى التحقق من الأخطاء المطبعية." + }, + "existing_mnemonic": { + "arg_existing_mnemonic": { + "help": "إنشاء (أو استرداد) مفاتيح من مساعد ذاكرة موجود" + }, + "arg_mnemonic": { + "help": "مساعد الذاكرة الذي استخدمته لتوليد مفاتيحك. (يوصى بعدم استخدام هذه الوسيطة، وانتظر حتى يطلب منك الـ CLI مساعد الذاكرة الخاص وإلا فإنها ستظهر في سجل الغلاف الخاص بك.)", + "prompt": "الرجاء إدخال مساعد الذاكرة الخاص بك مفصولة بمسافات (\" \")" + }, + "arg_mnemonic_password": { + "help": "من المؤكد تقريبًا أن هذه ليست الوسيطة التي تبحث عنها: فهي لكلمات مرور مساعد الذاكرة، وليس كلمات مرور متجر المفاتيح. وقد يؤدي توفير كلمة مرور هنا عند عدم استخدامك لواحدة في البداية إلى فقدان المفاتيح (وبالتالي الأموال)! لاحظ أيضًا أنه إذا كنت تستخدم هذه الأداة لتوليد مساعد الذاكرة في البداية، فإنك لم تستخدم كلمة مرور مساعد الذاكرة. ومع ذلك، إذا كنت متأكداً من أنك استخدمت كلمة مرور \"لزيادة\" أمان مساعدة الذاكرة الخاصة بك، فهذا هو المكان حيث أدخلتها.", + "confirm": "هل أنت متأكد تماما من أنك استخدمت كلمة مرور مساعد الذاكرة؟ (هذا مختلف عن كلمة مرور متجر المفاتيح!) من المفترض أن يؤدي استخدام واحدة عند عدم افتراض استخدامها إلى فقدان الأموال! كرر للتأكيد" + }, + "arg_validator_start_index": { + "help": "أدخل الفهرس (الرقم الرئيسي) الذي تريد بدء توليد المزيد من المفاتيح منه. على سبيل المثال، إذا قمت بتوليد 4 مفاتيح في الماضي، فإنك ستدخل 4 هنا.", + "prompt": "أدخل الفهرس (الرقم الرئيسي) الذي تريد بدء توليد المزيد من المفاتيح منه. على سبيل المثال، إذا قمت بتوليد 4 مفاتيح في الماضي، فإنك ستدخل 4 هنا.", + "confirm": "كرر للتأكيد" + } + } +} diff --git a/staking_deposit/intl/ar/cli/generate_keys.json b/staking_deposit/intl/ar/cli/generate_keys.json new file mode 100644 index 00000000..b10052e2 --- /dev/null +++ b/staking_deposit/intl/ar/cli/generate_keys.json @@ -0,0 +1,25 @@ +{ + "generate_keys_arguments_decorator": { + "num_validators": { + "help": "عدد مفاتيح المدققين التي تريد إنشاؤها (يمكنك دائمًا إنشاء المزيد في وقت لاحق)", + "prompt": "الرجاء اختيار عدد المدققين الذين ترغب في تشغيلهم" + }, + "chain": { + "help": "إصدار Ethereum PoS الذي تستهدفه. استخدم \"mainnet\" إذا كنت تودع ETH", + "prompt": "الرجاء اختيار اسم الشبكة/السلسلة (mainnet أو testnet)" + }, + "keystore_password": { + "help": "كلمة المرور التي ستؤمن متاجر المفاتيح الخاصة بك. وسوف تحتاج إلى إعادة إدخال هذا لفك تشفيرها عند إعداد مدققي Ethereum PoS الخاصي بك. (يوصى بعدم استخدام هذه الوسيطة، وانتظر حتى يطلب منك الـ CLI مساعد الذاكرة الخاص وإلا فإنها ستظهر في سجل الغلاف الخاص بك.)", + "prompt": "كلمة المرور التي سوف تؤمن متاجر المفاتيح الخاصة بك. سوف تحتاج إلى إعادة إدخال هذا لفك تشفيرها عند إعداد مدققي Ethereum PoS الخاصين بك.", + "confirm": "كرر للتأكيد", + "mismatch": "خطأ: القيمتان اللتان تم إدخالهما غير متطابقتين. الرجاء الكتابة مرة أخرى." + } + }, + "generate_keys": { + "msg_key_creation": "إنشاء مفاتيحك.", + "msg_creation_success": "\nنجحت!\nيمكن العثور على مفاتيحك في: ", + "msg_pause": "\n\nاضغط على أي مفتاح.", + "err_verify_keystores": "فشل التحقق من متاجر المفاتيح.", + "err_verify_deposit": "فشل التحقق من ملفات بيانات الإيداع JSON." + } +} diff --git a/staking_deposit/intl/ar/cli/new_mnemonic.json b/staking_deposit/intl/ar/cli/new_mnemonic.json new file mode 100644 index 00000000..cbdc8620 --- /dev/null +++ b/staking_deposit/intl/ar/cli/new_mnemonic.json @@ -0,0 +1,15 @@ +{ + "new_mnemonic": { + "arg_new_mnemonic": { + "help": "إنشاء مساعد ذاكرة جديد ومفاتيح جديدة" + }, + "arg_mnemonic_language": { + "default": "english", + "help": "اللغة التي يتكلمها مساعد الذاكرة الخاص بك", + "prompt": "الرجاء اختيار لغة مساعد الذاكرة الخاص بك" + }, + "msg_mnemonic_presentation": "هذا هو مساعد الذاكرة الخاصة بك (العبارة الأصلية). قم بكتابتها وتخزينها بأمان، وهي الطريقة الوحيدة لاسترداد وديعتك.", + "msg_press_any_key": "اضغط على أي مفتاح عندما تكون قد دونت مساعد الذاكرة الخاص بك.", + "msg_mnemonic_retype_prompt": "الرجاء كتابة مساعد الذاكرة الخاص بك (مفصولاً بمسافات) لتأكيد أنك دونته" + } +} diff --git a/staking_deposit/intl/ar/credentials.json b/staking_deposit/intl/ar/credentials.json new file mode 100644 index 00000000..05eeeee6 --- /dev/null +++ b/staking_deposit/intl/ar/credentials.json @@ -0,0 +1,14 @@ +{ + "from_mnemonic": { + "msg_key_creation": "إنشاء المفاتيح الخاصة بك:\t\t" + }, + "export_keystores": { + "msg_keystore_creation": "إنشاء متاجر المفاتيح الخاصة بك:\t" + }, + "export_deposit_data_json": { + "msg_depositdata_creation": "إنشاء بيانات الإيداع الخاصة بك:\t" + }, + "verify_keystores": { + "msg_keystore_verification": "التحقق من متاجر المفاتيح الخاصة بك:\t" + } +} \ No newline at end of file diff --git a/staking_deposit/intl/ar/deposit.json b/staking_deposit/intl/ar/deposit.json new file mode 100644 index 00000000..cc30c9ff --- /dev/null +++ b/staking_deposit/intl/ar/deposit.json @@ -0,0 +1,5 @@ +{ + "check_python_version": { + "err_python_version": "إصدار بايثون الخاص بك غير كافٍ، يرجى تثبيت الإصدار 3.7 أو الأحدث." + } +} \ No newline at end of file diff --git a/staking_deposit/intl/ar/utils/validation.json b/staking_deposit/intl/ar/utils/validation.json new file mode 100644 index 00000000..45453753 --- /dev/null +++ b/staking_deposit/intl/ar/utils/validation.json @@ -0,0 +1,8 @@ +{ + "verify_deposit_data_json": { + "msg_deposit_verification": "التحقق من الإيداعات الخاصة بك:\t" + }, + "validate_password_strength": { + "msg_password_length": "يجب أن يكون طول كلمة المرور 8 على الأقل. الرجاء إعادة الكتابة" + } +} \ No newline at end of file diff --git a/staking_deposit/intl/el/cli/existing_mnemonic.json b/staking_deposit/intl/el/cli/existing_mnemonic.json new file mode 100644 index 00000000..75e816e7 --- /dev/null +++ b/staking_deposit/intl/el/cli/existing_mnemonic.json @@ -0,0 +1,23 @@ +{ + "validate_mnemonic": { + "err_invalid_mnemonic": "Αυτό δεν είναι έγκυρο μνημονικό, παρακαλώ ελέγξτε για ορθογραφικά." + }, + "existing_mnemonic": { + "arg_existing_mnemonic": { + "help": "Δημιουργία (ή ανάκτηση) κλειδιών από υπάρχον μνημονικό" + }, + "arg_mnemonic": { + "help": "Το μνημονικό που χρησιμοποιήσατε για τη δημιουργία των κλειδιών σας. (Συνιστάται να μην χρησιμοποιήσετε αυτή την παράμετρο, και να περιμένετε το CLI να σας ζητήσει το μνημονικό σας, διαφορετικά θα εμφανιστεί στο ιστορικό κελύφους σας.)", + "prompt": "Παρακαλώ εισάγετε το μνημονικό σας διαχωρισμένο με κενά διαστήματα (\" \")" + }, + "arg_mnemonic_password": { + "help": "Είναι σχεδόν βέβαιο ότι αυτή δεν είναι η παράμετρος που ψάχνετε: είναι για κωδικούς πρόσβασης μνημονικού, όχι κωδικούς πρόσβασης χώρου αποθήκευσης κλειδιών. Η παροχή κωδικού πρόσβασης ενώ δεν χρησιμοποιήσατε έναν αρχικά, μπορεί να οδηγήσει σε χαμένα κλειδιά (και επομένως κεφάλαια)! Επίσης, σημειώστε ότι αν χρησιμοποιήσατε αυτό το εργαλείο για να δημιουργήσετε το μνημονικό σας σε πρώτη φάση, τότε δεν χρησιμοποιήσατε έναν κωδικό πρόσβασης μνημονικού. Ωστόσο, αν είστε σίγουροι ότι χρησιμοποιήσατε έναν κωδικό πρόσβασης για να \"αυξήσετε\" την ασφάλεια του μνημονικού σας, πρέπει να τον πληκτρολογήσετε εδώ.", + "confirm": "Είστε απολύτως βέβαιοι ότι χρησιμοποιήσατε έναν κωδικό πρόσβασης μνημονικού; (Είναι διαφορετικό από έναν κωδικό πρόσβασης χώρου αποθήκευσης κλειδιών! Χρησιμοποιώντας έναν, ενώ υποτίθεται ότι δεν πρέπει μπορεί να οδηγήσει σε απώλεια κεφαλαίων! Επανάληψη για επιβεβαίωση" + }, + "arg_validator_start_index": { + "help": "Εισάγετε το ευρετήριο (αριθμός κλειδιού) από το οποίο θέλετε να αρχίσετε να δημιουργείτε περισσότερα κλειδιά. Για παράδειγμα, αν έχετε δημιουργήσει 4 κλειδιά στο παρελθόν, θα εισάγετε 4 εδώ.", + "prompt": "Εισάγετε το ευρετήριο (αριθμός κλειδιού) από το οποίο θέλετε να αρχίσετε να δημιουργείτε περισσότερα κλειδιά. Για παράδειγμα, αν έχετε δημιουργήσει 4 κλειδιά στο παρελθόν, θα εισάγετε 4 εδώ.", + "confirm": "Επανάληψη για επιβεβαίωση" + } + } +} diff --git a/staking_deposit/intl/el/cli/generate_keys.json b/staking_deposit/intl/el/cli/generate_keys.json new file mode 100644 index 00000000..0c98063f --- /dev/null +++ b/staking_deposit/intl/el/cli/generate_keys.json @@ -0,0 +1,25 @@ +{ + "generate_keys_arguments_decorator": { + "num_validators": { + "help": "Ο αριθμός των κλειδιών επαληθευτών που θέλετε να δημιουργήσετε (μπορείτε πάντα να δημιουργήσετε περισσότερα αργότερα)", + "prompt": "Παρακαλώ επιλέξτε πόσους επαληθευτές θέλετε να εκτελέσετε" + }, + "chain": { + "help": "Η έκδοση του Ethereum Proof-of-Stake στην οποία στοχεύετε. Χρησιμοποιήστε το \"mainnet\" αν κάνετε κατάθεση ETH", + "prompt": "Παρακαλώ επιλέξτε το όνομα δικτύου/αλυσίδας (κεντρικό δίκτυο ή δίκτυο δοκιμών)" + }, + "keystore_password": { + "help": "Ο κωδικός πρόσβασης που θα ασφαλίσει τον χώρο αποθήκευσης των κλειδιών σας. Θα πρέπει να το εισάγετε ξανά για να τα αποκρυπτογραφήσετε όταν ρυθμίσετε τους επαληθευτές σας. (Συνιστάται να μην χρησιμοποιήσετε αυτή την παράμετρο, και να περιμένετε το CLI να σας ρωτήσει για το μνημονικό σας, διαφορετικά θα εμφανιστεί στο ιστορικό κελύφους σας.)", + "prompt": "Ο κωδικός πρόσβασης που θα ασφαλίσει τους χώρους αποθήκευσης κλειδιών σας. Θα πρέπει να τον εισάγετε ξανά για να τον αποκρυπτογραφήσετε όταν ρυθμίσετε τους επαληθευτές σας.", + "confirm": "Επανάληψη για επιβεβαίωση", + "mismatch": "Σφάλμα: οι δύο εισαχθείσες τιμές δεν ταιριάζουν. Παρακαλώ πληκτρολογήστε ξανά." + } + }, + "generate_keys": { + "msg_key_creation": "Δημιουργώντας τα κλειδιά σας.", + "msg_creation_success": "\nΕπιτυχία!\nΤα κλειδιά σας μπορούν να βρεθούν στο: ", + "msg_pause": "\n\nΠιέστε οποιοδήποτε πλήκτρο.", + "err_verify_keystores": "Αποτυχία επαλήθευσης των χώρων αποθήκευσης των κλειδιών.", + "err_verify_deposit": "Αποτυχία επαλήθευσης των αρχείων JSON δεδομένων κατάθεσης." + } +} diff --git a/staking_deposit/intl/el/cli/new_mnemonic.json b/staking_deposit/intl/el/cli/new_mnemonic.json new file mode 100644 index 00000000..630f4b25 --- /dev/null +++ b/staking_deposit/intl/el/cli/new_mnemonic.json @@ -0,0 +1,15 @@ +{ + "new_mnemonic": { + "arg_new_mnemonic": { + "help": "Δημιουργία νέου μνημονικού και κλειδιών" + }, + "arg_mnemonic_language": { + "default": "english", + "help": "Η γλώσσα του μνημονικού σας", + "prompt": "Επιλέξτε τη γλώσσα του μνημονικού σας" + }, + "msg_mnemonic_presentation": "Αυτό είναι το μνημονικό σας (σειρά λέξεων). Γράψτε την και αποθηκεύστε την με ασφάλεια, είναι ο ΜΟΝΟΣ τρόπος για να ανακτήσετε την κατάθεσή σας.", + "msg_press_any_key": "Πιέστε οποιοδήποτε πλήκτρο όταν έχετε καταγράψει το μνημονικό σας.", + "msg_mnemonic_retype_prompt": "Πληκτρολογήστε το μνημονικό σας (διαχωρισμένο με κενά) για να επιβεβαιώσετε ότι το έχετε καταγράψει" + } +} diff --git a/staking_deposit/intl/el/credentials.json b/staking_deposit/intl/el/credentials.json new file mode 100644 index 00000000..42414767 --- /dev/null +++ b/staking_deposit/intl/el/credentials.json @@ -0,0 +1,14 @@ +{ + "from_mnemonic": { + "msg_key_creation": "Δημιουργώντας τα κλειδιά σας:\t\t" + }, + "export_keystores": { + "msg_keystore_creation": "Δημιουργώντας τους χώρους αποθήκευσης των κλειδιών σας:\t" + }, + "export_deposit_data_json": { + "msg_depositdata_creation": "Δημιουργώντας τα δεδομένα κατάθεσής σας:\t" + }, + "verify_keystores": { + "msg_keystore_verification": "Δημιουργώντας τους χώρους αποθήκευσης των κλειδιών σας:\t" + } +} \ No newline at end of file diff --git a/staking_deposit/intl/el/deposit.json b/staking_deposit/intl/el/deposit.json new file mode 100644 index 00000000..32ebca25 --- /dev/null +++ b/staking_deposit/intl/el/deposit.json @@ -0,0 +1,5 @@ +{ + "check_python_version": { + "err_python_version": "Η έκδοση python σας δεν είναι επαρκής, εγκαταστήστε την έκδοση 3.7 ή μεγαλύτερη." + } +} \ No newline at end of file diff --git a/staking_deposit/intl/el/utils/validation.json b/staking_deposit/intl/el/utils/validation.json new file mode 100644 index 00000000..cf1cb3de --- /dev/null +++ b/staking_deposit/intl/el/utils/validation.json @@ -0,0 +1,8 @@ +{ + "verify_deposit_data_json": { + "msg_deposit_verification": "Επαλήθευση των καταθέσεών σας:\t" + }, + "validate_password_strength": { + "msg_password_length": "Το μήκος του κωδικού πρόσβασης πρέπει να είναι τουλάχιστον 8. Πληκτρολογήστε ξανά" + } +} \ No newline at end of file diff --git a/staking_deposit/intl/en/cli/existing_mnemonic.json b/staking_deposit/intl/en/cli/existing_mnemonic.json new file mode 100644 index 00000000..9b70c276 --- /dev/null +++ b/staking_deposit/intl/en/cli/existing_mnemonic.json @@ -0,0 +1,25 @@ +{ + "validate_mnemonic": { + "err_invalid_mnemonic": "That is not a valid mnemonic, please check for typos." + }, + "existing_mnemonic": { + "arg_existing_mnemonic": { + "help": "Generate (or recover) keys from an existing mnemonic" + }, + "arg_mnemonic": { + "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.)", + "prompt": "Please enter your mnemonic separated by spaces (\" \")" + }, + "arg_mnemonic_password": { + "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.", + "prompt": "Enter your mnemonic password (if you used one). Make sure you won't forget it, it can not be recovered.", + "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.", + "mismatch": "The mnemonic password you entered doesn't match, please try again." + }, + "arg_validator_start_index": { + "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.", + "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.", + "confirm": "Please repeat the index to confirm" + } + } +} diff --git a/staking_deposit/intl/en/cli/generate_keys.json b/staking_deposit/intl/en/cli/generate_keys.json new file mode 100644 index 00000000..c1f33b3b --- /dev/null +++ b/staking_deposit/intl/en/cli/generate_keys.json @@ -0,0 +1,35 @@ +{ + "validate_eth1_withdrawal_address": { + "err_invalid_ECDSA_hex_addr": "The given Eth1 address is not in hexadecimal encoded form.", + "msg_ECDSA_addr_withdrawal": "**[Warning] you are setting an Eth1 address as your withdrawal address. Please ensure that you have control over this address.**" + }, + "generate_keys_arguments_decorator": { + "num_validators": { + "help": "The number of new validator keys you want to generate (you can always generate more later)", + "prompt": "Please choose how many new validators you wish to run" + }, + "folder": { + "help": "The folder path for the keystore(s) and deposit(s). Pointing to `./validator_keys` by default." + }, + "chain": { + "help": "The name of Ethereum PoS chain you are targeting. Use \"mainnet\" if you are depositing ETH", + "prompt": "Please choose the (mainnet or testnet) network/chain name" + }, + "keystore_password": { + "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.)", + "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.", + "confirm": "Repeat your keystore password for confirmation", + "mismatch": "Error: the two entered values do not match. Please type again." + }, + "eth1_withdrawal_address": { + "help": "If this field is set and valid, the given Eth1 address will be used to create the withdrawal credentials. Otherwise, it will generate withdrawal credentials with the mnemonic-derived withdrawal public key." + } + }, + "generate_keys": { + "msg_key_creation": "Creating your keys.", + "msg_creation_success": "\nSuccess!\nYour keys can be found at: ", + "msg_pause": "\n\nPress any key.", + "err_verify_keystores": "Failed to verify the keystores.", + "err_verify_deposit": "Failed to verify the deposit data JSON files." + } +} diff --git a/staking_deposit/intl/en/cli/new_mnemonic.json b/staking_deposit/intl/en/cli/new_mnemonic.json new file mode 100644 index 00000000..2c6d54c3 --- /dev/null +++ b/staking_deposit/intl/en/cli/new_mnemonic.json @@ -0,0 +1,15 @@ +{ + "new_mnemonic": { + "arg_new_mnemonic": { + "help": "Generate a new mnemonic and keys" + }, + "arg_mnemonic_language": { + "default": "english", + "help": "The language that your mnemonic is in", + "prompt": "Please choose your mnemonic language" + }, + "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.", + "msg_press_any_key": "Press any key when you have written down your mnemonic.", + "msg_mnemonic_retype_prompt": "Please type your mnemonic (separated by spaces) to confirm you have written it down" + } +} diff --git a/staking_deposit/intl/en/credentials.json b/staking_deposit/intl/en/credentials.json new file mode 100644 index 00000000..da6f6559 --- /dev/null +++ b/staking_deposit/intl/en/credentials.json @@ -0,0 +1,14 @@ +{ + "from_mnemonic": { + "msg_key_creation": "Creating your keys:\t\t" + }, + "export_keystores": { + "msg_keystore_creation": "Creating your keystores:\t" + }, + "export_deposit_data_json": { + "msg_depositdata_creation": "Creating your depositdata:\t" + }, + "verify_keystores": { + "msg_keystore_verification": "Verifying your keystores:\t" + } +} \ No newline at end of file diff --git a/staking_deposit/intl/en/deposit.json b/staking_deposit/intl/en/deposit.json new file mode 100644 index 00000000..39755c08 --- /dev/null +++ b/staking_deposit/intl/en/deposit.json @@ -0,0 +1,5 @@ +{ + "check_python_version": { + "err_python_version": "Your python version is insufficient, please install version 3.7 or greater." + } +} \ No newline at end of file diff --git a/staking_deposit/intl/en/utils/validation.json b/staking_deposit/intl/en/utils/validation.json new file mode 100644 index 00000000..50145b22 --- /dev/null +++ b/staking_deposit/intl/en/utils/validation.json @@ -0,0 +1,14 @@ +{ + "verify_deposit_data_json": { + "msg_deposit_verification": "Verifying your deposits:\t" + }, + "validate_password_strength": { + "msg_password_length": "The password length should be at least 8. Please retype" + }, + "validate_int_range": { + "err_not_positive_integer": "That is not a positive integer. Please retype." + }, + "validate_choice": { + "err_invalid_choice": "That is not one of the valid choices. Please retype your choice." + } +} \ No newline at end of file diff --git a/staking_deposit/intl/fr/cli/existing_mnemonic.json b/staking_deposit/intl/fr/cli/existing_mnemonic.json new file mode 100644 index 00000000..0375f61d --- /dev/null +++ b/staking_deposit/intl/fr/cli/existing_mnemonic.json @@ -0,0 +1,23 @@ +{ + "validate_mnemonic": { + "err_invalid_mnemonic": "Ceci n'est pas une phrase mnémonique valide, veuillez vérifier s'il existe des fautes de frappe." + }, + "existing_mnemonic": { + "arg_existing_mnemonic": { + "help": "Générer (ou récupérer) des clés à partir d'une phrase mnémonique existante" + }, + "arg_mnemonic": { + "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.)", + "prompt": "Veuillez saisir votre phrase mnémonique en séparant les mots par des espaces (\" \")" + }, + "arg_mnemonic_password": { + "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.", + "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." + }, + "arg_validator_start_index": { + "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.", + "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.", + "confirm": "Veuillez confirmer le mot de passe." + } + } +} diff --git a/staking_deposit/intl/fr/cli/generate_keys.json b/staking_deposit/intl/fr/cli/generate_keys.json new file mode 100644 index 00000000..ecd328c3 --- /dev/null +++ b/staking_deposit/intl/fr/cli/generate_keys.json @@ -0,0 +1,25 @@ +{ + "generate_keys_arguments_decorator": { + "num_validators": { + "help": "Nombre de clés de validateurs que vous souhaitez générer (vous pourrez en générer davantage plus tard)", + "prompt": "Veuillez choisir le nombre de validateurs que vous souhaitez exécuter" + }, + "chain": { + "help": "Version Ethereum Proof of Stake que vous ciblez. Utilisez \"mainnet\" si vous déposez de l'ETH.", + "prompt": "Veuillez choisir un nom de chaîne/réseau : mainnet (réseau principal) ou testnet (réseau de test)." + }, + "keystore_password": { + "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.)", + "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.", + "confirm": "Veuillez confirmer le mot de passe.", + "mismatch": "Erreur : Les deux valeurs saisies ne correspondent pas. Veuillez réessayer." + } + }, + "generate_keys": { + "msg_key_creation": "Création de vos clés.", + "msg_creation_success": "\nOpération terminée !\nVos clés sont disponibles ici : ", + "msg_pause": "\n\nAppuyez sur n'importe quelle touche.", + "err_verify_keystores": "Impossible de vérifier les keystores.", + "err_verify_deposit": "Impossible de vérifier les fichiers JSON des données de dépôt." + } +} diff --git a/staking_deposit/intl/fr/cli/new_mnemonic.json b/staking_deposit/intl/fr/cli/new_mnemonic.json new file mode 100644 index 00000000..17ddc1bd --- /dev/null +++ b/staking_deposit/intl/fr/cli/new_mnemonic.json @@ -0,0 +1,15 @@ +{ + "new_mnemonic": { + "arg_new_mnemonic": { + "help": "Générer un nouvel élément mnémonique et des clés" + }, + "arg_mnemonic_language": { + "default": "english", + "help": "Langue de votre phrase mnémonique", + "prompt": "Veuillez choisir la langue de votre phrase mnémonique." + }, + "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.", + "msg_press_any_key": "Une fois que vous avez écrit votre phrase mnémonique, appuyez sur n'importe quelle touche.", + "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." + } +} diff --git a/staking_deposit/intl/fr/credentials.json b/staking_deposit/intl/fr/credentials.json new file mode 100644 index 00000000..86c70efb --- /dev/null +++ b/staking_deposit/intl/fr/credentials.json @@ -0,0 +1,14 @@ +{ + "from_mnemonic": { + "msg_key_creation": "Création de vos clés :\t\t" + }, + "export_keystores": { + "msg_keystore_creation": "Création de vos keystores :\t" + }, + "export_deposit_data_json": { + "msg_depositdata_creation": "Création de vos données de dépôt :\t" + }, + "verify_keystores": { + "msg_keystore_verification": "Vérification de vos keystores :\t" + } +} \ No newline at end of file diff --git a/staking_deposit/intl/fr/deposit.json b/staking_deposit/intl/fr/deposit.json new file mode 100644 index 00000000..24220bdc --- /dev/null +++ b/staking_deposit/intl/fr/deposit.json @@ -0,0 +1,5 @@ +{ + "check_python_version": { + "err_python_version": "Votre version de Python est insuffisante. Veuillez installer la version 3.7 ou supérieure." + } +} \ No newline at end of file diff --git a/staking_deposit/intl/fr/utils/validation.json b/staking_deposit/intl/fr/utils/validation.json new file mode 100644 index 00000000..7a76e7bb --- /dev/null +++ b/staking_deposit/intl/fr/utils/validation.json @@ -0,0 +1,8 @@ +{ + "verify_deposit_data_json": { + "msg_deposit_verification": "Vérification de vos dépôts :\t" + }, + "validate_password_strength": { + "msg_password_length": "Le mot de passe doit comporter au moins 8 caractères. Veuillez recommencer." + } +} \ No newline at end of file diff --git a/staking_deposit/intl/id/cli/existing_mnemonic.json b/staking_deposit/intl/id/cli/existing_mnemonic.json new file mode 100644 index 00000000..b03a2a9c --- /dev/null +++ b/staking_deposit/intl/id/cli/existing_mnemonic.json @@ -0,0 +1,23 @@ +{ + "validate_mnemonic": { + "err_invalid_mnemonic": "Bukan mnemonik yang valid, harap pastikan tidak ada kesalahan ketik." + }, + "existing_mnemonic": { + "arg_existing_mnemonic": { + "help": "Buat (atau pulihkan) kunci dari mnemonik yang sudah ada" + }, + "arg_mnemonic": { + "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.)", + "prompt": "Silakan masukkan mnemonik Anda dipisahkan dengan spasi (\" \")" + }, + "arg_mnemonic_password": { + "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.", + "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" + }, + "arg_validator_start_index": { + "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.", + "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.", + "confirm": "Ulangi untuk konfirmasi" + } + } +} diff --git a/staking_deposit/intl/id/cli/generate_keys.json b/staking_deposit/intl/id/cli/generate_keys.json new file mode 100644 index 00000000..d9711e5c --- /dev/null +++ b/staking_deposit/intl/id/cli/generate_keys.json @@ -0,0 +1,25 @@ +{ + "generate_keys_arguments_decorator": { + "num_validators": { + "help": "Jumlah kunci validator yang ingin Anda buat (Anda selalu dapat menghasilkan lebih banyak lagi nanti)", + "prompt": "Silakan pilih berapa banyak validator yang ingin Anda jalankan" + }, + "chain": { + "help": "Versi Ethereum PoS yang Anda targetkan. Gunakan \"mainnet\" jika Anda menyetorkan ETH", + "prompt": "Pilih nama jaringan / rantai (mainnet atau testnet)" + }, + "keystore_password": { + "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.)", + "prompt": "Kata sandi yang akan mengamankan keystore Anda. Anda perlu memasukkan ulang ini untuk mendekripsinya ketika Anda mengatur validator Ethereum PoS Anda.", + "confirm": "Ulangi untuk konfirmasi", + "mismatch": "Kesalahan: dua nilai yang dimasukkan tidak cocok. Silakan ketik ulang." + } + }, + "generate_keys": { + "msg_key_creation": "Membuat kunci Anda.", + "msg_creation_success": "\nSukses!\nKunci Anda dapat ditemukan di: ", + "msg_pause": "\n\nTekan tombol apa saja.", + "err_verify_keystores": "Gagal memverifikasi keystore.", + "err_verify_deposit": "Gagal memverifikasi data setoran file JSON." + } +} diff --git a/staking_deposit/intl/id/cli/new_mnemonic.json b/staking_deposit/intl/id/cli/new_mnemonic.json new file mode 100644 index 00000000..4e2b79e7 --- /dev/null +++ b/staking_deposit/intl/id/cli/new_mnemonic.json @@ -0,0 +1,15 @@ +{ + "new_mnemonic": { + "arg_new_mnemonic": { + "help": "Buat mnemonik dan kunci baru" + }, + "arg_mnemonic_language": { + "default": "english", + "help": "Bahasa mnemonik Anda", + "prompt": "Silakan pilih bahasa mnemonik Anda" + }, + "msg_mnemonic_presentation": "Ini adalah mnemonik Anda (frasa benih). Catat dan simpan dengan aman, ini adalah SATU-SATUNYA cara untuk mengambil deposit Anda.", + "msg_press_any_key": "Tekan sembarang tombol setelah Anda menuliskan mnemonik Anda.", + "msg_mnemonic_retype_prompt": "Harap ketik mnemonik Anda (dipisahkan dengan spasi) untuk mengonfirmasi bahwa Anda telah menuliskannya" + } +} diff --git a/staking_deposit/intl/id/credentials.json b/staking_deposit/intl/id/credentials.json new file mode 100644 index 00000000..5c0fce35 --- /dev/null +++ b/staking_deposit/intl/id/credentials.json @@ -0,0 +1,14 @@ +{ + "from_mnemonic": { + "msg_key_creation": "Membuat kunci Anda:\t\t" + }, + "export_keystores": { + "msg_keystore_creation": "Membuat keystore Anda:\t" + }, + "export_deposit_data_json": { + "msg_depositdata_creation": "Membuat depositdata Anda:\t" + }, + "verify_keystores": { + "msg_keystore_verification": "Memverifikasi keystore Anda:\t" + } +} \ No newline at end of file diff --git a/staking_deposit/intl/id/deposit.json b/staking_deposit/intl/id/deposit.json new file mode 100644 index 00000000..9f4979d2 --- /dev/null +++ b/staking_deposit/intl/id/deposit.json @@ -0,0 +1,5 @@ +{ + "check_python_version": { + "err_python_version": "Versi python Anda tidak cukup, harap instal versi 3.7 atau yang lebih baru." + } +} \ No newline at end of file diff --git a/staking_deposit/intl/id/utils/validation.json b/staking_deposit/intl/id/utils/validation.json new file mode 100644 index 00000000..f2de64f8 --- /dev/null +++ b/staking_deposit/intl/id/utils/validation.json @@ -0,0 +1,8 @@ +{ + "verify_deposit_data_json": { + "msg_deposit_verification": "Memverifikasi deposit Anda:\t" + }, + "validate_password_strength": { + "msg_password_length": "Panjang kata sandi minimal harus 8. Harap ketik ulang" + } +} \ No newline at end of file diff --git a/staking_deposit/intl/it/cli/existing_mnemonic.json b/staking_deposit/intl/it/cli/existing_mnemonic.json new file mode 100644 index 00000000..b27a1752 --- /dev/null +++ b/staking_deposit/intl/it/cli/existing_mnemonic.json @@ -0,0 +1,23 @@ +{ + "validate_mnemonic": { + "err_invalid_mnemonic": "Questo non è un mnemonico valido. Controlla che la grafia sia corretta." + }, + "existing_mnemonic": { + "arg_existing_mnemonic": { + "help": "Genera (o recupera) chiavi da un mnemonico esistente" + }, + "arg_mnemonic": { + "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).", + "prompt": "Inserisci il mnemonico separato da spazi (\" \")" + }, + "arg_mnemonic_password": { + "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.", + "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" + }, + "arg_validator_start_index": { + "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.", + "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.", + "confirm": "Ripeti per conferma" + } + } +} diff --git a/staking_deposit/intl/it/cli/generate_keys.json b/staking_deposit/intl/it/cli/generate_keys.json new file mode 100644 index 00000000..c6255350 --- /dev/null +++ b/staking_deposit/intl/it/cli/generate_keys.json @@ -0,0 +1,25 @@ +{ + "generate_keys_arguments_decorator": { + "num_validators": { + "help": "Il numero di chiavi di validatori che si desidera generare (è sempre possibile generarne altre in seguito)", + "prompt": "Scegli quanti validatori vuoi eseguire" + }, + "chain": { + "help": "La versione desiderata della Ethereum PoS chain. Utilizzare \"mainnet\" se depositano ETH", + "prompt": "Scegli il nome delle rete/catena (rete principale o di test)" + }, + "keystore_password": { + "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).", + "prompt": "La password che proteggerà gli archivi chiavi. Dovrai inserirla nuovamente per decrittografare gli archivi quando configurerai i tuoi validatori.", + "confirm": "Ripeti per conferma", + "mismatch": "Errore: i due valori inseriti non corrispondono. Ripeti l'inserimento." + } + }, + "generate_keys": { + "msg_key_creation": "Creazione delle tue chiavi.", + "msg_creation_success": "\nOperazione riuscita.\nLe tue chiavi si trovano in: ", + "msg_pause": "\n\nPremi qualunque tasto.", + "err_verify_keystores": "Verifica degli archivi chiavi non riuscita.", + "err_verify_deposit": "Verifica dei file JSON dei dati di deposito non riuscita." + } +} diff --git a/staking_deposit/intl/it/cli/new_mnemonic.json b/staking_deposit/intl/it/cli/new_mnemonic.json new file mode 100644 index 00000000..bc528710 --- /dev/null +++ b/staking_deposit/intl/it/cli/new_mnemonic.json @@ -0,0 +1,15 @@ +{ + "new_mnemonic": { + "arg_new_mnemonic": { + "help": "Genera un nuovo mnemonico e chiavi" + }, + "arg_mnemonic_language": { + "default": "Italiano", + "help": "La lingua del mnemonico", + "prompt": "Scegli la lingua del mnemonico" + }, + "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.", + "msg_press_any_key": "Dopo aver preso nota del mnemonico, premi qualsiasi tasto.", + "msg_mnemonic_retype_prompt": "Digita il tuo mnemonico (separato da spazi) per confermare di averlo scritto." + } +} diff --git a/staking_deposit/intl/it/credentials.json b/staking_deposit/intl/it/credentials.json new file mode 100644 index 00000000..ccefe007 --- /dev/null +++ b/staking_deposit/intl/it/credentials.json @@ -0,0 +1,14 @@ +{ + "from_mnemonic": { + "msg_key_creation": "Creazione delle tue chiavi:\t\t" + }, + "export_keystores": { + "msg_keystore_creation": "Creazione dei tuoi archivi chiavi:\t" + }, + "export_deposit_data_json": { + "msg_depositdata_creation": "Creazione dei tuoi dati di deposito:\t" + }, + "verify_keystores": { + "msg_keystore_verification": "Verifica dei tuoi archivi chiavi:\t" + } +} \ No newline at end of file diff --git a/staking_deposit/intl/it/deposit.json b/staking_deposit/intl/it/deposit.json new file mode 100644 index 00000000..c892d630 --- /dev/null +++ b/staking_deposit/intl/it/deposit.json @@ -0,0 +1,5 @@ +{ + "check_python_version": { + "err_python_version": "La tua versione di python non è sufficiente, installa la versione 3.7 o superiore." + } +} \ No newline at end of file diff --git a/staking_deposit/intl/it/utils/validation.json b/staking_deposit/intl/it/utils/validation.json new file mode 100644 index 00000000..ec270c20 --- /dev/null +++ b/staking_deposit/intl/it/utils/validation.json @@ -0,0 +1,8 @@ +{ + "verify_deposit_data_json": { + "msg_deposit_verification": "Verifica dei tuoi depositi:\t" + }, + "validate_password_strength": { + "msg_password_length": "La lunghezza della password deve essere almeno di 8 caratteri. Ripetila" + } +} \ No newline at end of file diff --git a/staking_deposit/intl/ja/cli/existing_mnemonic.json b/staking_deposit/intl/ja/cli/existing_mnemonic.json new file mode 100644 index 00000000..ddb20548 --- /dev/null +++ b/staking_deposit/intl/ja/cli/existing_mnemonic.json @@ -0,0 +1,23 @@ +{ + "validate_mnemonic": { + "err_invalid_mnemonic": "有効なニーモニックではありません。誤字を確認してください。" + }, + "existing_mnemonic": { + "arg_existing_mnemonic": { + "help": "既存のニーモニックからキーを生成(または回復)" + }, + "arg_mnemonic": { + "help": "キーを生成するために使用したニーモニック。 (この引数を使用せずに、CLIからニーモニックの入力が求められるのを待つことを推奨します。そうしないとこれがシェル履歴に表示されてしまいます。)", + "prompt": "スペースで区切られたニーモニックを入力してください (\"\")" + }, + "arg_mnemonic_password": { + "help": "これは、ほぼ間違いなくあなたが探している引数ではありません。キーストアのパスワードではなく、ニーモニックのパスワードです。 最初にこれを使用せずにパスワードを提供すると、キー (資金) が失われる可能性があります! また、最初にこのツールを使用してニーモニックを生成した場合は、ニーモニックパスワードを使用しなかったことに注意してください。 ただし、ニーモニックのセキュリティを「向上させる」ためにパスワードを使用したことが確実であれば、ここで入力します。", + "confirm": "ニーモニックパスワードを使用したことは間違いありませんか? (ニーモニックパスワードはキーストアのパスワードとは異なります! 使用するべきでないときにこのパスワードを使用すると、資金が失われる可能性があります! 確認のために繰り返し入力してください。" + }, + "arg_validator_start_index": { + "help": "さらにキーの生成を開始するインデックス(キー番号)を入力します。 たとえば、過去に4つのキーを生成した場合は、ここに4と入力します。", + "prompt": "さらにキーの生成を開始するインデックス(キー番号)を入力します。 たとえば、過去に4つのキーを生成した場合は、ここに4と入力します。", + "confirm": "確認のために繰り返し入力してください。" + } + } +} diff --git a/staking_deposit/intl/ja/cli/generate_keys.json b/staking_deposit/intl/ja/cli/generate_keys.json new file mode 100644 index 00000000..9882ca94 --- /dev/null +++ b/staking_deposit/intl/ja/cli/generate_keys.json @@ -0,0 +1,25 @@ +{ + "generate_keys_arguments_decorator": { + "num_validators": { + "help": "生成するバリデーターキーの数 (後からいつでも追加で生成できます)", + "prompt": "実行したいバリデーターの数を選択してください" + }, + "chain": { + "help": "ターゲットとしている Ethereum PoS のバージョン。ETH を入金する場合は \"mainnet\" を使用してください。", + "prompt": "(mainnet または testnet) ネットワーク/チェーン名を選択してください" + }, + "keystore_password": { + "help": "キーを生成するために使用したニーモニック。 (この引数を使用せずにCLIからニーモニックの入力が求められるのを待つことをお勧めします。そうしないとシェル履歴に表示されます。)", + "prompt": "キーストアを保護するパスワード。Ethereum PoS バリデーターをセットアップする際に復号化するためにこれを再入力する必要があります。", + "confirm": "確認のために繰り返し入力してください。", + "mismatch": "エラー:入力された2つの値が一致しません。もう一度入力してください。" + } + }, + "generate_keys": { + "msg_key_creation": "キーを作成しています。", + "msg_creation_success": "\n成功しました!\nあなたのキーは次の場所で見つけることができます:", + "msg_pause": "\n任意のキーを押してください。", + "err_verify_keystores": "キーストアの確認に失敗しました。", + "err_verify_deposit": "入金データ JSON ファイルの確認に失敗しました。" + } +} diff --git a/staking_deposit/intl/ja/cli/new_mnemonic.json b/staking_deposit/intl/ja/cli/new_mnemonic.json new file mode 100644 index 00000000..e5cadaac --- /dev/null +++ b/staking_deposit/intl/ja/cli/new_mnemonic.json @@ -0,0 +1,15 @@ +{ + "new_mnemonic": { + "arg_new_mnemonic": { + "help": "新しいニーモニックとキーを生成" + }, + "arg_mnemonic_language": { + "default": "english", + "help": "ニーモニックの言語", + "prompt": "ニーモニックの言語を選択してください" + }, + "msg_mnemonic_presentation": "これはあなたのニーモニック (シードフレーズ) です。書き留めて安全な場所に保管してください。これはあなたのデポジットを取得するための唯一の方法です。", + "msg_press_any_key": "ニーモニックを書き留めたら任意のキーを押してください。", + "msg_mnemonic_retype_prompt": "書き留めた内容を確認するには、スペースで区切ってニーモニックを入力してください。" + } +} diff --git a/staking_deposit/intl/ja/credentials.json b/staking_deposit/intl/ja/credentials.json new file mode 100644 index 00000000..cd0ae78a --- /dev/null +++ b/staking_deposit/intl/ja/credentials.json @@ -0,0 +1,14 @@ +{ + "from_mnemonic": { + "msg_key_creation": "キーを作成しています:\t\t" + }, + "export_keystores": { + "msg_keystore_creation": "キーストアを作成しています:\t" + }, + "export_deposit_data_json": { + "msg_depositdata_creation": "デポジットデータを作成しています:\t" + }, + "verify_keystores": { + "msg_keystore_verification": "キーストアを確認しています:\t" + } +} \ No newline at end of file diff --git a/staking_deposit/intl/ja/deposit.json b/staking_deposit/intl/ja/deposit.json new file mode 100644 index 00000000..1b75d8ad --- /dev/null +++ b/staking_deposit/intl/ja/deposit.json @@ -0,0 +1,5 @@ +{ + "check_python_version": { + "err_python_version": "Python のバージョンが最新ではありません。バージョン 3.7 以降をインストールしてください。" + } +} \ No newline at end of file diff --git a/staking_deposit/intl/ja/utils/validation.json b/staking_deposit/intl/ja/utils/validation.json new file mode 100644 index 00000000..e674fe58 --- /dev/null +++ b/staking_deposit/intl/ja/utils/validation.json @@ -0,0 +1,8 @@ +{ + "verify_deposit_data_json": { + "msg_deposit_verification": "入金確認中:" + }, + "validate_password_strength": { + "msg_password_length": "パスワードの長さは少なくとも8文字でなければなりません。再入力してください" + } +} \ No newline at end of file diff --git a/staking_deposit/intl/ko/cli/existing_mnemonic.json b/staking_deposit/intl/ko/cli/existing_mnemonic.json new file mode 100644 index 00000000..fbb3d810 --- /dev/null +++ b/staking_deposit/intl/ko/cli/existing_mnemonic.json @@ -0,0 +1,23 @@ +{ + "validate_mnemonic": { + "err_invalid_mnemonic": "유효한 니모닉이 아닙니다. 오타가 있는지 확인하세요." + }, + "existing_mnemonic": { + "arg_existing_mnemonic": { + "help": "기존 니모닉에서 키 생성(또는 복구)" + }, + "arg_mnemonic": { + "help": "키를 생성할 때 사용한 니모닉입니다. (이 인수를 사용하지 말고 CLI가 니모닉을 요청할 때까지 기다리는 것이 좋습니다. 기다리지 않으면 셸 기록에 표시되기 때문입니다.)", + "prompt": "니모닉을 공백(\" \")으로 구분하여 입력하세요." + }, + "arg_mnemonic_password": { + "help": "찾고 계신 인수가 확실히 아닌 것 같습니다. 니모닉 비밀번호이지, 키스토어 비밀번호가 아닙니다. 초기에 사용하지 않은 비밀번호를 여기 입력하면 키(당연히 자금도!)를 잃어버릴 수 있습니다. 이 도구를 사용하여 니모닉을 처음 생성한다면 니모닉 비밀번호를 사용한 적이 없을 것입니다. 니모닉의 보안을 \"강화\"하려는 목적으로 비밀번호를 사용했다는 것이 확실할 때만 이 도구를 사용하시기 바랍니다.", + "confirm": "니모닉 비밀번호를 사용한 적이 있다고 확실히 확신하십니까? (키스토어 비밀번호와 다른 것입니다!) 착오로 인해 사용하면 자금을 잃어버릴 수 있습니다! 확인을 위해 동일하게 입력" + }, + "arg_validator_start_index": { + "help": "키를 추가로 생성하기 시작할 인덱스(생성 완료된 키 개수)를 입력하세요. 과거에 생성한 키가 총 4개라면 여기에 4를 입력하면 됩니다.", + "prompt": "키를 추가로 생성하기 시작할 인덱스(생성 완료된 키 개수)를 입력하세요. 과거에 생성한 키가 총 4개라면 여기에 4를 입력하면 됩니다.", + "confirm": "확인을 위해 동일하게 입력" + } + } +} diff --git a/staking_deposit/intl/ko/cli/generate_keys.json b/staking_deposit/intl/ko/cli/generate_keys.json new file mode 100644 index 00000000..631e9274 --- /dev/null +++ b/staking_deposit/intl/ko/cli/generate_keys.json @@ -0,0 +1,25 @@ +{ + "generate_keys_arguments_decorator": { + "num_validators": { + "help": "생성하려는 검증자 키의 개수(나중에 언제든 생성 가능)", + "prompt": "실행하려는 검증자의 개수를 선택하세요." + }, + "chain": { + "help": "타겟팅하려는 Ethereum PoS의 버전입니다. ETH를 예치한다면 \"mainnet\"을 사용하세요.", + "prompt": "(메인넷 또는 테스트넷) 네트워크/체인 이름을 선택하세요." + }, + "keystore_password": { + "help": "키스토어를 안전하게 보호하는 비밀번호입니다. Ethereum PoS 검증자를 셋업할 때 다시 입력하여 복호화해야 합니다. (이 인수를 사용하지 말고 CLI가 니모닉을 요청할 때까지 기다리는 것이 좋습니다. 기다리지 않으면 셸 기록에 표시되기 때문입니다.)", + "prompt": "키스토어를 안전하게 보호하는 비밀번호입니다. Ethereum PoS 검증자를 셋업할 때 다시 입력하여 복호화해야 합니다.", + "confirm": "확인을 위해 동일하게 입력", + "mismatch": "오류: 입력한 두 값이 일치하지 않습니다. 다시 입력하세요." + } + }, + "generate_keys": { + "msg_key_creation": "키 생성 중입니다.", + "msg_creation_success": "\n성공!\n키를 찾을 수 있는 위치: ", + "msg_pause": "\n\n아무 키나 누르세요.", + "err_verify_keystores": "키스토어를 검증하지 못했습니다.", + "err_verify_deposit": "예치금 데이터 JSON 파일을 검증하지 못했습니다." + } +} diff --git a/staking_deposit/intl/ko/cli/new_mnemonic.json b/staking_deposit/intl/ko/cli/new_mnemonic.json new file mode 100644 index 00000000..b8a5c6f3 --- /dev/null +++ b/staking_deposit/intl/ko/cli/new_mnemonic.json @@ -0,0 +1,15 @@ +{ + "new_mnemonic": { + "arg_new_mnemonic": { + "help": "새 니모닉 및 키 생성" + }, + "arg_mnemonic_language": { + "default": "한국어", + "help": "니모닉이 작성된 언어", + "prompt": "니모닉 언어를 선택하세요." + }, + "msg_mnemonic_presentation": "귀하의 니모닉(시드 문구)입니다. 적어두고 안전한 곳에 보관하세요. 예치금을 찾을 수 있는 유일한 수단입니다.", + "msg_press_any_key": "니모닉을 다 적으면 아무 키나 누르세요.", + "msg_mnemonic_retype_prompt": "니모닉을 입력(공백으로 구분)하여 적은 내용을 확인하세요." + } +} diff --git a/staking_deposit/intl/ko/credentials.json b/staking_deposit/intl/ko/credentials.json new file mode 100644 index 00000000..16c256b5 --- /dev/null +++ b/staking_deposit/intl/ko/credentials.json @@ -0,0 +1,14 @@ +{ + "from_mnemonic": { + "msg_key_creation": "키 생성 중:\t\t" + }, + "export_keystores": { + "msg_keystore_creation": "키스토어 생성 중:\t" + }, + "export_deposit_data_json": { + "msg_depositdata_creation": "예치금 데이터 생성 중:\t" + }, + "verify_keystores": { + "msg_keystore_verification": "키스토어 검증 중:\t" + } +} \ No newline at end of file diff --git a/staking_deposit/intl/ko/deposit.json b/staking_deposit/intl/ko/deposit.json new file mode 100644 index 00000000..8bb4a274 --- /dev/null +++ b/staking_deposit/intl/ko/deposit.json @@ -0,0 +1,5 @@ +{ + "check_python_version": { + "err_python_version": "Python 버전이 너무 낮습니다. 3.7 이상 버전을 설치하세요." + } +} \ No newline at end of file diff --git a/staking_deposit/intl/ko/utils/validation.json b/staking_deposit/intl/ko/utils/validation.json new file mode 100644 index 00000000..1c309db3 --- /dev/null +++ b/staking_deposit/intl/ko/utils/validation.json @@ -0,0 +1,8 @@ +{ + "verify_deposit_data_json": { + "msg_deposit_verification": "예치금 검증 중:\t" + }, + "validate_password_strength": { + "msg_password_length": "비밀번호는 8자 이상이어야 합니다. 다시 입력하세요." + } +} \ No newline at end of file diff --git a/staking_deposit/intl/pt-BR/cli/existing_mnemonic.json b/staking_deposit/intl/pt-BR/cli/existing_mnemonic.json new file mode 100644 index 00000000..f96548e5 --- /dev/null +++ b/staking_deposit/intl/pt-BR/cli/existing_mnemonic.json @@ -0,0 +1,23 @@ +{ + "validate_mnemonic": { + "err_invalid_mnemonic": "Isso não é um mnemônico válido. Verifique se há erros de digitação." + }, + "existing_mnemonic": { + "arg_existing_mnemonic": { + "help": "Gerar (ou recuperar) chaves a partir de um mnemônico existente" + }, + "arg_mnemonic": { + "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.)", + "prompt": "Por favor, digite seu mnemônico separado por espaços (\" \")" + }, + "arg_mnemonic_password": { + "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.", + "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" + }, + "arg_validator_start_index": { + "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.", + "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.", + "confirm": "Repita para confirmar" + } + } +} diff --git a/staking_deposit/intl/pt-BR/cli/generate_keys.json b/staking_deposit/intl/pt-BR/cli/generate_keys.json new file mode 100644 index 00000000..d37905e9 --- /dev/null +++ b/staking_deposit/intl/pt-BR/cli/generate_keys.json @@ -0,0 +1,25 @@ +{ + "generate_keys_arguments_decorator": { + "num_validators": { + "help": "A quantidade de chaves de validadores que você deseja gerar (poderá gerar mais depois)", + "prompt": "Por favor, escolha quantos validadores deseja executar" + }, + "chain": { + "help": "A versão de Ethereum PoS do seu interesse. Use \"mainnet\" se estiver depositando ETH", + "prompt": "Selecione o nome da rede/cadeia (mainnet ou testnet)" + }, + "keystore_password": { + "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.)", + "prompt": "A senha que protegerá seus keystores. Você precisará digitá-la para descriptografá-los ao configurar seus validadores Ethereum PoS.", + "confirm": "Repita para confirmar", + "mismatch": "Erro: os dois valores inseridos não coincidem. Digite-os novamente." + } + }, + "generate_keys": { + "msg_key_creation": "Criando suas chaves.", + "msg_creation_success": "\nSuccesso!\nSuas chaves se encontram em: ", + "msg_pause": "\n\nPressione qualquer tecla.", + "err_verify_keystores": "Não foi possível verificar os keystores.", + "err_verify_deposit": "Não foi possível verificar os dados JSON do depósito." + } +} diff --git a/staking_deposit/intl/pt-BR/cli/new_mnemonic.json b/staking_deposit/intl/pt-BR/cli/new_mnemonic.json new file mode 100644 index 00000000..dbada945 --- /dev/null +++ b/staking_deposit/intl/pt-BR/cli/new_mnemonic.json @@ -0,0 +1,15 @@ +{ + "new_mnemonic": { + "arg_new_mnemonic": { + "help": "Gerar um novo mnemônico e chaves" + }, + "arg_mnemonic_language": { + "default": "Português", + "help": "A linguagem do seu mnemônico", + "prompt": "Por favor, escolha o idioma do seu mnemônico" + }, + "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.", + "msg_press_any_key": "Pressione qualquer tecla quando tiver anotado o mnemônico.", + "msg_mnemonic_retype_prompt": "Por favor, digite seu mnemônico (separado por espaços) para confirmar que o anotou" + } +} diff --git a/staking_deposit/intl/pt-BR/credentials.json b/staking_deposit/intl/pt-BR/credentials.json new file mode 100644 index 00000000..953a3ce2 --- /dev/null +++ b/staking_deposit/intl/pt-BR/credentials.json @@ -0,0 +1,14 @@ +{ + "from_mnemonic": { + "msg_key_creation": "Criação das suas chaves:\t\t" + }, + "export_keystores": { + "msg_keystore_creation": "Criação dos seus keystores:\t" + }, + "export_deposit_data_json": { + "msg_depositdata_creation": "Criação dos seus dados de depósito:\t" + }, + "verify_keystores": { + "msg_keystore_verification": "Verificação dos seus keystores:\t" + } +} \ No newline at end of file diff --git a/staking_deposit/intl/pt-BR/deposit.json b/staking_deposit/intl/pt-BR/deposit.json new file mode 100644 index 00000000..4b2fa17e --- /dev/null +++ b/staking_deposit/intl/pt-BR/deposit.json @@ -0,0 +1,5 @@ +{ + "check_python_version": { + "err_python_version": "Sua versão do python é insuficiente, por favor instale a versão 3.7 ou superior." + } +} \ No newline at end of file diff --git a/staking_deposit/intl/pt-BR/utils/validation.json b/staking_deposit/intl/pt-BR/utils/validation.json new file mode 100644 index 00000000..f3caa042 --- /dev/null +++ b/staking_deposit/intl/pt-BR/utils/validation.json @@ -0,0 +1,8 @@ +{ + "verify_deposit_data_json": { + "msg_deposit_verification": "Verificação dos seus depósitos:\t" + }, + "validate_password_strength": { + "msg_password_length": "A senha deve ter pelo menos 8 caracteres. Por favor, digite-a novamente" + } +} \ No newline at end of file diff --git a/staking_deposit/intl/ro/cli/existing_mnemonic.json b/staking_deposit/intl/ro/cli/existing_mnemonic.json new file mode 100644 index 00000000..88e1f557 --- /dev/null +++ b/staking_deposit/intl/ro/cli/existing_mnemonic.json @@ -0,0 +1,23 @@ +{ + "validate_mnemonic": { + "err_invalid_mnemonic": "Acesta nu este un mnemonic corect, verifică dacă e scris corect." + }, + "existing_mnemonic": { + "arg_existing_mnemonic": { + "help": "Generează (sau recuperează) chei dintr-un mnemonic existent" + }, + "arg_mnemonic": { + "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.)", + "prompt": "Introdu mnemonicul, separat cu spații („ ”)" + }, + "arg_mnemonic_password": { + "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.", + "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" + }, + "arg_validator_start_index": { + "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.", + "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.", + "confirm": "Repetă parola, pentru confirmare" + } + } +} diff --git a/staking_deposit/intl/ro/cli/generate_keys.json b/staking_deposit/intl/ro/cli/generate_keys.json new file mode 100644 index 00000000..fe0655e0 --- /dev/null +++ b/staking_deposit/intl/ro/cli/generate_keys.json @@ -0,0 +1,25 @@ +{ + "generate_keys_arguments_decorator": { + "num_validators": { + "help": "Numărul de chei de validator pe care vrei să le generezi (poți genera oricând mai multe)", + "prompt": "Alege câți validatori vrei să rulezi" + }, + "chain": { + "help": "Versiunea de Ethereum PoS țintă. Dacă depui ETH, folosește „mainnet”", + "prompt": "Alege numele de rețea/lanț (mainnet sau testnet)" + }, + "keystore_password": { + "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.)", + "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.", + "confirm": "Repetă parola, pentru confirmare", + "mismatch": "Eroare: cele două valori introduse sunt diferite. Te rugăm să tastezi din nou." + } + }, + "generate_keys": { + "msg_key_creation": "Se creează cheile.", + "msg_creation_success": "\nReușită!\nCheile se găsesc la: ", + "msg_pause": "\n\nApară o tastă oarecare.", + "err_verify_keystores": "Verificarea depozitelor de chei nu a reușit.", + "err_verify_deposit": "Verificarea datelor de depunere a fişierelor JSON a eşuat." + } +} diff --git a/staking_deposit/intl/ro/cli/new_mnemonic.json b/staking_deposit/intl/ro/cli/new_mnemonic.json new file mode 100644 index 00000000..be50f3c1 --- /dev/null +++ b/staking_deposit/intl/ro/cli/new_mnemonic.json @@ -0,0 +1,15 @@ +{ + "new_mnemonic": { + "arg_new_mnemonic": { + "help": "Generează un nou mnemonic și chei" + }, + "arg_mnemonic_language": { + "default": "english", + "help": "Limba mnemonicului", + "prompt": "Alege limba mnemonicului" + }, + "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.", + "msg_press_any_key": "După ce ți-ai notat mnemonicul, apasă orice tastă.", + "msg_mnemonic_retype_prompt": "Tastează mnemonicul (separat cu spații) pentru a confirma faptul că ți l-ai notat" + } +} diff --git a/staking_deposit/intl/ro/credentials.json b/staking_deposit/intl/ro/credentials.json new file mode 100644 index 00000000..f179e1f2 --- /dev/null +++ b/staking_deposit/intl/ro/credentials.json @@ -0,0 +1,14 @@ +{ + "from_mnemonic": { + "msg_key_creation": "Se creează cheile:\t\t" + }, + "export_keystores": { + "msg_keystore_creation": "Se creează depozitele de chei:\t" + }, + "export_deposit_data_json": { + "msg_depositdata_creation": "Se creează datele de depozit:\t" + }, + "verify_keystores": { + "msg_keystore_verification": "Se verifică depozitele de chei:\t" + } +} \ No newline at end of file diff --git a/staking_deposit/intl/ro/deposit.json b/staking_deposit/intl/ro/deposit.json new file mode 100644 index 00000000..991b5070 --- /dev/null +++ b/staking_deposit/intl/ro/deposit.json @@ -0,0 +1,5 @@ +{ + "check_python_version": { + "err_python_version": "Versiunea de python este prea veche, te rugăm să instalezi versiunea 3.7 sau una mai recentă." + } +} \ No newline at end of file diff --git a/staking_deposit/intl/ro/utils/validation.json b/staking_deposit/intl/ro/utils/validation.json new file mode 100644 index 00000000..ad69a6d5 --- /dev/null +++ b/staking_deposit/intl/ro/utils/validation.json @@ -0,0 +1,8 @@ +{ + "verify_deposit_data_json": { + "msg_deposit_verification": "Se verifică depozitele tale:\t" + }, + "validate_password_strength": { + "msg_password_length": "Parola trebuie să aibă o lungime de cel puțin 8. Te rugăm să o reintroduci" + } +} \ No newline at end of file diff --git a/staking_deposit/intl/zh-CN/cli/existing_mnemonic.json b/staking_deposit/intl/zh-CN/cli/existing_mnemonic.json new file mode 100644 index 00000000..e07fac43 --- /dev/null +++ b/staking_deposit/intl/zh-CN/cli/existing_mnemonic.json @@ -0,0 +1,23 @@ +{ + "validate_mnemonic": { + "err_invalid_mnemonic": "这不是一个有效的助记符,请检查有无打字错误。" + }, + "existing_mnemonic": { + "arg_existing_mnemonic": { + "help": "从现有助记符中生成(或恢复)密钥" + }, + "arg_mnemonic": { + "help": "用来生成您密钥的助记符。(建议不要使用此参数,而是等待 CLI 要求您提供您的助记符,否则它将出现在您的 shell 历史中。)", + "prompt": "请输入您的助记符,用空格(“ ”)分隔" + }, + "arg_mnemonic_password": { + "help": "这几乎肯定不是您想要的参数:这里要的是助记密码,而不是密钥库密码。如果您在这里提供一个密码(若您起初没有启用密码),则可能会导致密钥丢失(从而造成资金损失)! 还请注意,如果您起初使用此工具生成了您的助记符,则说明您就没有启用助记密码。然而,如果您确定使用了密码来“增加”您助记符的安全性,则您可以在这里提供一个密码。", + "confirm": "您是否绝对肯定您启用了助记密码?(这不同于密钥库密码!) 如果您不确定启用了助记密码而硬要输入,则可能会造成资金损失! 重复输入以确认" + }, + "arg_validator_start_index": { + "help": "输入您想要开始生成更多密钥的索引(密钥号码)。例如,如果您在过去生成了 4 个密钥,请在此处输入 4。", + "prompt": "输入您想要开始生成更多密钥的索引(密钥号码)。例如,如果您在过去生成了 4 个密钥,请在此处输入 4。", + "confirm": "重复输入以确认" + } + } +} diff --git a/staking_deposit/intl/zh-CN/cli/generate_keys.json b/staking_deposit/intl/zh-CN/cli/generate_keys.json new file mode 100644 index 00000000..7aad8d69 --- /dev/null +++ b/staking_deposit/intl/zh-CN/cli/generate_keys.json @@ -0,0 +1,25 @@ +{ + "generate_keys_arguments_decorator": { + "num_validators": { + "help": "您想要生成的验证者密钥数量(您以后随时可以生成更多密钥)", + "prompt": "请选择您想要运行多少验证者" + }, + "chain": { + "help": "您正在对准的 Ethereum PoS 版本。如果您要存入以太币,请使用 \"mainnet\"", + "prompt": "请选择(主网或测试网)网络名/链名" + }, + "keystore_password": { + "help": "用来保护您密钥库的密码。您在设置您的 Ethereum PoS 验证者时需要重新输入密码以便解密它们。(建议不要使用此参数,而是等待 CLI 要求您提供您的助记符,否则它将出现在您的 shell 历史中。)", + "prompt": "用来保护您密钥库的密码。您在设置您的 Ethereum PoS 验证者时需要重新输入密码以便解密它们。", + "confirm": "重复输入以确认", + "mismatch": "错误:输入的两个值不匹配。请再次输入。" + } + }, + "generate_keys": { + "msg_key_creation": "正在创建您的密钥。", + "msg_creation_success": "\n成功!\n您的密钥可以在这里找到: ", + "msg_pause": "\n\n按任意键。", + "err_verify_keystores": "无法验证密钥库。", + "err_verify_deposit": "无法验证存款数据 JSON 文件。" + } +} diff --git a/staking_deposit/intl/zh-CN/cli/new_mnemonic.json b/staking_deposit/intl/zh-CN/cli/new_mnemonic.json new file mode 100644 index 00000000..1766ea4e --- /dev/null +++ b/staking_deposit/intl/zh-CN/cli/new_mnemonic.json @@ -0,0 +1,15 @@ +{ + "new_mnemonic": { + "arg_new_mnemonic": { + "help": "生成一个新的助记符和密钥" + }, + "arg_mnemonic_language": { + "default": "简体中文", + "help": "您的助记符所使用的语言", + "prompt": "请选择您的助记符语言" + }, + "msg_mnemonic_presentation": "这是您的助记符(助记词)。请记下它并存放在安全的地方,它是取回您存款的唯一方式。", + "msg_press_any_key": "在您记下助记符后,按任意键。", + "msg_mnemonic_retype_prompt": "请输入您的助记符(用空格分隔)以确认您已记下了" + } +} diff --git a/staking_deposit/intl/zh-CN/credentials.json b/staking_deposit/intl/zh-CN/credentials.json new file mode 100644 index 00000000..15c7bddc --- /dev/null +++ b/staking_deposit/intl/zh-CN/credentials.json @@ -0,0 +1,14 @@ +{ + "from_mnemonic": { + "msg_key_creation": "正在创建您的密钥:\t\t" + }, + "export_keystores": { + "msg_keystore_creation": "正在创建您的密钥库:\t" + }, + "export_deposit_data_json": { + "msg_depositdata_creation": "正在创建您的存款数据:" + }, + "verify_keystores": { + "msg_keystore_verification": "正在验证您的密钥库:" + } +} \ No newline at end of file diff --git a/staking_deposit/intl/zh-CN/deposit.json b/staking_deposit/intl/zh-CN/deposit.json new file mode 100644 index 00000000..6d8766e2 --- /dev/null +++ b/staking_deposit/intl/zh-CN/deposit.json @@ -0,0 +1,5 @@ +{ + "check_python_version": { + "err_python_version": "您的 python 版本不足,请安装 3.7 或以上版本。" + } +} \ No newline at end of file diff --git a/staking_deposit/intl/zh-CN/utils/validation.json b/staking_deposit/intl/zh-CN/utils/validation.json new file mode 100644 index 00000000..f13801f2 --- /dev/null +++ b/staking_deposit/intl/zh-CN/utils/validation.json @@ -0,0 +1,8 @@ +{ + "verify_deposit_data_json": { + "msg_deposit_verification": "正在验证您的存款:\t" + }, + "validate_password_strength": { + "msg_password_length": "密码长度至少应为 8。请重新输入" + } +} \ No newline at end of file diff --git a/eth2deposit/key_handling/key_derivation/__init__.py b/staking_deposit/key_handling/__init__.py similarity index 100% rename from eth2deposit/key_handling/key_derivation/__init__.py rename to staking_deposit/key_handling/__init__.py diff --git a/eth2deposit/utils/__init__.py b/staking_deposit/key_handling/key_derivation/__init__.py similarity index 100% rename from eth2deposit/utils/__init__.py rename to staking_deposit/key_handling/key_derivation/__init__.py diff --git a/eth2deposit/key_handling/key_derivation/mnemonic.py b/staking_deposit/key_handling/key_derivation/mnemonic.py similarity index 82% rename from eth2deposit/key_handling/key_derivation/mnemonic.py rename to staking_deposit/key_handling/key_derivation/mnemonic.py index 756ec5eb..c93c37f4 100644 --- a/eth2deposit/key_handling/key_derivation/mnemonic.py +++ b/staking_deposit/key_handling/key_derivation/mnemonic.py @@ -1,30 +1,21 @@ import os -import sys from unicodedata import normalize from secrets import randbits from typing import ( Optional, Sequence, - Tuple, ) -from eth2deposit.utils.crypto import ( +from staking_deposit.utils.constants import ( + MNEMONIC_LANG_OPTIONS, +) +from staking_deposit.utils.crypto import ( SHA256, PBKDF2, ) - - -def _resource_path(relative_path: str) -> str: - """ - Get the absolute path to a resource in a manner friendly to PyInstaller. - PyInstaller creates a temp folder and stores path in _MEIPASS which this function swaps - into a resource path so it is avaible both when building binaries and running natively. - """ - try: - base_path = sys._MEIPASS # type: ignore - except Exception: - base_path = os.path.abspath(".") - return os.path.join(base_path, relative_path) +from staking_deposit.utils.file_handling import ( + resource_path, +) def _get_word_list(language: str, path: str) -> Sequence[str]: @@ -33,7 +24,7 @@ def _get_word_list(language: str, path: str) -> Sequence[str]: Ref: https://github.com/bitcoin/bips/blob/master/bip-0039/bip-0039-wordlists.md """ - path = _resource_path(path) + path = resource_path(path) dirty_list = open(os.path.join(path, '%s.txt' % language), encoding='utf-8').readlines() return [word.replace('\n', '') for word in dirty_list] @@ -69,23 +60,12 @@ def get_seed(*, mnemonic: str, password: str) -> bytes: return PBKDF2(password=encoded_mnemonic, salt=salt, dklen=64, c=2048, prf='sha512') -def get_languages(path: str) -> Tuple[str, ...]: - """ - Walk the `path` and list all the languages with word-lists available. - """ - path = _resource_path(path) - (_, _, filenames) = next(os.walk(path)) - filenames = [f for f in filenames if f[-4:] == '.txt'] - languages = tuple([name[:-4] for name in filenames]) - return languages - - def determine_mnemonic_language(mnemonic: str, words_path: str) -> Sequence[str]: """ Given a `mnemonic` determine what language[s] it is written in. There are collisions between word-lists, so multiple candidate languages are returned. """ - languages = get_languages(words_path) + languages = MNEMONIC_LANG_OPTIONS.keys() word_language_map = {word: lang for lang in languages for word in _get_word_list(lang, words_path)} try: mnemonic_list = mnemonic.split(' ') diff --git a/eth2deposit/key_handling/key_derivation/path.py b/staking_deposit/key_handling/key_derivation/path.py similarity index 100% rename from eth2deposit/key_handling/key_derivation/path.py rename to staking_deposit/key_handling/key_derivation/path.py diff --git a/eth2deposit/key_handling/key_derivation/tree.py b/staking_deposit/key_handling/key_derivation/tree.py similarity index 98% rename from eth2deposit/key_handling/key_derivation/tree.py rename to staking_deposit/key_handling/key_derivation/tree.py index 390097f1..53fcd0ec 100644 --- a/eth2deposit/key_handling/key_derivation/tree.py +++ b/staking_deposit/key_handling/key_derivation/tree.py @@ -1,4 +1,4 @@ -from eth2deposit.utils.crypto import ( +from staking_deposit.utils.crypto import ( HKDF, SHA256, ) diff --git a/eth2deposit/key_handling/key_derivation/word_lists/chinese_simplified.txt b/staking_deposit/key_handling/key_derivation/word_lists/chinese_simplified.txt similarity index 100% rename from eth2deposit/key_handling/key_derivation/word_lists/chinese_simplified.txt rename to staking_deposit/key_handling/key_derivation/word_lists/chinese_simplified.txt diff --git a/eth2deposit/key_handling/key_derivation/word_lists/chinese_traditional.txt b/staking_deposit/key_handling/key_derivation/word_lists/chinese_traditional.txt similarity index 100% rename from eth2deposit/key_handling/key_derivation/word_lists/chinese_traditional.txt rename to staking_deposit/key_handling/key_derivation/word_lists/chinese_traditional.txt diff --git a/eth2deposit/key_handling/key_derivation/word_lists/czech.txt b/staking_deposit/key_handling/key_derivation/word_lists/czech.txt similarity index 100% rename from eth2deposit/key_handling/key_derivation/word_lists/czech.txt rename to staking_deposit/key_handling/key_derivation/word_lists/czech.txt diff --git a/eth2deposit/key_handling/key_derivation/word_lists/english.txt b/staking_deposit/key_handling/key_derivation/word_lists/english.txt similarity index 100% rename from eth2deposit/key_handling/key_derivation/word_lists/english.txt rename to staking_deposit/key_handling/key_derivation/word_lists/english.txt diff --git a/eth2deposit/key_handling/key_derivation/word_lists/italian.txt b/staking_deposit/key_handling/key_derivation/word_lists/italian.txt similarity index 100% rename from eth2deposit/key_handling/key_derivation/word_lists/italian.txt rename to staking_deposit/key_handling/key_derivation/word_lists/italian.txt diff --git a/eth2deposit/key_handling/key_derivation/word_lists/korean.txt b/staking_deposit/key_handling/key_derivation/word_lists/korean.txt similarity index 100% rename from eth2deposit/key_handling/key_derivation/word_lists/korean.txt rename to staking_deposit/key_handling/key_derivation/word_lists/korean.txt diff --git a/eth2deposit/key_handling/key_derivation/word_lists/portuguese.txt b/staking_deposit/key_handling/key_derivation/word_lists/portuguese.txt similarity index 100% rename from eth2deposit/key_handling/key_derivation/word_lists/portuguese.txt rename to staking_deposit/key_handling/key_derivation/word_lists/portuguese.txt diff --git a/eth2deposit/key_handling/key_derivation/word_lists/spanish.txt b/staking_deposit/key_handling/key_derivation/word_lists/spanish.txt similarity index 100% rename from eth2deposit/key_handling/key_derivation/word_lists/spanish.txt rename to staking_deposit/key_handling/key_derivation/word_lists/spanish.txt diff --git a/eth2deposit/key_handling/keystore.py b/staking_deposit/key_handling/keystore.py similarity index 98% rename from eth2deposit/key_handling/keystore.py rename to staking_deposit/key_handling/keystore.py index 6e9c122d..75bcddba 100644 --- a/eth2deposit/key_handling/keystore.py +++ b/staking_deposit/key_handling/keystore.py @@ -12,13 +12,13 @@ from unicodedata import normalize from uuid import uuid4 -from eth2deposit.utils.crypto import ( +from staking_deposit.utils.crypto import ( AES_128_CTR, PBKDF2, scrypt, SHA256, ) -from eth2deposit.utils.constants import ( +from staking_deposit.utils.constants import ( UNICODE_CONTROL_CHARS, ) diff --git a/staking_deposit/settings.py b/staking_deposit/settings.py new file mode 100644 index 00000000..abf5c973 --- /dev/null +++ b/staking_deposit/settings.py @@ -0,0 +1,37 @@ +from typing import Dict, NamedTuple + + +DEPOSIT_CLI_VERSION = '2.0.0' + + +class BaseChainSetting(NamedTuple): + NETWORK_NAME: str + GENESIS_FORK_VERSION: bytes + + +MAINNET = 'mainnet' +PRATER = 'prater' +KINTSUGI = 'kintsugi' +KILN = 'kiln' + + +# Mainnet setting +MainnetSetting = BaseChainSetting(NETWORK_NAME=MAINNET, GENESIS_FORK_VERSION=bytes.fromhex('00000000')) +# Testnet (spec v1.0.1) +PraterSetting = BaseChainSetting(NETWORK_NAME=PRATER, GENESIS_FORK_VERSION=bytes.fromhex('00001020')) +# Merge Testnet (spec v1.1.4) +KintsugiSetting = BaseChainSetting(NETWORK_NAME=KINTSUGI, GENESIS_FORK_VERSION=bytes.fromhex('60000069')) +# Merge Testnet (spec v1.1.9) +KilnSetting = BaseChainSetting(NETWORK_NAME=KILN, GENESIS_FORK_VERSION=bytes.fromhex('70000069')) + + +ALL_CHAINS: Dict[str, BaseChainSetting] = { + MAINNET: MainnetSetting, + PRATER: PraterSetting, + KINTSUGI: KintsugiSetting, + KILN: KilnSetting, +} + + +def get_chain_setting(chain_name: str = MAINNET) -> BaseChainSetting: + return ALL_CHAINS[chain_name] diff --git a/staking_deposit/utils/__init__.py b/staking_deposit/utils/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/eth2deposit/utils/ascii_art.py b/staking_deposit/utils/ascii_art.py similarity index 100% rename from eth2deposit/utils/ascii_art.py rename to staking_deposit/utils/ascii_art.py diff --git a/staking_deposit/utils/click.py b/staking_deposit/utils/click.py new file mode 100644 index 00000000..8b9b2ae3 --- /dev/null +++ b/staking_deposit/utils/click.py @@ -0,0 +1,116 @@ +import click +from typing import ( + Any, + Callable, + Optional, + Sequence, + Tuple, + Union, +) + +from staking_deposit.exceptions import ValidationError +from staking_deposit.utils import config + + +def _value_of(f: Union[Callable[[], Any], Any]) -> Any: + ''' + If the input, f, is a function, return f(), else return f. + ''' + return(f() if callable(f) else f) + + +class JITOption(click.Option): + ''' + A click.Option, except certain values are recomputed before they are used. + ''' + def __init__( + self, + param_decls: str, + default: Union[Callable[[], Any], None, Any] = None, + help: Union[Callable[[], str], str, None] = None, + prompt: Union[Callable[[], str], str, None] = None, + **kwargs: Any, + ): + + self.callable_default = default + self.callable_help = help + self.callable_prompt = prompt + + return super().__init__( + param_decls=[_value_of(param_decls)], + default=_value_of(default), + help=_value_of(help), + prompt=_value_of(prompt), + **kwargs, + ) + + def prompt_for_value(self, ctx: click.Context) -> Any: + self.prompt = _value_of(self.callable_prompt) + return super().prompt_for_value(ctx) + + def get_help_record(self, ctx: click.Context) -> Tuple[str, str]: + self.help = _value_of(self.callable_help) + return super().get_help_record(ctx) + + def get_default(self, ctx: click.Context) -> Any: + self.default = _value_of(self.callable_default) + return super().get_default(ctx) + + +def jit_option(*args: Any, **kwargs: Any) -> Callable[[Any], Any]: + """Attaches an option to the command. All positional arguments are + passed as parameter declarations to :class:`Option`; all keyword + arguments are forwarded unchanged (except ``cls``). + This is equivalent to creating an :class:`Option` instance manually + and attaching it to the :attr:`Command.params` list. + + :param cls: the option class to instantiate. This defaults to + :class:`Option`. + """ + + def decorator(f: Callable[[Any], Any]) -> Callable[[Any], Any]: + click.decorators._param_memo(f, JITOption(*args, **kwargs)) + return f + + return decorator + + +def captive_prompt_callback( + processing_func: Callable[[str], Any], + prompt: Callable[[], str], + confirmation_prompt: Optional[Callable[[], str]]=None, + confirmation_mismatch_msg: Callable[[], str]=lambda: '', + hide_input: bool=False, +) -> Callable[[click.Context, str, str], Any]: + ''' + Traps the user in a prompt until the value chosen is acceptable + as defined by `processing_func` not returning a ValidationError + :param processing_func: A function to process the user's input that possibly raises a ValidationError + :param prompt: the text to prompt the user with, should their input raise an error when passed to processing_func() + :param confirmation_prompt: the optional prompt for confirming user input (the user must repeat their input) + :param confirmation_mismatch_msg: the message displayed to the user should their input and confirmation not match + :param hide_input: bool, hides the input as the user types + ''' + def callback(ctx: click.Context, param: Any, user_input: str) -> Any: + if config.non_interactive: + return processing_func(user_input) + while True: + try: + processed_input = processing_func(user_input) + # Logic for confirming user input: + if confirmation_prompt is not None and processed_input != '': + confirmation_input = click.prompt(confirmation_prompt(), hide_input=hide_input) + if processing_func(confirmation_input) != processed_input: + raise ValidationError(confirmation_mismatch_msg()) + return processed_input + except ValidationError as e: + click.echo(e) + user_input = click.prompt(prompt(), hide_input=hide_input) + return callback + + +def choice_prompt_func(prompt_func: Callable[[], str], choices: Sequence[str]) -> Callable[[], str]: + ''' + Formats the prompt and choices in a printable manner. + ''' + return lambda: '%s %s: ' % (prompt_func(), choices) diff --git a/staking_deposit/utils/config.py b/staking_deposit/utils/config.py new file mode 100644 index 00000000..2dce13cd --- /dev/null +++ b/staking_deposit/utils/config.py @@ -0,0 +1,6 @@ +''' +This file contains global variables to required to parameterise click functionality +''' + +language = 'en' # The CLI language selected by the user +non_interactive = False # Whether or not to interactively prompt the user for input. (Useful for tests and debugging) diff --git a/staking_deposit/utils/constants.py b/staking_deposit/utils/constants.py new file mode 100644 index 00000000..42015bb0 --- /dev/null +++ b/staking_deposit/utils/constants.py @@ -0,0 +1,66 @@ +import os +from typing import ( + Dict, + List, +) + + +ZERO_BYTES32 = b'\x00' * 32 + +# Execution-spec constants taken from https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md +DOMAIN_DEPOSIT = bytes.fromhex('03000000') +BLS_WITHDRAWAL_PREFIX = bytes.fromhex('00') +ETH1_ADDRESS_WITHDRAWAL_PREFIX = bytes.fromhex('01') + +ETH2GWEI = 10 ** 9 +MIN_DEPOSIT_AMOUNT = 2 ** 0 * ETH2GWEI +MAX_DEPOSIT_AMOUNT = 2 ** 5 * ETH2GWEI + + +# File/folder constants +WORD_LISTS_PATH = os.path.join('staking_deposit', 'key_handling', 'key_derivation', 'word_lists') +DEFAULT_VALIDATOR_KEYS_FOLDER_NAME = 'validator_keys' + +# Internationalisation constants +INTL_CONTENT_PATH = os.path.join('staking_deposit', 'intl') + + +def _add_index_to_options(d: Dict[str, List[str]]) -> Dict[str, List[str]]: + ''' + Adds the (1 indexed) index (in the dict) to the first element of value list. + eg. {'en': ['English', 'en']} -> {'en': ['1. English', '1', 'English', 'en']} + Requires dicts to be ordered (Python > 3.6) + ''' + keys = list(d.keys()) # Force copy dictionary keys top prevent iteration over changing dict + for i, key in enumerate(keys): + d.update({key: ['%s. %s' % (i + 1, d[key][0]), str(i + 1)] + d[key]}) + return d + + +INTL_LANG_OPTIONS = _add_index_to_options({ + 'ar': ['العربية', 'ar', 'Arabic'], + 'el': ['ελληνικά', 'el', 'Greek'], + 'en': ['English', 'en'], + 'fr': ['Français', 'Francais', 'fr', 'French'], + 'id': ['Bahasa melayu', 'Melayu', 'id', 'Malay'], + 'it': ['Italiano', 'it', 'Italian'], + 'ja': ['日本語', 'ja', 'Japanese'], + 'ko': ['한국어', '조선말', '韓國語', 'ko', 'Korean'], + 'pt-BR': ['Português do Brasil', 'Brasil', 'pt-BR', 'Brazilian Portuguese'], + 'ro': ['român', 'limba română', 'ro', 'Romainian'], + 'zh-CN': ['简体中文', 'zh-CN', 'zh', 'Chinease'], +}) +MNEMONIC_LANG_OPTIONS = _add_index_to_options({ + 'chinese_simplified': ['简体中文', 'zh', 'zh-CN', 'Chinese Simplified'], + 'chinese_traditional': ['繁體中文', 'zh-tw', 'Chinese Traditional'], + 'czech': ['čeština', 'český jazyk', 'cs', 'Czech'], + 'english': ['English', 'en'], + 'italian': ['Italiano', 'it', 'Italian'], + 'korean': ['한국어', '조선말', '韓國語', 'ko', 'Korean'], + # Portuguese mnemonics are in both pt & pt-BR + 'portuguese': ['Português', 'Português do Brasil', 'pt', 'pt-BR', 'Portuguese'], + 'spanish': ['Español', 'es', 'Spanish'], +}) + +# Sundry constants +UNICODE_CONTROL_CHARS = list(range(0x00, 0x20)) + list(range(0x7F, 0xA0)) diff --git a/eth2deposit/utils/crypto.py b/staking_deposit/utils/crypto.py similarity index 100% rename from eth2deposit/utils/crypto.py rename to staking_deposit/utils/crypto.py diff --git a/staking_deposit/utils/file_handling.py b/staking_deposit/utils/file_handling.py new file mode 100644 index 00000000..f0142491 --- /dev/null +++ b/staking_deposit/utils/file_handling.py @@ -0,0 +1,15 @@ +import os +import sys + + +def resource_path(relative_path: str) -> str: + """ + Get the absolute path to a resource in a manner friendly to PyInstaller. + PyInstaller creates a temp folder and stores path in _MEIPASS which this function swaps + into a resource path so it is available both when building binaries and running natively. + """ + try: + base_path = sys._MEIPASS # type: ignore + except Exception: + base_path = os.path.abspath(".") + return os.path.join(base_path, relative_path) diff --git a/staking_deposit/utils/intl.py b/staking_deposit/utils/intl.py new file mode 100644 index 00000000..b92e6a73 --- /dev/null +++ b/staking_deposit/utils/intl.py @@ -0,0 +1,103 @@ +import inspect +import difflib +from functools import reduce +import json +from typing import ( + Any, + Dict, + Iterable, + List, + Mapping, + Sequence, +) +import os + +from staking_deposit.utils import config +from staking_deposit.utils.constants import ( + INTL_CONTENT_PATH, +) +from staking_deposit.utils.file_handling import ( + resource_path, +) +from staking_deposit.exceptions import ValidationError + + +def _get_from_dict(dataDict: Dict[str, Any], mapList: Iterable[str]) -> str: + ''' + Iterate nested dictionaries + ''' + try: + ans = reduce(dict.get, mapList, dataDict) + assert isinstance(ans, str) + return ans + except TypeError: + raise KeyError('%s not in internationalisation json file.' % mapList) + except AssertionError: + raise KeyError('The provided params (%s) were incomplete.' % mapList) + + +def load_text(params: List[str], file_path: str='', func: str='', lang: str='') -> str: + ''' + Determine and return the appropriate internationalisation text for a given set of `params`. + ''' + if file_path == '': + # Auto-detect file-path based on call stack + file_path = inspect.stack()[1].filename + if file_path[-4:] == '.pyc': + file_path = file_path[:-4] + '.json' # replace .pyc with .json + elif file_path[-3:] == '.py': + file_path = file_path[:-3] + '.json' # replace .py with .json + else: + raise KeyError("Wrong file_path %s", file_path) + + if func == '': + # Auto-detect function based on call stack + func = inspect.stack()[1].function + + if lang == '': + lang = config.language + + # Determine path to json text + file_path_list = os.path.normpath(file_path).split(os.path.sep) + rel_path_list = file_path_list[file_path_list.index('staking_deposit') + 1:] + json_path = resource_path(os.path.join(INTL_CONTENT_PATH, lang, *rel_path_list)) + + try: + # browse json until text is found + with open(json_path) as f: + text_dict = json.load(f) + return _get_from_dict(text_dict, [func] + params) + except (KeyError, FileNotFoundError): + # If text not found in lang, try return English version + if lang == 'en': + raise KeyError('%s not in %s file' % ([func] + params, json_path)) + return load_text(params, file_path, func, 'en') + + +def get_first_options(options: Mapping[str, Sequence[str]]) -> List[str]: + ''' + Returns the first `option` in the values of the `options` dict. + ''' + return list(map(lambda x: x[0], options.values())) + + +def closest_match(text: str, options: Iterable[str]) -> str: + ''' + Finds the closest match to `text` in the `options_list` + ''' + match = difflib.get_close_matches(text, options, n=1, cutoff=0.6) + if len(match) == 0: + raise ValidationError('%s is not a valid language option' % text) + return match[0] + + +def fuzzy_reverse_dict_lookup(text: str, options: Mapping[str, Sequence[str]]) -> str: + ''' + Returns the closest match to `text` out of the `options` + :param text: The test string that needs to be found + :param options: A dict with keys (the value that will be returned) + and values a list of the options to be matched against + ''' + reverse_lookup_dict = {value: key for key, values in options.items() for value in values} + match = closest_match(text, reverse_lookup_dict.keys()) + return reverse_lookup_dict[match] diff --git a/eth2deposit/utils/ssz.py b/staking_deposit/utils/ssz.py similarity index 86% rename from eth2deposit/utils/ssz.py rename to staking_deposit/utils/ssz.py index 8a0b6895..e079a007 100644 --- a/eth2deposit/utils/ssz.py +++ b/staking_deposit/utils/ssz.py @@ -7,7 +7,7 @@ bytes48, bytes96 ) -from eth2deposit.utils.constants import ( +from staking_deposit.utils.constants import ( DOMAIN_DEPOSIT, ZERO_BYTES32, ) @@ -59,7 +59,7 @@ def compute_signing_root(ssz_object: Serializable, domain: bytes) -> bytes: """ Return the signing root of an object by calculating the root of the object-domain tree. The root is the hash tree root of: - https://github.com/ethereum/eth2.0-specs/blob/dev/specs/phase0/beacon-chain.md#signingdata + https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#signingdata """ if len(domain) != 32: raise ValueError(f"Domain should be in 32 bytes. Got {len(domain)}.") @@ -72,7 +72,7 @@ def compute_signing_root(ssz_object: Serializable, domain: bytes) -> bytes: class DepositMessage(Serializable): """ - Ref: https://github.com/ethereum/eth2.0-specs/blob/dev/specs/phase0/beacon-chain.md#depositmessage + Ref: https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#depositmessage """ fields = [ ('pubkey', bytes48), @@ -83,7 +83,7 @@ class DepositMessage(Serializable): class DepositData(Serializable): """ - Ref: https://github.com/ethereum/eth2.0-specs/blob/dev/specs/phase0/beacon-chain.md#depositdata + Ref: https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#depositdata """ fields = [ ('pubkey', bytes48), diff --git a/eth2deposit/utils/validation.py b/staking_deposit/utils/validation.py similarity index 72% rename from eth2deposit/utils/validation.py rename to staking_deposit/utils/validation.py index 23a513d8..d3bdd7ab 100644 --- a/eth2deposit/utils/validation.py +++ b/staking_deposit/utils/validation.py @@ -8,23 +8,24 @@ from py_ecc.bls import G2ProofOfPossession as bls -from eth2deposit.exceptions import ValidationError -from eth2deposit.utils.ssz import ( +from staking_deposit.exceptions import ValidationError +from staking_deposit.utils.intl import load_text +from staking_deposit.utils.ssz import ( compute_deposit_domain, compute_signing_root, DepositData, DepositMessage, ) -from eth2deposit.credentials import ( +from staking_deposit.credentials import ( Credential, ) -from eth2deposit.utils.constants import ( +from staking_deposit.utils.constants import ( MAX_DEPOSIT_AMOUNT, MIN_DEPOSIT_AMOUNT, BLS_WITHDRAWAL_PREFIX, ETH1_ADDRESS_WITHDRAWAL_PREFIX, ) -from eth2deposit.utils.crypto import SHA256 +from staking_deposit.utils.crypto import SHA256 def verify_deposit_data_json(filefolder: str, credentials: Sequence[Credential]) -> bool: @@ -33,7 +34,7 @@ def verify_deposit_data_json(filefolder: str, credentials: Sequence[Credential]) """ with open(filefolder, 'r') as f: deposit_json = json.load(f) - with click.progressbar(deposit_json, label='Verifying your deposits:\t', + with click.progressbar(deposit_json, label=load_text(['msg_deposit_verification']), show_percent=False, show_pos=True) as deposits: return all([validate_deposit(deposit, credential) for deposit, credential in zip(deposits, credentials)]) return False @@ -41,8 +42,8 @@ def verify_deposit_data_json(filefolder: str, credentials: Sequence[Credential]) def validate_deposit(deposit_data_dict: Dict[str, Any], credential: Credential) -> bool: ''' - Checks whether a deposit is valid based on the eth2 rules. - https://github.com/ethereum/eth2.0-specs/blob/dev/specs/phase0/beacon-chain.md#deposits + Checks whether a deposit is valid based on the staking deposit rules. + https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#deposits ''' pubkey = BLSPubkey(bytes.fromhex(deposit_data_dict['pubkey'])) withdrawal_credentials = bytes.fromhex(deposit_data_dict['withdrawal_credentials']) @@ -94,6 +95,20 @@ def validate_deposit(deposit_data_dict: Dict[str, Any], credential: Credential) return signed_deposit.hash_tree_root == deposit_message_root -def validate_password_strength(password: str) -> None: +def validate_password_strength(password: str) -> str: if len(password) < 8: - raise ValidationError(f"The password length should be at least 8. Got {len(password)}.") + raise ValidationError(load_text(['msg_password_length'])) + return password + + +def validate_int_range(num: Any, low: int, high: int) -> int: + ''' + Verifies that `num` is an `int` andlow <= num < high + ''' + try: + num_int = int(num) # Try cast to int + assert num_int == float(num) # Check num is not float + assert low <= num_int < high # Check num in range + return num_int + except (ValueError, AssertionError): + raise ValidationError(load_text(['err_not_positive_integer'])) diff --git a/test_binary_script.py b/test_binary_script.py new file mode 100755 index 00000000..e041d0aa --- /dev/null +++ b/test_binary_script.py @@ -0,0 +1,76 @@ +import asyncio +import os +import sys + + +# For not importing staking_deposit here +DEFAULT_VALIDATOR_KEYS_FOLDER_NAME = 'validator_keys' + + +async def main(argv): + binary_file_path = argv[1] + my_folder_path = os.path.join(os.getcwd(), 'TESTING_TEMP_FOLDER') + if not os.path.exists(my_folder_path): + os.mkdir(my_folder_path) + + if os.name == 'nt': # Windows + run_script_cmd = ".\\" + binary_file_path + '\deposit.exe' + else: # Mac or Linux + run_script_cmd = './' + binary_file_path + '/deposit' + + cmd_args = [ + run_script_cmd, + '--language', 'english', + '--non_interactive', + 'new-mnemonic', + '--num_validators', '1', + '--mnemonic_language', 'english', + '--chain', 'mainnet', + '--keystore_password', 'MyPassword', + '--folder', my_folder_path, + ] + proc = await asyncio.create_subprocess_shell( + ' '.join(cmd_args), + stdin=asyncio.subprocess.PIPE, + stdout=asyncio.subprocess.PIPE, + stderr=asyncio.subprocess.PIPE, + ) + seed_phrase = '' + parsing = False + async for out in proc.stdout: + output = out.decode('utf-8').rstrip() + if output.startswith("This is your mnemonic"): + parsing = True + elif output.startswith("Please type your mnemonic"): + parsing = False + elif parsing: + seed_phrase += output + if len(seed_phrase) > 0: + encoded_phrase = seed_phrase.encode() + proc.stdin.write(encoded_phrase) + proc.stdin.write(b'\n') + print(output) + + async for out in proc.stderr: + output = out.decode('utf-8').rstrip() + print(f'[stderr] {output}') + + assert len(seed_phrase) > 0 + + # Check files + validator_keys_folder_path = os.path.join(my_folder_path, DEFAULT_VALIDATOR_KEYS_FOLDER_NAME) + _, _, key_files = next(os.walk(validator_keys_folder_path)) + + # Clean up + for key_file_name in key_files: + os.remove(os.path.join(validator_keys_folder_path, key_file_name)) + os.rmdir(validator_keys_folder_path) + os.rmdir(my_folder_path) + + +if os.name == 'nt': # Windows + loop = asyncio.ProactorEventLoop() + asyncio.set_event_loop(loop) + loop.run_until_complete(main(sys.argv)) +else: + asyncio.run(main(sys.argv)) diff --git a/test_deposit_script.py b/test_deposit_script.py index e4682642..66317aa5 100755 --- a/test_deposit_script.py +++ b/test_deposit_script.py @@ -1,7 +1,7 @@ import asyncio import os -# For not importing eth2deposit here +# For not importing staking_deposit here DEFAULT_VALIDATOR_KEYS_FOLDER_NAME = 'validator_keys' @@ -24,7 +24,10 @@ async def main(): print('[INFO] Installed') cmd_args = [ - run_script_cmd + ' new-mnemonic', + run_script_cmd, + '--language', 'english', + '--non_interactive', + 'new-mnemonic', '--num_validators', '1', '--mnemonic_language', 'english', '--chain', 'mainnet', @@ -41,7 +44,7 @@ async def main(): parsing = False async for out in proc.stdout: output = out.decode('utf-8').rstrip() - if output.startswith("This is your seed phrase."): + if output.startswith("This is your mnemonic"): parsing = True elif output.startswith("Please type your mnemonic"): parsing = False diff --git a/tests/test_cli/helpers.py b/tests/test_cli/helpers.py index 5d43d959..127e04a1 100644 --- a/tests/test_cli/helpers.py +++ b/tests/test_cli/helpers.py @@ -1,7 +1,7 @@ import os -from eth2deposit.key_handling.keystore import Keystore -from eth2deposit.utils.constants import DEFAULT_VALIDATOR_KEYS_FOLDER_NAME +from staking_deposit.key_handling.keystore import Keystore +from staking_deposit.utils.constants import DEFAULT_VALIDATOR_KEYS_FOLDER_NAME def clean_key_folder(my_folder_path: str) -> None: diff --git a/tests/test_cli/test_existing_menmonic.py b/tests/test_cli/test_existing_menmonic.py index 2ecc97c2..25e0556d 100644 --- a/tests/test_cli/test_existing_menmonic.py +++ b/tests/test_cli/test_existing_menmonic.py @@ -7,8 +7,8 @@ from eth_utils import decode_hex -from eth2deposit.deposit import cli -from eth2deposit.utils.constants import DEFAULT_VALIDATOR_KEYS_FOLDER_NAME, ETH1_ADDRESS_WITHDRAWAL_PREFIX +from staking_deposit.deposit import cli +from staking_deposit.utils.constants import DEFAULT_VALIDATOR_KEYS_FOLDER_NAME, ETH1_ADDRESS_WITHDRAWAL_PREFIX from.helpers import clean_key_folder, get_permissions, get_uuid @@ -21,10 +21,16 @@ def test_existing_mnemonic_bls_withdrawal() -> None: runner = CliRunner() inputs = [ + 'TREZOR', 'abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about', - '2', '2', '5', 'mainnet', 'MyPassword', 'MyPassword', 'yes'] + '2', '2', '5', 'mainnet', 'MyPassword', 'MyPassword'] data = '\n'.join(inputs) - arguments = ['existing-mnemonic', '--folder', my_folder_path, '--mnemonic-password', 'TREZOR'] + arguments = [ + '--language', 'english', + 'existing-mnemonic', + '--folder', my_folder_path, + '--mnemonic-password', 'TREZOR', + ] result = runner.invoke(cli, arguments, input=data) assert result.exit_code == 0 @@ -57,11 +63,13 @@ def test_existing_mnemonic_eth1_address_withdrawal() -> None: runner = CliRunner() inputs = [ + 'TREZOR', 'abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about', - '2', '2', '5', 'mainnet', 'MyPassword', 'MyPassword', 'yes'] + '2', '2', '5', 'mainnet', 'MyPassword', 'MyPassword'] data = '\n'.join(inputs) eth1_withdrawal_address = '0x00000000219ab540356cbb839cbe05303d7705fa' arguments = [ + '--language', 'english', 'existing-mnemonic', '--folder', my_folder_path, '--mnemonic-password', 'TREZOR', @@ -118,6 +126,8 @@ async def test_script() -> None: cmd_args = [ run_script_cmd, + '--language', 'english', + '--non_interactive', 'existing-mnemonic', '--num_validators', '1', '--mnemonic="abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about"', @@ -129,15 +139,8 @@ async def test_script() -> None: ] proc = await asyncio.create_subprocess_shell( ' '.join(cmd_args), - stdin=asyncio.subprocess.PIPE, - stdout=asyncio.subprocess.PIPE, ) - - async for out in proc.stdout: - output = out.decode('utf-8').rstrip() - if output.startswith('Running deposit-cli...'): - proc.stdin.write(b'y\n') - + await proc.wait() # Check files validator_keys_folder_path = os.path.join(my_folder_path, DEFAULT_VALIDATOR_KEYS_FOLDER_NAME) _, _, key_files = next(os.walk(validator_keys_folder_path)) diff --git a/tests/test_cli/test_new_mnemonic.py b/tests/test_cli/test_new_mnemonic.py index 4ff1d644..098bc6a8 100644 --- a/tests/test_cli/test_new_mnemonic.py +++ b/tests/test_cli/test_new_mnemonic.py @@ -7,9 +7,10 @@ from eth_utils import decode_hex -from eth2deposit.cli import new_mnemonic -from eth2deposit.deposit import cli -from eth2deposit.utils.constants import DEFAULT_VALIDATOR_KEYS_FOLDER_NAME, ETH1_ADDRESS_WITHDRAWAL_PREFIX +from staking_deposit.cli import new_mnemonic +from staking_deposit.deposit import cli +from staking_deposit.utils.constants import DEFAULT_VALIDATOR_KEYS_FOLDER_NAME, ETH1_ADDRESS_WITHDRAWAL_PREFIX +from staking_deposit.utils.intl import load_text from .helpers import clean_key_folder, get_permissions, get_uuid @@ -27,7 +28,7 @@ def mock_get_mnemonic(language, words_path, entropy=None) -> str: os.mkdir(my_folder_path) runner = CliRunner() - inputs = ['english', '1', 'mainnet', 'MyPassword', 'MyPassword', 'fakephrase'] + inputs = ['english', 'english', '1', 'mainnet', 'MyPassword', 'MyPassword', 'fakephrase'] data = '\n'.join(inputs) result = runner.invoke(cli, ['new-mnemonic', '--folder', my_folder_path], input=data) assert result.exit_code == 0 @@ -70,6 +71,7 @@ def mock_get_mnemonic(language, words_path, entropy=None) -> str: data = '\n'.join(inputs) eth1_withdrawal_address = '0x00000000219ab540356cbb839cbe05303d7705fa' arguments = [ + '--language', 'english', 'new-mnemonic', '--folder', my_folder_path, '--eth1_withdrawal_address', eth1_withdrawal_address, @@ -124,7 +126,10 @@ async def test_script() -> None: await proc.wait() cmd_args = [ - run_script_cmd + ' new-mnemonic', + run_script_cmd, + '--language', 'english', + '--non_interactive', + 'new-mnemonic', '--num_validators', '5', '--mnemonic_language', 'english', '--chain', 'mainnet', @@ -139,11 +144,12 @@ async def test_script() -> None: seed_phrase = '' parsing = False + mnemonic_json_file = os.path.join(os.getcwd(), 'staking_deposit/../staking_deposit/cli/', 'new_mnemonic.json') async for out in proc.stdout: output = out.decode('utf-8').rstrip() - if output.startswith("This is your seed phrase."): + if output.startswith(load_text(['msg_mnemonic_presentation'], mnemonic_json_file, 'new_mnemonic')): parsing = True - elif output.startswith("Please type your mnemonic"): + elif output.startswith(load_text(['msg_mnemonic_retype_prompt'], mnemonic_json_file, 'new_mnemonic')): parsing = False elif parsing: seed_phrase += output diff --git a/tests/test_cli/test_regeneration.py b/tests/test_cli/test_regeneration.py index 8f5dac73..77687583 100644 --- a/tests/test_cli/test_regeneration.py +++ b/tests/test_cli/test_regeneration.py @@ -3,9 +3,9 @@ from pathlib import Path from click.testing import CliRunner -from eth2deposit.cli import new_mnemonic -from eth2deposit.deposit import cli -from eth2deposit.utils.constants import DEFAULT_VALIDATOR_KEYS_FOLDER_NAME +from staking_deposit.cli import new_mnemonic +from staking_deposit.deposit import cli +from staking_deposit.utils.constants import DEFAULT_VALIDATOR_KEYS_FOLDER_NAME from .helpers import clean_key_folder, get_permissions, get_uuid @@ -33,7 +33,7 @@ def mock_get_mnemonic(language, words_path, entropy=None) -> str: runner = CliRunner() # Create index 0 and 1 my_password = "MyPassword" - inputs = ['english', '2', 'mainnet', my_password, my_password, mock_mnemonic] + inputs = ['english', 'english', '2', 'mainnet', my_password, my_password, mock_mnemonic] data = '\n'.join(inputs) result = runner.invoke(cli, ['new-mnemonic', '--folder', folder_path_1], input=data) assert result.exit_code == 0 @@ -56,8 +56,9 @@ def mock_get_mnemonic(language, words_path, entropy=None) -> str: runner = CliRunner() # Create index 1 and 2 inputs = [ + 'english', mock_mnemonic, - '1', '1', '2', 'mainnet', 'MyPassword', 'MyPassword', 'yes'] + '1', '1', '2', 'mainnet', 'MyPassword', 'MyPassword'] data = '\n'.join(inputs) arguments = ['existing-mnemonic', '--folder', folder_path_2] result = runner.invoke(cli, arguments, input=data) diff --git a/tests/test_credentials.py b/tests/test_credentials.py index 53669301..7fcdcee0 100644 --- a/tests/test_credentials.py +++ b/tests/test_credentials.py @@ -1,7 +1,7 @@ import pytest -from eth2deposit.credentials import CredentialList -from eth2deposit.settings import MainnetSetting +from staking_deposit.credentials import CredentialList +from staking_deposit.settings import MainnetSetting def test_from_mnemonic() -> None: diff --git a/tests/test_intl/schemas/cli/existing_mnemonic.json b/tests/test_intl/schemas/cli/existing_mnemonic.json new file mode 100644 index 00000000..a90d8159 --- /dev/null +++ b/tests/test_intl/schemas/cli/existing_mnemonic.json @@ -0,0 +1,92 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "validate_mnemonic": { + "type": "object", + "properties": { + "err_invalid_mnemonic": { + "type": "string" + } + }, + "required": [ + "err_invalid_mnemonic" + ] + }, + "existing_mnemonic": { + "type": "object", + "properties": { + "arg_existing_mnemonic": { + "type": "object", + "properties": { + "help": { + "type": "string" + } + }, + "required": [ + "help" + ] + }, + "arg_mnemonic": { + "type": "object", + "properties": { + "help": { + "type": "string" + }, + "prompt": { + "type": "string" + } + }, + "required": [ + "help", + "prompt" + ] + }, + "arg_mnemonic_password": { + "type": "object", + "properties": { + "help": { + "type": "string" + }, + "confirm": { + "type": "string" + } + }, + "required": [ + "help", + "confirm" + ] + }, + "arg_validator_start_index": { + "type": "object", + "properties": { + "help": { + "type": "string" + }, + "prompt": { + "type": "string" + }, + "confirm":{ + "type": "string" + } + }, + "required": [ + "help", + "prompt", + "confirm" + ] + } + }, + "required": [ + "arg_existing_mnemonic", + "arg_mnemonic", + "arg_mnemonic_password", + "arg_validator_start_index" + ] + } + }, + "required": [ + "validate_mnemonic", + "existing_mnemonic" + ] +} \ No newline at end of file diff --git a/tests/test_intl/schemas/cli/generate_keys.json b/tests/test_intl/schemas/cli/generate_keys.json new file mode 100644 index 00000000..84384b8b --- /dev/null +++ b/tests/test_intl/schemas/cli/generate_keys.json @@ -0,0 +1,108 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "generate_keys_arguments_decorator": { + "type": "object", + "properties": { + "num_validators": { + "type": "object", + "properties": { + "help": { + "type": "string" + }, + "prompt": { + "type": "string" + } + }, + "required": [ + "help", + "prompt" + ] + }, + "folder": { + "type": "object", + "properties": { + "help": { + "type": "string" + } + } + }, + "chain": { + "type": "object", + "properties": { + "help": { + "type": "string" + }, + "prompt": { + "type": "string" + } + }, + "required": [ + "help", + "prompt" + ] + }, + "keystore_password": { + "type": "object", + "properties": { + "help": { + "type": "string" + }, + "prompt": { + "type": "string" + }, + "confirm": { + "type": "string" + }, + "mismatch": { + "type": "string" + } + }, + "required": [ + "help", + "prompt", + "confirm", + "mismatch" + ] + } + }, + "required": [ + "num_validators", + "chain", + "keystore_password" + ] + }, + "generate_keys": { + "type": "object", + "properties": { + "msg_key_creation": { + "type": "string" + }, + "msg_creation_success": { + "type": "string" + }, + "msg_pause": { + "type": "string" + }, + "err_verify_keystores": { + "type": "string" + }, + "err_verify_deposit": { + "type": "string" + } + }, + "required": [ + "msg_key_creation", + "msg_creation_success", + "msg_pause", + "err_verify_keystores", + "err_verify_deposit" + ] + } + }, + "required": [ + "generate_keys_arguments_decorator", + "generate_keys" + ] +} \ No newline at end of file diff --git a/tests/test_intl/schemas/cli/new_mnemonic.json b/tests/test_intl/schemas/cli/new_mnemonic.json new file mode 100644 index 00000000..42c438d5 --- /dev/null +++ b/tests/test_intl/schemas/cli/new_mnemonic.json @@ -0,0 +1,60 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "new_mnemonic": { + "type": "object", + "properties": { + "arg_new_mnemonic": { + "type": "object", + "properties": { + "help": { + "type": "string" + } + }, + "required": [ + "help" + ] + }, + "arg_mnemonic_language": { + "type": "object", + "properties": { + "default": { + "type": "string" + }, + "help": { + "type": "string" + }, + "prompt": { + "type": "string" + } + }, + "required": [ + "default", + "help", + "prompt" + ] + }, + "msg_mnemonic_presentation": { + "type": "string" + }, + "msg_press_any_key": { + "type": "string" + }, + "msg_mnemonic_retype_prompt": { + "type": "string" + } + }, + "required": [ + "arg_new_mnemonic", + "arg_mnemonic_language", + "msg_mnemonic_presentation", + "msg_press_any_key", + "msg_mnemonic_retype_prompt" + ] + } + }, + "required": [ + "new_mnemonic" + ] +} \ No newline at end of file diff --git a/tests/test_intl/schemas/credentials.json b/tests/test_intl/schemas/credentials.json new file mode 100644 index 00000000..ccc844ab --- /dev/null +++ b/tests/test_intl/schemas/credentials.json @@ -0,0 +1,56 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "from_mnemonic": { + "type": "object", + "properties": { + "msg_key_creation": { + "type": "string" + } + }, + "required": [ + "msg_key_creation" + ] + }, + "export_keystores": { + "type": "object", + "properties": { + "msg_keystore_creation": { + "type": "string" + } + }, + "required": [ + "msg_keystore_creation" + ] + }, + "export_deposit_data_json": { + "type": "object", + "properties": { + "msg_depositdata_creation": { + "type": "string" + } + }, + "required": [ + "msg_depositdata_creation" + ] + }, + "verify_keystores": { + "type": "object", + "properties": { + "msg_keystore_verification": { + "type": "string" + } + }, + "required": [ + "msg_keystore_verification" + ] + } + }, + "required": [ + "from_mnemonic", + "export_keystores", + "export_deposit_data_json", + "verify_keystores" + ] +} \ No newline at end of file diff --git a/tests/test_intl/schemas/deposit.json b/tests/test_intl/schemas/deposit.json new file mode 100644 index 00000000..ea7773aa --- /dev/null +++ b/tests/test_intl/schemas/deposit.json @@ -0,0 +1,20 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "check_python_version": { + "type": "object", + "properties": { + "err_python_version": { + "type": "string" + } + }, + "required": [ + "err_python_version" + ] + } + }, + "required": [ + "check_python_version" + ] +} \ No newline at end of file diff --git a/tests/test_intl/schemas/utils/validation.json b/tests/test_intl/schemas/utils/validation.json new file mode 100644 index 00000000..3078d70b --- /dev/null +++ b/tests/test_intl/schemas/utils/validation.json @@ -0,0 +1,32 @@ +{ + "$schema": "http://json-schema.org/draft-04/schema#", + "type": "object", + "properties": { + "verify_deposit_data_json": { + "type": "object", + "properties": { + "msg_deposit_verification": { + "type": "string" + } + }, + "required": [ + "msg_deposit_verification" + ] + }, + "validate_password_strength": { + "type": "object", + "properties": { + "msg_password_length": { + "type": "string" + } + }, + "required": [ + "msg_password_length" + ] + } + }, + "required": [ + "verify_deposit_data_json", + "validate_password_strength" + ] +} \ No newline at end of file diff --git a/tests/test_intl/test_json_schema.py b/tests/test_intl/test_json_schema.py new file mode 100644 index 00000000..d6710c16 --- /dev/null +++ b/tests/test_intl/test_json_schema.py @@ -0,0 +1,45 @@ +import json +import jsonschema +import os +import pytest +import re +from typing import ( + List, +) + +from staking_deposit.utils.constants import INTL_CONTENT_PATH + + +TEST_SCHEMAS_FOLDER = os.path.join(os.path.dirname(__file__), 'schemas') + + +def files_to_check(root_dir: str) -> List[str]: + file_list = [] + for dir_, _, files in os.walk(root_dir): + for file_name in files: + rel_dir = os.path.relpath(dir_, root_dir) + rel_file = os.path.join(rel_dir, file_name) + file_list.append(rel_file) + return file_list + + +def languages_to_check(root_dir: str) -> List[str]: + dirs = next(os.walk(root_dir))[1] + regex = re.compile('([A-Za-z]){2}(-([A-Za-z]){2})?') + return [d for d in dirs if re.fullmatch(regex, d)] + + +@pytest.mark.parametrize( + 'lang, schema_path', + [ + (lang, schema) + for schema in files_to_check(TEST_SCHEMAS_FOLDER) + for lang in languages_to_check(INTL_CONTENT_PATH) + ] +) +def test_language_schemas(lang: str, schema_path: str) -> None: + with open(os.path.join(TEST_SCHEMAS_FOLDER, schema_path)) as schema_file: + schema = json.load(schema_file) + with open(os.path.join(INTL_CONTENT_PATH, lang, schema_path)) as lang_file: + lang_json = json.load(lang_file) + jsonschema.validate(lang_json, schema) diff --git a/tests/test_key_handling/test_key_derivation/test_mnemonic.py b/tests/test_key_handling/test_key_derivation/test_mnemonic.py index 51f6d335..a913e391 100644 --- a/tests/test_key_handling/test_key_derivation/test_mnemonic.py +++ b/tests/test_key_handling/test_key_derivation/test_mnemonic.py @@ -5,18 +5,20 @@ Sequence, ) -from eth2deposit.key_handling.key_derivation.mnemonic import ( +from staking_deposit.utils.constants import ( + MNEMONIC_LANG_OPTIONS, +) +from staking_deposit.key_handling.key_derivation.mnemonic import ( _index_to_word, _get_word_list, - get_languages, get_seed, get_mnemonic, verify_mnemonic, ) -WORD_LISTS_PATH = os.path.join(os.getcwd(), 'eth2deposit', 'key_handling', 'key_derivation', 'word_lists') -all_languages = get_languages(WORD_LISTS_PATH) +WORD_LISTS_PATH = os.path.join(os.getcwd(), 'staking_deposit', 'key_handling', 'key_derivation', 'word_lists') +all_languages = MNEMONIC_LANG_OPTIONS.keys() test_vector_filefolder = os.path.join('tests', 'test_key_handling', 'test_key_derivation', 'test_vectors', 'mnemonic.json') diff --git a/tests/test_key_handling/test_key_derivation/test_path.py b/tests/test_key_handling/test_key_derivation/test_path.py index 55cd1b2c..87e001ac 100644 --- a/tests/test_key_handling/test_key_derivation/test_path.py +++ b/tests/test_key_handling/test_key_derivation/test_path.py @@ -2,14 +2,14 @@ import json import pytest -from eth2deposit.key_handling.key_derivation.tree import ( +from staking_deposit.key_handling.key_derivation.tree import ( _flip_bits_256, _IKM_to_lamport_SK, _parent_SK_to_lamport_PK, _HKDF_mod_r, ) -from eth2deposit.key_handling.key_derivation.path import ( +from staking_deposit.key_handling.key_derivation.path import ( mnemonic_and_path_to_key, path_to_nodes, ) diff --git a/tests/test_key_handling/test_key_derivation/test_tree.py b/tests/test_key_handling/test_key_derivation/test_tree.py index 6a6bd1c8..39511d07 100644 --- a/tests/test_key_handling/test_key_derivation/test_tree.py +++ b/tests/test_key_handling/test_key_derivation/test_tree.py @@ -4,7 +4,7 @@ import pytest -from eth2deposit.key_handling.key_derivation.tree import ( +from staking_deposit.key_handling.key_derivation.tree import ( _HKDF_mod_r, derive_child_SK, derive_master_SK, diff --git a/tests/test_key_handling/test_keystore.py b/tests/test_key_handling/test_keystore.py index add35b88..696aa201 100644 --- a/tests/test_key_handling/test_keystore.py +++ b/tests/test_key_handling/test_keystore.py @@ -2,7 +2,7 @@ import json import pytest -from eth2deposit.key_handling.keystore import ( +from staking_deposit.key_handling.keystore import ( Keystore, ScryptKeystore, Pbkdf2Keystore, diff --git a/tests/test_utils/test_constants.py b/tests/test_utils/test_constants.py new file mode 100644 index 00000000..3c414075 --- /dev/null +++ b/tests/test_utils/test_constants.py @@ -0,0 +1,18 @@ +import pytest +from typing import ( + Dict, + List, +) + +from staking_deposit.utils.constants import _add_index_to_options + + +@pytest.mark.parametrize( + 'arg, test', [ + ({'en': ['English', 'en']}, {'en': ['1. English', '1', 'English', 'en']}), + ({'a': ['a'], 'b': ['b'], 'c': ['c']}, + {'a': ['1. a', '1', 'a'], 'b': ['2. b', '2', 'b'], 'c': ['3. c', '3', 'c']}) + ] +) +def test_add_index_to_options(arg: Dict[str, List[str]], test: Dict[str, List[str]]) -> None: + assert _add_index_to_options(arg) == test diff --git a/tests/test_utils/test_crypto.py b/tests/test_utils/test_crypto.py index 75612193..2202c8da 100644 --- a/tests/test_utils/test_crypto.py +++ b/tests/test_utils/test_crypto.py @@ -1,6 +1,6 @@ import pytest -from eth2deposit.utils.crypto import ( +from staking_deposit.utils.crypto import ( scrypt, PBKDF2, AES_128_CTR, diff --git a/tests/test_utils/test_intl.py b/tests/test_utils/test_intl.py new file mode 100644 index 00000000..de4ffc9c --- /dev/null +++ b/tests/test_utils/test_intl.py @@ -0,0 +1,71 @@ +import os +import pytest +from typing import ( + List, +) + +from staking_deposit.utils.constants import ( + INTL_LANG_OPTIONS, + MNEMONIC_LANG_OPTIONS, +) +from staking_deposit.utils.intl import ( + fuzzy_reverse_dict_lookup, + get_first_options, + load_text, +) + + +@pytest.mark.parametrize( + 'params, file_path, func, lang, found_str', [ + (['arg_mnemonic_language', 'prompt'], os.path.join('staking_deposit', 'cli', 'new_mnemonic.json'), + 'new_mnemonic', 'en', 'Please choose your mnemonic language'), + (['arg_mnemonic_language', 'prompt'], os.path.join('staking_deposit', 'cli', 'new_mnemonic.json'), + 'new_mnemonic', 'ja', 'ニーモニックの言語を選択してください'), + ] +) +def test_load_text(params: List[str], file_path: str, func: str, lang: str, found_str: str) -> None: + assert found_str in load_text(params, file_path, func, lang) + + +@pytest.mark.parametrize( + 'params, file_path, func, lang, valid', [ + (['arg_mnemonic_language', 'prompt'], os.path.join('staking_deposit', 'cli', 'new_mnemonic.json'), + 'new_mnemonic', 'zz', True), # invalid language, should revert to english + (['arg_mnemonic_language'], os.path.join('staking_deposit', 'cli', 'new_mnemonic.json'), + 'new_mnemonic', 'en', False), # incomplete params + (['arg_mnemonic_language', 'prompt'], os.path.join('staking_deposit', 'cli', 'invalid.json'), + 'new_mnemonic', 'en', False), # invalid json path + (['arg_mnemonic_language', 'prompt'], os.path.join('staking_deposit', 'cli', 'invalid.json'), + 'new_mnemonic', 'zz', False), # invalid json path in invalid language + ] +) +def test_load_text_en_fallover(params: List[str], file_path: str, func: str, lang: str, valid: bool) -> None: + if valid: + assert load_text(params, file_path, func, lang) == load_text(params, file_path, func, 'en') + else: + try: + load_text(params, file_path, func, lang) + except KeyError: + pass + else: + assert False + + +@pytest.mark.parametrize( + 'options, first_options', [ + ({'a': ['a', 1], 'b': range(5), 'c': [chr(i) for i in range(65, 90)]}, ['a', 0, 'A']), + ] +) +def test_get_first_options(options, first_options): + assert get_first_options(options) == first_options + + +@pytest.mark.parametrize( + 'test, match, options', [ + ('English', 'english', MNEMONIC_LANG_OPTIONS), + ('한국어', 'korean', MNEMONIC_LANG_OPTIONS), + ('Roman', 'ro', INTL_LANG_OPTIONS), + ] +) +def test_fuzzy_reverse_dict_lookup(test, match, options): + assert fuzzy_reverse_dict_lookup(test, options) == match diff --git a/tests/test_utils/test_ssz.py b/tests/test_utils/test_ssz.py index 16e52fa8..d8821de4 100644 --- a/tests/test_utils/test_ssz.py +++ b/tests/test_utils/test_ssz.py @@ -1,6 +1,6 @@ import pytest -from eth2deposit.utils.ssz import ( +from staking_deposit.utils.ssz import ( DepositMessage, compute_deposit_domain, compute_deposit_fork_data_root, diff --git a/tests/test_utils/test_validation.py b/tests/test_utils/test_validation.py index 69e190dd..c0b9c89f 100644 --- a/tests/test_utils/test_validation.py +++ b/tests/test_utils/test_validation.py @@ -1,7 +1,13 @@ import pytest +from typing import ( + Any, +) -from eth2deposit.exceptions import ValidationError -from eth2deposit.utils.validation import validate_password_strength +from staking_deposit.exceptions import ValidationError +from staking_deposit.utils.validation import ( + validate_int_range, + validate_password_strength, +) @pytest.mark.parametrize( @@ -17,3 +23,23 @@ def test_validate_password_strength(password, valid): else: with pytest.raises(ValidationError): validate_password_strength(password=password) + + +@pytest.mark.parametrize( + 'num, low, high, valid', + [ + (2, 0, 4, True), + (0, 0, 4, True), + (-1, 0, 4, False), + (4, 0, 4, False), + (0.2, 0, 4, False), + ('0', 0, 4, True), + ('a', 0, 4, False), + ] +) +def test_validate_int_range(num: Any, low: int, high: int, valid: bool) -> None: + if valid: + validate_int_range(num, low, high) + else: + with pytest.raises(ValidationError): + validate_int_range(num, low, high) diff --git a/tox.ini b/tox.ini index 4c3f399f..69858060 100644 --- a/tox.ini +++ b/tox.ini @@ -25,7 +25,7 @@ commands= deps={[common-install]deps} commands= flake8 --config={toxinidir}/flake8.ini {toxinidir}/tests - mypy --config-file {toxinidir}/mypy.ini -p eth2deposit + mypy --config-file {toxinidir}/mypy.ini -p staking_deposit [common-script] deps=