How To Run An ETH 2.0 Beacon Node Using The Lighthouse MacOS Client

Written by planett | Published 2020/09/06
Tech Story Tags: ethereum | eth2.0 | non-tech-guide | macos | lighthouse | goerli-node | running-ethereum-node-on-macos | beacon-node-eth-2.0-lighthouse

TLDR This article will guide you through running ETH2.0 Beacon Node with Lighthouse client on MacOS. This guide can’t be used to run other clients as there may be differences when running different ETH1 clients to run Goerli node and other ETH2.0 clients. The goal of this article is to guide you. through becoming a validator without the need to reach out to teams so you can post “This is exciting” kinda tweet when you manage to spin off your Beacon node.via the TL;DR App

This article will guide you through running ETH2.0 Beacon Node with Lighthouse client on MacOS if you have barely to 0 experiences with Terminal command lines and you want to spin off Lighthouse Beacon node and join the validator pool on ETH2.0 Beacon chain with Lighthouse client. This guide includes spinning off Nethermind Goerli node.
The goal of this article is to guide you through becoming a validator without the need to reach out to teams so you can post “This is exciting” kinda tweet when you manage to spin off your Beacon node (make sure to tag me if you use this guide). This guide can’t be used to run other clients as there may be differences when running different ETH1 clients to run Goerli node and other ETH2.0 clients to run Beacon node.
Note: You may experience running into a bugs. Don’t worry about bugs, make sure to report them to teams if you experience some :) If you will get stuck, reach out to the teams- they’re happy to assist you.

Intro

Ethereum has recently celebrated it’s 5th Birthday (July 30th) since genesis block of ETH1 chain was mined. Today, August 4th 1pm UTC ETH2.0 Medalla testnet will go live. This is super exciting moment for Ethereum community as the road to ETH2.0 is going public will start processing attestations and blocks on Proof-Of-Stake mechanism. This is the beginning of the slot zero of epoch zero. Important note — Medalla is just Testnet, which means that you’re going to use Goerli testnet gETH to stake and join Medalla Validator pool. Not a real mainnet ETH.
If you’re interested to dive more into ETH2.0 I highly recommend you to check out The State of ETH2, June 2020 by Danny Ryan
TL:DR of what we are going through in this guide
  • Install Developer Libraries
  • Spin off ETH1 Goerli node
  • Make deposit via Launchpad
  • Pick ETH2.0 client
  • Install Lighthouse Developer Libraries
  • Run Lighthouse Beacon Node
  • Run Lighthouse Validator Client
  • Additional Reading

Install Developers libraries📚⌨️

This is just a basic installation of what we need in order to spin off ETH1 Goerli node and make deposit on ETH2.0 chain via Launchpad. We will do some installation later, as every ETH2.0 client have different requirements on what needs to be installed in order to run their client.
You will need to install a few developer libraries at first. In order to have no struggles, neither “red lines” — errors in Terminal window, you should head over to “Security & Privacy” window on your Mac and select “Open Anyway” as you may experience that some apps are not notarised by Apple, which may cause you some headache moments. Use this guide for a better explanation with screenshots. You will need this step to enable Nethermind runner — we will go through this step later. You may need this step to enable Homebrew or other libraries, programming languages.
Homebrew — This is the magic that will help you install and run other programs on your MacOS. This is the basic you need in order to be able to run next programs and help you with installation process. Copy paste this into your Terminal:
brew install gmp && brew install snappy && brew install lz4
OpenSSL — this is general-purpose cryptographic library that Lighthouse, and I believe other ETH2.0 clients are using. Copy paste into Terminal:
brew install openssl
I hope that you made it through this important step, it will be just simpler 🙂

Goerli Node

Goerli node is well supported across all ETH 1.0 clients, tooling, and infrastructure, and is used to test the ETH 2.0 transition through a deposit contract deployed to Goerli. You need to run Goerli testnet in order to make deposit contract that you upload as “deposit data” to launchpad that will allow you to stake on ETH2.0 Beacon chain. You have more options to pick which client to spin off in order to run Goerli node — the most used is Geth, lighter one is Nethermind.
Note: Geth may be easier to spin off, Nethermind is lighter.You may experience some bugs which are not something that you can’t deal with. I found a great guide on how to spin off Lighthouse with Geth node. There’s another guide on how to spin off Goerli Geth node.
Request gETH — Goerli ETH
You will need gETH or Goerli ETH in order to stake on ETH2.0 Beacon node. There are multiple ways how to request for gETH:

Spinning off Nethermind Goerli node

To spin off Nethermind Goerli node head over to downloads page and download the latest version of Nethermind ETH1 client. Unzip file (click on it). You may experience some struggles as Nethermind is not notarized app by Apple so head over this guide and enable “Nethermind.Launcher” file. Now paste into Terminal:
brew install rocksdb
Let the operation process then paste into Terminal:
./Nethermind.Launcher
  • select Goerli (light Clinque testnet)
  • select sync: Fast sync
  • type: N to not configure eth stats
You should be able to see this on your Terminal:
Now you should be able to get logs and run Goerli node 🥳
This may take some time, depending on your internet bandwidth.
Note: I recommend you to check out this guide by Nethermind on how to run Nethermind node and logs explanation.
If you will experience some bugs, just restart the node by Control + C and type/paste into Terminal:
./Nethermind.Launcher
And start this process again:
  • select Goerli (light Clinque testnet)
  • select sync: Fast sync
  • type: N to not configure eth stats
Feel free to reach out to Nethermind team on Gitter if you are stuck at this point.

Make deposit via Launchpad 💸

This is pretty exciting part as you don’t need to deal with Terminal for a while. This is the part where you will deposit 32 gETH (Goerli ETH). Head over to Launchpad website (in your browser). Make sure to read the steps carefully although you’re going to stake just gETH which is testnet ETH (have no real value) but you still should be aware of what are you doing. Make sure to pay attention to Signing Keys (key management). Hit continue button. Open new Terminal window, at this point you should have 2 Terminal windows open — one with Goerli node, one which you will use to make deposit. Just copy paste this line into your second (new) Terminal window:
./deposit — chain medalla
Now pick your mnemonic language — it doesn’t really matter which one you choose, you will get mnemonic worlds — randomly generated worlds in different language. English is nice by default but you can pick any from 7 languages.
Type the language into your Terminal and make sure to save this mnemonic phrase somewhere offline.
Now type the password, be careful there won’t be any appearance of you typing the password so I recommend you to use offline text editor to paste your password — you can use Notes, Word or anything other. Make sure to save this password as well as your mnemonic phrase
Paste the password, hit enter. This cute Rhino should appear in your Terminal:
Now continue on to the next step in Launchpad.
Find “deposit-data- [timestamp — numbers].json file — windows will appear where you will find this file. You can find it in Finder User (your Mac username) → eth2.0-deposit-cli → validator_keys. This are the keystores that generated Rhino.
Now you are going to make transaction on Launchpad.
Make sure to select Goerli Test Network on your wallet and deposit Goerli ETH not mainnet ETH.
Don’t worry about gas fees, this is not real Ether just test gETH and so the gas fees doesn’t matter at this point. Make a transaction and tadaaaa!

Pick ETH2.0 Client

There’s a great overview of ETH2.0 Clients by Somer Esat. I highly recommend you to go through it at least to get a big picture of why there are so many ETH2.0 clients so you will pick the one that you like the most.

Lighthouse 💡🏠

Lighthouse is aiming to be the most secure ETH2.0 Client written in Rust. They provide Lighthouse book where you can find a guide on running Validator in Docker which I believe may not be something that you’re familiar with.
In order to run Lighthouse ETH2.0 Client, you will need to:
  • Install Lighthouse Developer Libraries
  • Run Lighthouse Beacon Node
  • Run Lighthouse Validator Client

Install Lighthouse Developer Libraries 📚⌨️

You need to install Cmake — building tool and Rust — programming language and clone Lighthouse library in order to spin off — run Lighthouse Beacon Node and Validator Client.
Cmake — is a building tool which is required by some libraries that are apart of Lighthouse install package that you need to download with extra command line. Copy paste into Terminal:
brew install cmake
Rust — it is a programming language that Lighthouse is written in. You need to install rust in order to run Lighthouse client. Copy paste into Terminal:
curl — proto ‘=https’ — tlsv1.2 -sSf https://sh.rustup.rs | sl
Clone Lighthouse library — you need to clone Lighthouse library in order to be able to run Lighthouse Beacon Node and Validator client. Copy paste into Terminal:
git clone https://github.com/sigp/lighthouse.git cd lighthouse

Run Lighthouse Beacon Node

The beacon node is a program that maintains the current state of the chain — network and talking to other peers — nodes on the network.
Now back to your Terminal. You’re a few Terminal lines away — a few Terminal lines close to be ETH2.0 Medalla validator. At this point you should have open 2 Terminal windows — one with Goerli testnet running, one with ETH2.0 deposit client (where you had Rhino). Open new Terminal window and paste:
lighthouse bn — http — eth1
This will start your Lighthouse Beacon node which is a program that maintains the current state of the chain by talking to other peers on the network.
This is what you should see on your Terminal:

Run Lighthouse Validator Client

Now you Lighthouse Beacon Chain is running, let’s do the final step — run the Validator Client which will be used to validate blocks on the ETH2.0 network.
In this step you will use Terminal with Rhino — eth2.0- deposit-cli. Paste into your Terminal:
lighthouse account validator import — directory validator_keys
Now you need to paste your password again (password the one word, not mnemonic phrase — many words).
Your Terminal will show you many lines starting with:
The last step
The Validator Client (vc) is a program that holds your keys (one or more depending on how many validators you’re running) and signing messages (blocks) that you send to the network.
Now you need to paste last thing into your Terminal, which will kick off the Validator Client. Use Terminal with Rhino — eth2.0-deposit-cli window and paste into this Terminal:
lighthouse vc

Congratulations ! You’re now ETH2.0 Lighthouse client Validator of Medalla network 🤗

I hope this article was educational and provided you all information you needed in order to join Lighthouse ETH2.0 Beacon node validator. Now you can make a Tweet about being apart of the network 😄
Make sure to save you mnemonic phrase and password in an offline storage.
Additional reading
There’s so much to read about ETH2.0, here’s a list of what I recommend you to check out.
If you’re interested in reading more about Launchpad, check out this article.
This may be similar to this article but maybe a bit outdated — Using Nethermind to Run a Validator in Eth2
There’s a guide on how to run Lighthouse ETH2.0 validator with Geth client

Kudos to Sigma Prime

Thank you so much Mehdi Zerouali for this opportunity to show you how to run Lighthouse validator for Non tech people. Thank you so much to Pawan Dhananjay for technical assistance, answering my questions during this process. It has been a blast to work with Sigma Prime team, good luck with the Lighthouse ETH2.0 Client ! 🥳
Thank you to Tomasz K. Stańczak from Nethermind for helping me out with Goerli node.

Written by planett | Ethereum Sunshine
Published by HackerNoon on 2020/09/06