staking-deposit-cli/README.md

346 lines
9.1 KiB
Markdown
Raw Normal View History

# eth2.0-deposit-cli
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
2020-07-27 18:47:09 +00:00
- [Pre-production warning](#pre-production-warning)
- [Tutorial for users](#tutorial-for-users)
2020-07-27 18:47:09 +00:00
- [Build requirements](#build-requirements)
- [For Linux or MacOS users](#for-linux-or-macos-users)
2020-07-27 18:47:09 +00:00
- [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)
- [Arguments](#arguments)
- [Successful message](#successful-message)
- [Option 2. Build `deposit-cli` with native Python](#option-2-build-deposit-cli-with-native-python)
- [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)
- [Arguments](#arguments-1)
- [Successful message](#successful-message-1)
- [Option 3. Build `deposit-cli` with `virtualenv`](#option-3-build-deposit-cli-with-virtualenv)
- [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)
- [Arguments](#arguments-2)
- [Successful message](#successful-message-2)
- [For Windows users](#for-windows-users)
2020-07-27 18:47:09 +00:00
- [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-3)
- [Arguments](#arguments-3)
- [Successful message](#successful-message-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-4)
- [Arguments](#arguments-4)
- [Successful message](#successful-message-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-5)
- [Arguments](#arguments-5)
- [Successful message](#successful-message-5)
- [Development](#development)
- [Install basic requirements](#install-basic-requirements)
- [Install testing requirements](#install-testing-requirements)
- [Run tests](#run-tests)
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
2020-07-03 16:12:37 +00:00
## Pre-production warning
2020-07-28 02:02:20 +00:00
This software is a pre-release version which has not yet been audited and therefore should not yet be trusted to generate keys with the intent of securing actual ETH.
2020-07-03 16:12:37 +00:00
## Tutorial for users
2020-07-27 18:47:09 +00:00
### Build requirements
- [Python **3.7+**](https://www.python.org/about/gettingstarted/)
- [pip3](https://pip.pypa.io/en/stable/installing/)
### For Linux or MacOS users
2020-07-27 18:47:09 +00:00
#### Option 1. Download binary executable file
2020-07-27 18:47:09 +00:00
##### Step 1. Installation
2020-07-27 18:47:09 +00:00
See [releases page](https://github.com/ethereum/eth2.0-deposit-cli/releases) to download and decompress the corresponding binary files.
2020-07-27 18:47:09 +00:00
##### Step 2. Create keys and `deposit_data-*.json`
Run the following command to enter the interactive CLI:
```sh
2020-07-27 18:47:09 +00:00
./deposit
```
You can also run the tool with optional arguments:
```sh
2020-07-27 18:47:09 +00:00
./deposit --num_validators=<NUM_VALIDATORS> --mnemonic_language=english --chain=<CHAIN_NAME> --folder=<YOUR_FOLDER_PATH>
```
2020-07-27 18:47:09 +00:00
###### Arguments
You can use `--help` flag to see all arguments.
| 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: `czech`, `chinese_traditional`, `chinese_simplified`, `english`, `spanish`, `italian`, `korean`. Default to `english` | The mnemonic language |
| `--folder` | String. Pointing to `./validator_keys` by default | The folder path for the keystore(s) and deposit(s) |
2020-07-28 02:02:20 +00:00
| `--chain` | String. `mainnet` by default | The chain setting for the signing domain. |
2020-07-27 18:47:09 +00:00
###### Successful message
You will see the following messages after successfully generated the keystore(s) and the deposit(s):
```
Creating your keys.
Saving your keystore(s).
Creating your deposit(s).
Verifying your keystore(s).
Verifying your deposit(s).
Success!
Your keys can be found at: <YOUR_FOLDER_PATH>
```
#### Option 2. Build `deposit-cli` with native Python
##### Step 0. Python version checking
Ensure you are using Python version >= Python3.7:
```sh
python3 -V
```
##### Step 1. Installation
Install the dependencies:
```sh
pip3 install -r requirements.txt
python3 setup.py install
```
Or use the helper script:
```sh
./deposit.sh install
```
##### Step 2. Create keys and `deposit_data-*.json`
Run the following command to enter the interactive CLI:
```sh
./deposit.sh
```
You can also run the tool with optional arguments:
```sh
./deposit.sh --num_validators=<NUM_VALIDATORS> --mnemonic_language=english --chain=<CHAIN_NAME> --folder=<YOUR_FOLDER_PATH>
```
###### Arguments
See [here](#arguments)
###### Successful message
See [here](#successful-message)
#### Option 3. Build `deposit-cli` with `virtualenv`
##### Step 0. Python version checking
Ensure you are using Python version >= Python3.7:
```sh
2020-07-28 06:26:20 +00:00
python3 -V
2020-07-27 18:47:09 +00:00
```
##### Step 1. Installation
For the [virtualenv](https://virtualenv.pypa.io/en/latest/) users, you can create a new venv:
```sh
2020-07-28 06:26:20 +00:00
pip3 install virtualenv
2020-07-27 18:47:09 +00:00
virtualenv venv
./venv/bin/activate
```
and install the dependencies:
```sh
python setup.py install
pip install -r requirements.txt
```
##### Step 2. Create keys and `deposit_data-*.json`
Run the following command to enter the interactive CLI:
```sh
python ./eth2deposit/deposit.py
```
You can also run the tool with optional arguments:
```sh
python ./eth2deposit/deposit.py --num_validators=<NUM_VALIDATORS> --mnemonic_language=english --chain=<CHAIN_NAME> --folder=<YOUR_FOLDER_PATH>
```
###### Arguments
See [here](#arguments)
###### Successful message
See [here](#successful-message)
----
### For Windows users
2020-07-27 18:47:09 +00:00
#### Option 1. Download binary executable file
##### Step 1. Installation
2020-07-27 18:47:09 +00:00
See [releases page](https://github.com/ethereum/eth2.0-deposit-cli/releases) to download and decompress the corresponding binary files.
##### Step 2. Create keys and `deposit_data-*.json`
Run the following command to enter the interactive CLI:
```sh
deposit.exe
```
You can also run the tool with optional arguments:
```sh
deposit.exe --num_validators=<NUM_VALIDATORS> --mnemonic_language=english --chain=<CHAIN_NAME> --folder=<YOUR_FOLDER_PATH>
```
###### Arguments
See [here](#arguments)
###### Successful message
See [here](#successful-message)
#### Option 2. Build `deposit-cli` with native Python
##### Step 0. Python version checking
Ensure you are using Python version >= Python3.7:
```sh
python -V
```
##### Step 1. Installation
Install the dependencies:
```sh
pip install -r requirements.txt
python setup.py install
```
Or use the helper script:
```sh
sh deposit.sh install
```
2020-07-27 18:47:09 +00:00
##### Step 2. Create keys and `deposit_data-*.json`
Run the following command to enter the interactive CLI:
```sh
sh deposit.sh
```
You can also run the tool with optional arguments:
```sh
2020-07-27 18:47:09 +00:00
sh deposit.sh --num_validators=<NUM_VALIDATORS> --mnemonic_language=english --chain=<CHAIN_NAME> --folder=<YOUR_FOLDER_PATH>
```
2020-07-27 18:47:09 +00:00
###### Arguments
See [here](#arguments)
2020-07-27 18:47:09 +00:00
###### Successful message
See [here](#successful-message)
2020-07-27 18:47:09 +00:00
#### Option 3. Build `deposit-cli` with `virtualenv`
##### Step 0. Python version checking
2020-07-27 18:47:09 +00:00
Ensure you are using Python version >= Python3.7:
```sh
python -V
```
2020-07-27 18:47:09 +00:00
##### Step 1. Installation
For the [virtualenv](https://virtualenv.pypa.io/en/latest/) users, you can create a new venv:
```sh
2020-07-28 06:26:20 +00:00
pip install virtualenv
2020-07-27 18:47:09 +00:00
virtualenv venv
./venv/bin/activate
```
2020-07-27 18:47:09 +00:00
and install the dependencies:
2020-07-27 18:47:09 +00:00
```sh
python setup.py install
pip install -r requirements.txt
```
##### Step 2. Create keys and `deposit_data-*.json`
Run the following command to enter the interactive CLI:
```sh
2020-07-27 18:47:09 +00:00
python ./eth2deposit/deposit.py
```
2020-07-27 18:47:09 +00:00
You can also run the tool with optional arguments:
```sh
python ./eth2deposit/deposit.py --num_validators=<NUM_VALIDATORS> --mnemonic_language=english --chain=<CHAIN_NAME> --folder=<YOUR_FOLDER_PATH>
```
###### Arguments
See [here](#arguments)
###### Successful message
See [here](#successful-message)
## Development
2020-05-12 07:44:04 +00:00
### Install basic requirements
2020-05-12 07:44:04 +00:00
```sh
python3 -m pip install -r requirements.txt
python3 setup.py install
```
2020-05-12 07:44:04 +00:00
### Install testing requirements
2020-05-12 07:44:04 +00:00
```sh
python3 -m pip install -r requirements_test.txt
```
2020-05-12 07:44:04 +00:00
### Run tests
```sh
python3 -m pytest .
```