English
Guide: How to stake on ETH2 Medalla Testnet with Lodestar on Ubuntu
Nov 24 2020 Update: The new mainnet guide is located here.
Instructions below are now deprecated and for reference only.
Lodestar is a Typescript implementation of the official Ethereum 2.0 specification by the ChainSafe.io team. In addition to the beacon chain client, the team is also working on 22 packages and libraries. A complete list can be found here. Finally, the Lodestar team is leading the Eth2 space in light client research and development and has received funding from the EF and Moloch DAO for this purpose.

🏁
0. Prerequisites

👩💻
Skills for operating a eth2 validator and beacon node

As a validator for eth2, you will typically have the following abilities:

🎗
Minimum Setup Requirements

  • Operating system: 64-bit Linux (i.e. Ubuntu 20.04 LTS)
  • Processor: Dual core CPU, Intel Core i5–760 or AMD FX-8100 or better
  • Memory: 8GB RAM
  • Storage: 20GB SSD
  • Internet: Broadband internet connection with speeds at least 1 Mbps.
  • Power: Reliable electrical power.
  • ETH balance: at least 32 Goerli ETH
  • Wallet: Metamask installed
  • Operating system: 64-bit Linux (i.e. Ubuntu 20.04 LTS)
  • Processor: Quad core CPU, Intel Core i7–4770 or AMD FX-8310 or better
  • Memory: 32GB RAM
  • Storage: 100GB SSD
  • Internet: Broadband internet connections with speeds at least 10 Mbps
  • Power: Reliable electrical power with uninterruptible power supply (UPS)
  • ETH balance: at least 32 Goerli ETH
  • Wallet: Metamask installed
If you need ideas or a reminder on how to secure and harden your node, refer to

🛠
Setup Ubuntu

If you need to install Ubuntu, refer to

🎭
Setup Metamask

If you need to install Metamask, refer to

🤖
1. Install a ETH1 node

Ethereum 2.0 requires a connection to Ethereum 1.0 in order to monitor for 32 ETH validator deposits. Hosting your own Ethereum 1.0 node is the best way to maximize decentralization and minimize dependency on third parties such as Infura.
Your choice of either OpenEthereum, Geth, Besu or Nethermind.
OpenEthereum (Parity)
Geth
Besu
Nethermind

🤖
Install and run OpenEthereum.

1
mkdir ~/openethereum && cd ~/openethereum
2
wget https://github.com/openethereum/openethereum/releases/download/v3.0.1/openethereum-linux-v3.0.1.zip
3
unzip openethereum*.zip
4
chmod +x openethereum
5
rm openethereum*.zip
Copied!

Start OpenEthereum on goerli chain.

1
./openethereum --chain goerli
Copied!

🧬
Install from the repository.

1
sudo add-apt-repository -y ppa:ethereum/ethereum
2
sudo apt-get update -y
3
sudo apt-get install ethereum -y
Copied!

🐣
Start the geth node for ETH Goerli testnet.

1
geth --goerli --datadir="$HOME/Goerli" --rpc
Copied!

🧬
Install java dependency.

1
sudo apt install openjdk-11-jdk
Copied!

🌜
Download and unzip Besu.

1
cd
2
wget -O besu.tar.gz https://bintray.com/hyperledger-org/besu-repo/download_file?file_path=besu-1.5.0.tar.gz
3
tar -xvf besu.tar.gz
4
rm besu.tar.gz
5
cd besu-1.5.0/bin
Copied!

Run Besu on the goerli network.

1
./besu --network=goerli --data-path="$HOME/Goerli"
Copied!

Install dependencies.

1
sudo apt-get update && sudo apt-get install libsnappy-dev libc6-dev libc6 unzip -y
Copied!

🌜
Download and unzip Nethermind.

1
mkdir ~/nethermind && cd ~/nethermind
2
wget -O nethermind.zip https://nethdev.blob.core.windows.net/builds/nethermind-linux-amd64-1.8.77-9d3a58a.zip
3
unzip nethermind.zip
4
rm nethermind.zip
Copied!

🛸
Launch Nethermind.

1
./Nethermind.Launcher
Copied!
  • Select Ethereum Node
  • Select Goerli select Fast sync
  • Yes to enable web3 / JSON RPC
  • Accept default IP
  • Skip ethstats registration
Syncing the node could take up to 1 hour.
Your eth1 node is fully sync'd when these events occur.
  • OpenEthereum: Imported #<block number>
  • Geth: Imported new chain segment
  • Besu: Imported #<block number>
  • Nethermind: No longer syncing Old Headers

2. Obtain Goerli test network ETH

Join the Prysmatic Labs Discord and send a request for ETH in the -request-goerli-eth channel
1
!send <your metamask goerli network ETH address>
Copied!
Otherwise, visit the
🚰
Goerli Authenticated Faucet.

👩💻
3. Signup to be a validator at the Launchpad

  1. 1.
    Install dependencies, the ethereum foundation deposit tool and generate keys.
1
sudo apt install python3-pip git -y
Copied!
1
mkdir ~/git
2
cd ~/git
3
git clone https://github.com/ethereum/eth2.0-deposit-cli.git
4
cd eth2.0-deposit-cli
5
sudo ./deposit.sh install
Copied!
1
./deposit.sh --chain medalla
Copied!
2. Follow the prompts and pick a password. Write down your mnemonic and keep this safe, preferably offline.
3. Follow the steps at https://medalla.launchpad.ethereum.org/ but skip the steps you already just completed. Study the eth2 phase 0 overview material. Understanding eth2 is the key to success!
4. Back on the launchpad website, upload the deposit_data.json found in the validator_keys directory.
5. Connect your metamask wallet, review and accept terms.
6. Confirm the transaction.
Be sure to safely save your mnemonic seed offline.

💡
4. Build Lodestar from source

Install curl and git.
1
sudo apt-get install git curl
Copied!
Install yarn.
1
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
2
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
3
sudo apt update
4
sudo apt install yarn
Copied!
Confirm yarn is installed properly.
1
yarn --version
2
# Should output version >= 1.22.4
Copied!
Install nodejs.
1
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
2
sudo apt-get install -y nodejs
Copied!
Confirm nodejs is installed properly.
1
nodejs -v
2
# Should output version >= v12.18.3
Copied!
Install and build Lodestar.
1
cd ~/git
2
git clone https://github.com/chainsafe/lodestar.git
3
cd lodestar
4
yarn install
5
yarn run build
Copied!
This build process may take up to an hour.
Verify Lodestar was installed properly by displaying the help menu.
1
yarn run cli --help
Copied!

🔥
5. Configure port forwarding and/or firewall

Specific to your networking setup or cloud provider settings, ensure your beacon node's ports are open and reachable. Use https://canyouseeme.org/ to verify.
  • Lodestar beacon chain node will use port 30607 for tcp and port 9000 for udp peer discovery.
  • geth node will use port 30303 for tcp and udp

🏂
6. Start the beacon chain and validator

Locate your keystore filename(s).
1
ll $HOME/git/eth2.0-deposit-cli/validator_keys/
Copied!
Update MY_KEYSTORE_FILE with your validator key's filename. If you have multiple validator keys, repeat this sequence for each key.
1
MY_KEYSTORE_FILENAME=<FILENAME OF YOUR keystore-m_.....json>
Copied!
Copy your keystore file to voting-keystore.json according to loadstar's expected file naming structure.
1
shortPubKey=$(cat ${MY_KEYSTORE_FILENAME} | jq -r '.pubkey')
2
PUBKEY=$(echo 0x${shortPubKey})
3
echo VALIDATOR PUBKEY: ${PUBKEY}
4
5
mkdir -p $HOME/git/lodestar/.medalla/keystores/${PUBKEY}
6
7
cp $HOME/git/eth2.0-deposit-cli/validator_keys/$MY_KEYSTORE_FILENAME \
8
$HOME/git/lodestar/.medalla/keystores/${PUBKEY}/voting-keystore.json
Copied!
Example: If your pubkey is 0x846...0f00 then your keystore should be located as follows:
$HOME/git/lodestar/.medalla/keystores/0x846...0f00/voting-keystore.json
Store your validator's password in a secrets file, named as it's pubKey without 0x.
1
mkdir -p $HOME/git/lodestar/.medalla/secrets
2
echo "my_password_goes_here" > $HOME/git/lodestar/.medalla/secrets/${shortPubKey}
Copied!
Start your beacon chain.
1
cd $HOME/git/lodestar
2
yarn run cli beacon --testnet medalla \
3
--eth1.provider.url http://localhost:8545 \
4
--metrics.serverPort 8009 \
5
--graffiti="poapboP...CHANGEME"
Copied!
If you cannot find peers, then likely port 9000 is already in use. Change the port in the file.medalla/beacon.config.json located at network > bindAddr
Start your validator in a new terminal window.
1
cd $HOME/git/lodestar
2
yarn run cli validator run --testnet medalla
Copied!
WARNING: DO NOT USE THE ORIGINAL KEYSTORES TO VALIDATE WITH ANOTHER CLIENT, OR YOU WILL GET SLASHED.
Validator client - Responsible for producing new blocks and attestations in the beacon chain and shard chains.
Beacon chain client - Responsible for managing the state of the beacon chain, validator shuffling, and more.
Congratulations. Once your beacon-chain is sync'd, validator up and running, you just wait for activation. This process takes up to 8 hours. When you're assigned, your validator will begin creating and voting on blocks while earning ETH staking rewards.
Use beaconcha.in and register an account to create alerts and track your validator's performance.

🕒
7. Time Synchronization

Because beacon chain relies on accurate times to perform attestations and produce blocks, your computer's time must be accurate to real NTP or NTS time within 0.5 seconds.
Setup Chrony with the following guide.
chrony is an implementation of the Network Time Protocol and helps to keep your computer's time synchronized with NTP.

🧩
8. Reference Material

Join the ChainSafe Discord Server!
Discord
Installation - Lodestar documentation
https://medalla.launchpad.ethereum.org/
medalla.launchpad.ethereum.org
GitHub - ChainSafe/lodestar: 🌟 TypeScript Implementation of Ethereum proof of stake
GitHub

🧙♂
9. Updating Lodestar

1
cd ~/git/lodestar
2
git pull
3
yarn install
4
yarn run build
Copied!
Restart as per normal operating procedures.
Congrats on completing the guide.
Did you find our guide useful? Let us know with a tip and we'll keep updating it.
It really energizes us to keep creating the best crypto guides.