Book modifications to include testnet param (#1418)

## Issue Addressed

N/A

## Proposed Changes

Update the lighthouse book to accommodate the new `--testnet` CLI param. 

## Additional Info
This commit is contained in:
Age Manning 2020-07-31 02:14:50 +00:00
parent a37e75f44b
commit 2ede9caaa6
6 changed files with 46 additions and 16 deletions

View File

@ -1,7 +1,7 @@
# Summary # Summary
* [Introduction](./intro.md) * [Introduction](./intro.md)
* [Become a Medalla Validator](./become-a-validator.md) * [Become a Validator](./become-a-validator.md)
* [Using Docker](./become-a-validator-docker.md) * [Using Docker](./become-a-validator-docker.md)
* [Building from Source](./become-a-validator-source.md) * [Building from Source](./become-a-validator-source.md)
* [Installation](./installation.md) * [Installation](./installation.md)

View File

@ -47,6 +47,8 @@ VALIDATOR_COUNT=1
VOTING_ETH1_NODE=http://geth:8545 VOTING_ETH1_NODE=http://geth:8545
``` ```
> To specify a non-default testnet add `TESTNET=<testnet>` to the above file. <testnet> can be `altona` or `medalla`.
_This `.env` file should live in the `lighthouse-docker` directory alongside the _This `.env` file should live in the `lighthouse-docker` directory alongside the
`docker-compose.yml` file_. `docker-compose.yml` file_.
@ -68,13 +70,19 @@ validator_client_1 | Jun 01 00:29:24.418 INFO Decrypted validator keystore
``` ```
This is one of the earlier logs outputted, so you may have to scroll up or perform a search in your terminal to find it. This is one of the earlier logs outputted, so you may have to scroll up or perform a search in your terminal to find it.
> Note: `docker-compose up` generates a new sub-directory -- to store your validator's deposit data, along with its voting and withdrawal keys -- in the `.lighthouse/validators` directory. This sub-directory is identified by your validator's `voting_pubkey` (the same `voting_pubkey` you see in the logs). So this is another way you can find it. > Note: `docker-compose up` generates a new sub-directory -- to store your validator's deposit data, along with its voting and withdrawal keys -- in the `lighthouse-data/validators` directory. This sub-directory is identified by your validator's `voting_pubkey` (the same `voting_pubkey` you see in the logs). So this is another way you can find it.
> Note: the docker-compose setup includes a fast-synced geth node. So you can > Note: the docker-compose setup includes a fast-synced geth node. So you can
> expect the `beacon_node` to log some eth1-related errors whilst the geth node > expect the `beacon_node` to log some eth1-related errors whilst the geth node
> boots and becomes synced. This will only happen on the first start of the > boots and becomes synced. This will only happen on the first start of the
> compose environment or if geth loses sync. > compose environment or if geth loses sync.
> Note: If you are participating in the genesis of a network (the network has
> not launched yet) you will notice errors in the validator client. This is
> because the beacon node not expose its HTTP API until
> the genesis of the network is known (approx 2 days before the network
> launches).
To find an estimate for how long your beacon node will take to finish syncing, look for logs that look like this: To find an estimate for how long your beacon node will take to finish syncing, look for logs that look like this:
```bash ```bash
@ -96,7 +104,7 @@ However, since it generally takes somewhere between [4 and 8 hours](./faq.md) af
## Installation complete! ## Installation complete!
In the [next step](become-a-validator.html#2-submit-your-deposit-to-goerli) you'll need to upload your validator's deposit data. This data is stored in a file called `eth1_deposit_data.rlp`. In the [next step](become-a-validator.html#2-submit-your-deposit-to-goerli) you'll need to upload your validator's deposit data. This data is stored in a file called `eth1_deposit_data.rlp`.
You'll find it in `lighthouse-docker/.lighthouse/validators/` -- in the sub-directory that corresponds to your validator's public key (`voting_pubkey`). You'll find it in `lighthouse-docker/.lighthouse/validators/` -- in the sub-directory that corresponds to your validator's public key (`voting_pubkey`).

View File

@ -45,9 +45,14 @@ the internet and maintains a view of the chain.
Start your beacon node with: Start your beacon node with:
```bash ```bash
lighthouse beacon --eth1 --http lighthouse --testnet medalla beacon --eth1 --http
``` ```
> The `--testnet` parameter is optional. Omitting it will default to the
> current public testnet. Set the value to the testnet you wish to run on.
> Current values are either `altona` or `medalla`. This is true for all the
> following commands in this document.
>Note: the `--http` flag enables the HTTP API for the validator client. And the `--eth1` flag tells the beacon node that it should sync with an Ethereum1 node (e.g. Geth). These flags are only required if you wish to run a validator. >Note: the `--http` flag enables the HTTP API for the validator client. And the `--eth1` flag tells the beacon node that it should sync with an Ethereum1 node (e.g. Geth). These flags are only required if you wish to run a validator.
@ -81,7 +86,7 @@ validator](./validator-create.md). A two-step example follows:
Create a wallet with: Create a wallet with:
```bash ```bash
lighthouse account wallet create --name my-validators --passphrase-file my-validators.pass lighthouse --testnet medalla account wallet create --name my-validators --passphrase-file my-validators.pass
``` ```
The output will look like this: The output will look like this:
@ -117,7 +122,7 @@ used to restore your validator if there is a data loss.
Create a validator from the wallet with: Create a validator from the wallet with:
```bash ```bash
lighthouse account validator create --wallet-name my-validators --wallet-passphrase my-validators.pass --count 1 lighthouse --testnet medalla account validator create --wallet-name my-validators --wallet-passphrase my-validators.pass --count 1
``` ```
The output will look like this: The output will look like this:
@ -140,6 +145,12 @@ information.
## 5. Start your validator client ## 5. Start your validator client
> Note: If you are participating in the genesis of a network (the network has
> not launched yet) you should skip this step and re-run this step two days before
> the launch of the network. The beacon node does not expose its HTTP API until
> the genesis of the network is known (approx 2 days before the network
> launches).
Since the validator client stores private keys and signs messages generated by the beacon node, for security reasons it runs separately from it. Since the validator client stores private keys and signs messages generated by the beacon node, for security reasons it runs separately from it.
You'll need both your beacon node _and_ validator client running if you want to You'll need both your beacon node _and_ validator client running if you want to
@ -148,7 +159,7 @@ stake.
Start the validator client with: Start the validator client with:
```bash ```bash
lighthouse validator --auto-register lighthouse --testnet medalla validator --auto-register
``` ```
The `--auto-register` flag registers your signing key with the slashing protection database, which The `--auto-register` flag registers your signing key with the slashing protection database, which
@ -164,7 +175,7 @@ Dec 09 13:09:09.000 INFO Awaiting activation slot: 17787, ..
``` ```
To find an estimate for how long your beacon node will take to finish syncing, lookout for the following logs: To find an estimate for how long your beacon node will take to finish syncing, lookout for the following logs:
```bash ```bash
beacon_node_1 | Mar 16 11:33:53.979 INFO Syncing beacon_node_1 | Mar 16 11:33:53.979 INFO Syncing
@ -186,7 +197,7 @@ However, since it generally takes somewhere between [4 and 8 hours](./faq.md) af
## Installation complete! ## Installation complete!
In the [next step](become-a-validator.html#2-submit-your-deposit-to-goerli) you'll need to upload your validator's deposit data. This data is stored in a file called `eth1_deposit_data.rlp`. In the [next step](become-a-validator.html#2-submit-your-deposit-to-goerli) you'll need to upload your validator's deposit data. This data is stored in a file called `eth1_deposit_data.rlp`.
You'll find it in `/home/.lighthouse/validators` -- in the sub-directory that corresponds to your validator's public key. You'll find it in `/home/.lighthouse/validators` -- in the sub-directory that corresponds to your validator's public key.

View File

@ -1,7 +1,6 @@
# Become an Ethereum 2.0 Testnet Validator on Medalla # Become an Ethereum 2.0 Validator
Running a Lighthouse validator on the [Medalla](https://github.com/goerli/medalla/tree/master/medalla) There are two public testnets currently available. [Medalla](https://github.com/goerli/medalla/tree/master/medalla) and [Altona](https://github.com/goerli/medalla/tree/master/altona). Lighthouse supports both out of the box and joining these multi-client testnets is easy if you're familiar with the terminal.
multi-client testnet is easy if you're familiar with the terminal.
Lighthouse runs on Linux, MacOS and Windows and has a Docker work-flow to make Lighthouse runs on Linux, MacOS and Windows and has a Docker work-flow to make
things as simple as possible. things as simple as possible.
@ -25,6 +24,9 @@ There are two, different ways to install and start a Lighthouse validator:
Once you've completed **either one** of these steps, you can move onto the next step. Once you've completed **either one** of these steps, you can move onto the next step.
> Take note when running Lighthouse. Use the --testnet parameter to specify the testnet you whish to participate in. Medalla is currently the default, so make sure to use --testnet altona to join the Altona testnet.
## 2. Submit your deposit to Goerli ## 2. Submit your deposit to Goerli
<div class="form-signin" id="uploadDiv"> <div class="form-signin" id="uploadDiv">

View File

@ -49,9 +49,11 @@ $ docker run lighthouse:local lighthouse --help
You can run a Docker beacon node with the following command: You can run a Docker beacon node with the following command:
```bash ```bash
$ docker run -p 9000:9000 -p 127.0.0.1:5052:5052 -v $HOME/.lighthouse:/root/.lighthouse sigp/lighthouse lighthouse beacon --http --http-address 0.0.0.0 $ docker run -p 9000:9000 -p 127.0.0.1:5052:5052 -v $HOME/.lighthouse:/root/.lighthouse sigp/lighthouse lighthouse --testnet medalla beacon --http --http-address 0.0.0.0
``` ```
> To join the altona testnet, use --testnet altona instead.
> The `-p` and `-v` and values are described below. > The `-p` and `-v` and values are described below.
### Volumes ### Volumes

View File

@ -14,7 +14,7 @@ account validator create` command:
```bash ```bash
lighthouse account validator create --help lighthouse account validator create --help
Creates new validators from an existing EIP-2386 wallet using the EIP-2333 HD key-derivation scheme. Creates new validators from an existing EIP-2386 wallet using the EIP-2333 HD key derivation scheme.
USAGE: USAGE:
lighthouse account_manager validator create [FLAGS] [OPTIONS] --wallet-name <WALLET_NAME> --wallet-passphrase <WALLET_PASSWORD_PATH> lighthouse account_manager validator create [FLAGS] [OPTIONS] --wallet-name <WALLET_NAME> --wallet-passphrase <WALLET_PASSWORD_PATH>
@ -34,6 +34,9 @@ OPTIONS:
The number of validators to create, regardless of how many already exist The number of validators to create, regardless of how many already exist
-d, --datadir <DIR> Data directory for lighthouse keys and databases. -d, --datadir <DIR> Data directory for lighthouse keys and databases.
--debug-level <LEVEL>
The verbosity level for emitting logs. [default: info] [possible values: info, debug, trace, warn, error,
crit]
--deposit-gwei <DEPOSIT_GWEI> --deposit-gwei <DEPOSIT_GWEI>
The GWEI value of the deposit amount. Defaults to the minimum amount required for an active validator The GWEI value of the deposit amount. Defaults to the minimum amount required for an active validator
(MAX_EFFECTIVE_BALANCE) (MAX_EFFECTIVE_BALANCE)
@ -43,6 +46,9 @@ OPTIONS:
-s, --spec <TITLE> -s, --spec <TITLE>
Specifies the default eth2 spec type. [default: mainnet] [possible values: mainnet, minimal, interop] Specifies the default eth2 spec type. [default: mainnet] [possible values: mainnet, minimal, interop]
--testnet <testnet>
Name of network lighthouse will connect to [possible values: medalla, altona]
-t, --testnet-dir <DIR> -t, --testnet-dir <DIR>
Path to directory containing eth2_testnet specs. Defaults to a hard-coded Lighthouse testnet. Only effective Path to directory containing eth2_testnet specs. Defaults to a hard-coded Lighthouse testnet. Only effective
if there is no existing database. if there is no existing database.
@ -60,7 +66,7 @@ The example assumes that the `wally` wallet was generated from the
[wallet](./wallet-create.md) example. [wallet](./wallet-create.md) example.
```bash ```bash
lighthouse account wallet validator --name wally --wallet-password wally.pass lighthouse --testnet medalla account validator create --name wally --wallet-passphrase wally.pass --count 1
``` ```
This command will: This command will:
@ -71,5 +77,6 @@ This command will:
- An encrypted keystore containing the validators voting keypair. - An encrypted keystore containing the validators voting keypair.
- An `eth1_deposit_data.rlp` assuming the default deposit amount (`32 ETH` - An `eth1_deposit_data.rlp` assuming the default deposit amount (`32 ETH`
for most testnets and mainnet) which can be submitted to the deposit for most testnets and mainnet) which can be submitted to the deposit
contract. contract for the medalla testnet. Other testnets can be set via the
`--testnet` CLI param.
- Store a password to the validators voting keypair in `~/.lighthouse/secrets`. - Store a password to the validators voting keypair in `~/.lighthouse/secrets`.