Ethereum 2 (ETH2) Lighthouse Validator — Installation and Running Guide

Attestant.io
Chain started: Altona 29th June 2020
Last tested and updated: 24th July 2020
Source code hash: 21bcc8848d3009cc8116c356993c91f1c0e454ba
Ubuntu: 18.04.3 ubuntu-18.04.3-desktop-amd64.iso
Technical Skills: A basic understanding of Linux
Audience: Developers looking for a quick step-by-step guide to install and run a Lighthouse validator node without leaving this document.

Lighthouse picture courtesy of unsplash.
Introduction
The purpose of this document is to provide a go to guide for installing a Beacon Node and running a Validator on the Lighthouse Ethereum 2 Altona multi-client testnet with no prior knowledge. These instructions are for building from source and set out the minimum set of steps to get a node and validator operating; if more details are required, then please refer to the Lighthouse documentation.
These steps are for installing the testnet node from source on a fresh Ubuntu 18.04 and are likely to work on different code versions but we only tested it on the source code hash above. Attestant is constantly building nodes and updating this document, if you have any issues please let us know. These instructions were used for building a node on the date specified above on the Lighthouse testnet Altona Beacon Chain, which was launched on the 29th June 2020.
Attestant tested the install on 8th-generation 1.80 GHz Kaby Lake Intel Core i5–8250U/i7–8550U processor with 64GB and 1TB SSD. Approximate times are given, where appropriate and the full install took around 1 hour (most of that time is synching the ETH1 testnet). You need at least 16GB of memory but we recommend at least 32GB.
Note: Each new command line starts with a $ and each line needs to be run separately with a return. The $ is command prompt and should not be copied.
Install Essential Tools
$ sudo apt install -y git gcc g++ make screen cmake pkg-config libssl-dev
Install Rust Programming Language
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
You will be prompted with the following 3 options seen below; just hit return to accept option 1, the default.
1) Proceed with installation (default)
2) Customize installation
3) Cancel installation
Update the search path so the Rust compiler is accessible from the terminal. Cargo is the package manager for Rust.
$ source $HOME/.cargo/env
Installing and building the Lighthouse node
The build takes approximately 10 minutes on the machine specified above.
$ git clone https://github.com/sigp/lighthouse.git
$ cd lighthouse
$ make
To get the source code hash of the current version.
$ git rev-parse HEAD
Remember that this repo is under development so expect the code, and hash, to change frequently.
Installing Geth — Ethereum 1 Goerli Testnet
Ethereum 2 is required to read the events from the Altona deposit contract on the Ethereum 1 Goerli testnet, so the next step is to install and run a geth Ethereum 1 node.
Install Geth
$ sudo add-apt-repository -y ppa:ethereum/ethereum
$ sudo apt-get install ethereum -y
Run Goerli testnet
Run geth, unattached to the terminal process, by using the tool “screen” which was installed in the first step. The key sequence “Cntl+a d” means hold down the “control” and “a” at the same time then press the “d” key.
$ screen -S EthTestnet
$ geth --goerli --rpc &>> $HOME/goerli.log
$ Cntl+a d
It will take around 40 minutes for the testnet to sync so that the Beacon Node and Validator can determine the ETH1 deposit has been made.
Geth is also writing to a log file in your home directory and you can monitor this log in another terminal.
$ tail -f $HOME/goerli.log
Running the Lighthouse Beacon Node
You can now start up the Lighthouse Beacon Node and leave it to sync. As we did with the geth process it can be run inside a screen process, writing the output to a log file. Currently the log output will report errors until the Eth1 Goerli testnet has synced.
$ screen -S LighthouseBeacon
$ lighthouse beacon --eth1 --http &>> $HOME/lighthouseBeacon.log
$ Cntl+a d
Generating the validator key
To create a validator key, run the command below.
$ lighthouse account wallet create --name <WalletName> --password-file password.txt
The key information is created in the directory $HOME/.lighthouse/wallets/<public key>. Make a note of the seed words so you can re-create the wallet. From the new wallet a number of validator keys can be created. For example, the following will generate 10 validator keys.
$ lighthouse account validator create --wallet-name <WalletName> --wallet-password password.txt --count 10
This will create a new directory /.lighthouse/validators which contains a directory for each validator key. Inside each directory there are 3 files:
eth1-deposit-data.rlp - deposit data to submit to Ethereum 1
eth1-deposit-gwei.txt - amount of ETH1 to deposit, 32ETH for this testnet
voting-keystore.json - the encrypted secret
A second directory is also created in /.lighthouse/secrets which contains the passphrase generate for each key.
Initiate your Validator on Ethereum 1 via Lighthouse
To activate each validator key, 32ETH needs to be deposited in the deposit contract on the Ethereum 1 Goerli testnet.
To create an Ethereum 1 account run the following and note the public address:
$ geth account new
If you require Goerli Testnet ETH1 for depositing to the contract, you can receive some by sending your test address to the Discord channel -request-goerli-eth https://discord.gg/u5j8S2.
From Lighthouse you can pay all the validator deposits in one go but you will need to unlock the account on geth when running in RPC mode. This approach would not be advisable for the mainnet, as by default geth does not allow the unlocking of accounts when using the -rpc flag. If you stop your geth session and run it on console mode with the extra flag — allow-insecure-unlock.
$ geth --goerli --rpc --allow-insecure-unlock
$ personal.unlockAccount(<ETH1 Address>)
$ <passphrase>
Ensure the unlocked account has enough funds for all the validators, after which you can now run the deposit command below; this will output a transaction hash for each validator. You can then check each hash on the Goerli testnet to see if each deposit was successful.
$ lighthouse account_manager validator deposit --from-address <Ethereum 1 Address> --validator all --eth1-ipc $HOME/.ethereum/goerli/geth.ipc
Start the Validator
The Validator can be started in another screen process and this process will validate every key in the validator directory, once the 32 ETH has been deposited to the Ethereum 1 testnet.
$ screen -S LighthouseValidator
$ lighthouse validator_client &>> $HOME/validator.log
$ Cntl+a d
The validator process will take at least 8 hours before it is activated on the Ethereum 2 Beacon Chain. If you tail the validator log you see something like this:
$ tail -f validator.log
Jul 09 11:52:11.441 INFO Decrypted validator keystore voting_pubkey: 0xa507a3c891baa9928f246febdca853eeb42e406f6ccbcae270c62c6fffc7cf3a0f1bfe781edf4438d9a8183384790fbe
Jul 09 11:52:11.457 INFO Decrypted validator keystore voting_pubkey: 0x90d6c8521985c7bbb384f2b99aaedfbdeac903369146aa2dc7dabc6512a81660699f5ecc9056b2f16b6bb2fae46a1909
Jul 09 11:52:11.457 INFO Decrypted validator keystores count: 10
Jul 09 11:52:11.465 INFO Connected to beacon node version: Lighthouse/v0.1.2-unstable/x86_64-linux
Jul 09 11:52:11.466 INFO Genesis has already occurred seconds_ago: 858126
Jul 09 11:52:11.466 INFO Loaded validator keypair store voting_validators: 10
Jul 09 11:52:11.466 INFO Registering all validators for slashing protection
Jul 09 11:52:11.468 INFO Validator auto-registration complete
Jul 09 11:52:11.468 INFO Block production service started service: block
Jul 09 11:52:11.468 INFO Attestation production service started next_update_millis: 5531, service: attestation
Jul 09 11:52:23.002 INFO Awaiting activation slot: 71511, epoch: 2234, validators: 10, service: notifier
Now just sit back and monitor your Ethereum 2 validator key using the block explorer https://altona.beaconcha.in.
Useful Links
Attestant Ethereum Staking Posts
Ethereum Staking Keys
Block explorer for the Lighthouse beacon testnet
Recent Articles
Contact
If you wish to know more about Attestant, you can contact the team on Telegram https://t.me/attestant