How To Setup a Lighthouse Validator Node
EthStaker Workshops and Technical Guides · January 2021 · 29:17
This EthStaker workshop walks through setting up a validator on Lighthouse, the Rust-based Ethereum consensus client built by Sigma Prime. It covers installation, validator key generation, and connecting to the beacon chain to begin solo staking. The session is aimed at home stakers running their own hardware rather than using pooled or custodial services.
Topics
From EthStaker Workshops and Technical Guides, hosted by Eth Staker.
Transcript
hello my fellow eaststakers i am envetica don eth and this is the validator workshop series follow along as i set up and configure an ethereum validator from scratch now for non-technical users this can be an incredibly intimidating experience since running a validator requires a deposit of 32 eth which the current market value of that is roughly 54 000 dollars as of today and also requires the use of the command line now for these reasons we'll be using sumer eset's guides to set up and configure our validator by utilizing the guides developed by samir we'll be provided in-depth explanations of what we're building along with the commands to easily copy and paste to the command line
additionally mayor's guides are well maintained and updated to include steps to maintain your validator over time also these guides have been funded by the ethereum foundation and are considered an industry standard for this recording we'll be deploying an ethereum validator on the puremont test dent if this is your first time running a validator it's good practice to start on a test net for a few weeks to ensure you understand what it is you're doing and verify that the setup is working properly before deploying onto mainnet now we are assuming that you have the necessary prerequisites for running your validator specifically having already requested at least 33 gorly eath opened up a metamask account and have a dedicated machine for staking with a
fresh installation of ubuntu desktop if you don't the video tutorial for those steps are linked in the description of this video for this video tutorial we'll be focusing specifically on configuring and running an ethereum geth node generating and funding the validator keys importing those keys to the eth2 client and finally installing and configuring the eth2 client itself so without further ado let's get into it the first thing we're going to do is create a bit of a workstation here for setting up our validator so i'm going to open up a browser session pull it over to the side here and then pull up submari sets guide now this is specifically for the
lighthouse client now that we have that i'm going to go over here and then i'm just going to type the word term and that will bring up the terminal click on that and then i'm going to open up uh the show applications icon in the bottom left-hand corner and then type text to bring up a text editor these will be the three things that we'll use the most all right and one thing to note before we get too ahead of ourselves all of the links and resources mentioned in this tutorial are all in the description of this video so if you're following along in step with this guide and you're not
sure where we're getting the information from just look at the description of this video and everything should be there scrolling through some mayor's guide we can see that he's got all the information that you would need starting from scratch there are a few warnings in here and just to reiterate this as well this is for the puremont test net this is not for mainnet if you already are familiar with setting up a validator and just want some extra instructions deploying the mainnet there are a separate set of instructions for that links to those in the description now a few items to note that are inside of this guide but outside of the scope for this video tutorial one of these being step 0 which is connecting to the server since we're not remoting in this step is
not applicable to us we're going to hook go ahead and skip over that however the first step we will do is updating our system we've got two commands here so we're simply going to copy this command and paste it into our terminal session we're going to hit enter and then supply our administrative password all right looks like our first update command has completed let's go ahead and copy the second one and go ahead and run that one thing to note for those of you who aren't familiar or used to working in the command line the copy and paste instructions here we copy everything from the right of the
dollar sign here this just signifies that it's a new command to copy and paste so we're not actually copying the entire dollar sign with it just everything to the right of it so let's go ahead and copy this one and paste into our command line and then hit enter okay it looks like our system has completely updated let's go ahead and clear our screen by typing the word clear and then hitting enter now the next step in samara's guide is to cue is to secure the system by configuring the firewall and allowing ssh we're actually going to skip over these steps as they are outside of the scope for this video however if it's something you're interested in and want remote access to
your machines i recommend following these steps one thing however we do want to follow is opening up the applicable ports for both the eth1 and eth2 nodes and we'll do that by opening up ports 30303 and port 9000. let's go ahead and copy and paste these commands into our terminal we can see that that was accepted and let's go ahead and open up the lighthouse port 9000 let's just copy and paste that command and hit enter and we can see that is accepted as well now there are there are instructions on opening up the ports for grafana and prometheus which are a dashboard and monitoring tools again these are also outside of the scope of
we simply want to show the instructions on how to spin up a validator node and nothing more now what we're going to do is clear our screen by typing clear and hitting enter and now it's time to install and run the go ethereum node or geth the first step is to download the binary packages so let's go ahead and copy this command and hit enter now we're to make sure we have the latest version so let's go ahead and run the update command let's clear our screen one more time
and finally we're gonna do the install so sudo apt install geth copy and paste that and enter now continuing along with some mayor's guide let's first clear our screen now let's get into this just briefly before issuing the next few commands and we can see here by the title we're going to run go ethereum as a background service now effectively what's going on here is we're making a small background service you can consider this like an application or a program we're making a very small application that runs in the background and is intelligent enough to know if the machine is on or off so if for example the machine your staking node is rebooted
all of the eth1 eth2 beacon chain will reboot and run in the background this makes sure that you're not missing any attestations or block proposals or any potential rewards for your staking node so let's go ahead and start that process this begins by creating the user and applying the applicable permissions for those users so let's run this first command just copy and paste hit enter now what we want to do is create the directory for all of the data to go into for our eth1 node we're going to make a directory just copy and paste that here and then just set the permissions to
make sure that we have access to that directory that we just created again just copy and paste into the terminal now here's where we actually create the system service let's go ahead and copy and paste this what you're going to notice is once you hit enter it's going to open a text editor called nano if we scroll slightly more we'll see the exact copy and paste this configuration from the guide into this text editor we may have to do some slight editing of the text based on the guide so let's go ahead and do that real quick and what this is doing is setting the
parameters for the systemd program to run in the background making sure that it knows how and where to run we can see here that we have copied and pasted everything correctly so to save this we're going to hit control x it's going to ask us if we do in fact want to save we do so let's hit y and then hit enter to save the document okay for further explanation as to the different parameters and the flags within the systemd service please read on into the guide where some mayor goes on to explain those things moving right along let's go ahead and reload the systemd service
to apply the changes that we just made so let's copy and paste this restart command and now what we can do is start our eth1 geth node so let's go ahead and copy and paste the start command let's in fact verify that the geth node is actually running by issuing this status and there we go we can we've got the bright green dot the service is active and running so we can safely assume that our eth1 geth node is live and processing to exit the screen hit ctrl c and let's type in clear and hit enter the last thing we want to
do in relation to geth is just copy this command here what this is doing is specifically telling the system to automatically restart the service if rebooted so let's just copy and paste and there we go now it is worth noting here that the eth1 node needs to fully sync in order for the eth2 node to sync as well and we can monitor that progress by issuing this command we can do that here by looking at it and here we can see that right now we're just trying to find appears on the network once we've found the minimum amount of peers on the network our eth1 node will begin processing blocks
and syncing data with the eth1 chain now until the eth1 node fully syncs the eth2 node will not be able to so we'll be waiting on this but we can still continue on while this is syncing in the background because we made that service simply hit control c and we'll clear our screen and now the eth1 node will be running in the background while we continue on building out our validator now what we're going to do is install our eth2 client and specifically lighthouse in this case and what we're going to do is first install the dependencies and we're going to run these two commands here let's go ahead and do that looks like
that is complete let's now run the second command and we're just going to copy and paste and hit enter next there are a number of packages we need to install in order for lighthouse to run so let's go ahead and clear our screen again and then we're going to run this command which installs all of the necessary packages let's go ahead and run that all right now that we have the necessary software in order to install and build lighthouse let's go ahead and do that let's first clear our screen and then scroll down here we're going to change our directory using cd and then tilda now we are going to verify that we have
the latest versions let's right-click new tab here verify that the latest version of lighthouse is 1.2.1 so that's where we're going to adjust this here so let's go ahead and copy this into our text editor and then we're just going to change 1.0.0 to 1. to this version which is 1.2.1 and let's go ahead and copy and paste
this into our command line all right looks like that has completed so let's go ahead and issue this last command which is changing into the lighthouse directory and then we're going to just type the command make now depending on your hardware this could take quite a while so go ahead and take a break get a beverage stretch your legs and let's resume back once this is completed all right looks like our machine has finished compiling next what we're going to do is generate our validator keys using the deposit cli so let's go ahead and scroll down to
these commands first let's go ahead and change into our home directory let's just clear our screen then we're going to copy this curl command which is going to download the deposit cli program right that downloaded successfully let's go ahead and unpack it and then change directories into the folder that we just unpacked and just a quick house cleaning item here we're just going to remove the downloaded package that we no longer need and we're all set now what we're going to do is run the deposit
cli program it's effectively a text based wizard that sets up your deposit keys and or excuse me it sets up your deposit file and your key store file so what we're going to do is just copy and paste this but we're actually going to paste this in our text document first the reason for that is there's a variable here that we need to replace and that is the number of validators that we're going to be running now for this tutorial we're just going to focus on a single validator however that being said if you were to run multiple validators this is where you would change that number likewise you can see the chain flag here we're running on puremont if you were to run this on mainnet you'd simply replace that text with a mainnet so let's go ahead and copy this and run
this on our command line and we can see that we're being prompted to supply a password let's go and do and you can see that the deposit cli has generated a seed phrase for us we're going to go ahead and copy this in our text document now it is worth pausing here for just a moment to reiterate that you would never share this seed phrase for any reason effectively whoever holds your seed phrase owns writes to your validator and thus your ether so let's go ahead and click enter to continue
the deposit cli is going to ask to confirm that we have in fact written down our seed phrase we're going to just copy and paste that in and it looks like that's completed now the deposit cli is going to generate our key stores and deposits which it has just completely which it just finished now and then we're going to write down this location this is where the two files are going to be stored so we're just going to put that in our text and we'll refer to that later let's go ahead and press enter and then continue on with our guide next what we're going to do is fund our validator keys so let's head on over to puremont.launchpad.ethereum.org and what we're going to do is click on
become a validator now we are going to click through these fairly quickly however i would make sure that if you're doing this at home you take your time and read through these screens so you fully grasp the responsibilities and risks involved for running in ethereum validator node so let's go ahead and click continue i'm going to go through these fairly quickly we'll select geth and hit continue this is for lighthouse we'll hit now what we're going to do is supply the
number of validators that we're going to be running now for the sake of this demonstration we're going to be doing one validator the rest of these can remain the defaults and then we will confirm that we are keeping our seed phrase in a safe place and hit continue now what we're going to do is navigate to this directory location and we can do that fairly easily by opening up a file explorer and we can see it here so we're already in the home directory there's the eth2 deposit cli folder let's click into that then the validator keys folder and what the launchpad is asking for here is our deposit data and our deposit data file
is right here so let's go ahead and click and drag that and we have successfully completed that step now let's go ahead and continue it's going to ask us to connect a wallet in order to fund that deposit so let's go ahead and click on metamask input our metamask password we've connected our metamask wallet and let's go ahead and click the continue button this is just a summary so yes in fact we do want to run one validator node we understand the risks and responsibilities so let's go ahead and acknowledge those and then hit continue
now what we're going to do is officially deposit our 32 gurley eath in this case however if this was main net this would be the point at which you would deposit your real 32 ether so again this is test ether so let's go ahead and confirm our deposit it'll open up our metamask account for the 32 gurley eth we can verify that here on the gurley test network and then hit confirm looks like the transaction is started we can track this on ether scan if we go over here and looks like our transaction has completed and there it is these are all the details of the deposit transaction let's go back to our guide
and we're just going to scroll through these screens as we just completed it now we're going to do is create the validator wallet that stores the funds created by our validator so let's go ahead and first clear our and then just run cd and then hit enter we want to make sure we're in our home directory before running these next commands so let's go ahead and copy and paste this one to make a directory input our password now what we're going to do for this one is we're going to copy and paste this in our text editor and there are two variables that we need to put in and that's the specific username
for our validator now our username is shown here on the command line which is admin so we're just going to replace it over here and then we're going to copy and paste this onto our command prompt next we will change directories into the lighthouse directory this command in our text editor as well the reason for that is you'll notice that there is an additional variable and it's asking for the specific directory for
our validator keys you'll remember that has been this one right here this was generated when we ran the deposit cli so let's go ahead and replace this and let's go ahead and copy this into our command prompt now it's asking us to confirm the keystore password again this was set up during the deposit cli so let's go ahead and input that password and we have confirmation that everything
is running correctly so let's continue with the guide let's go ahead and clear our screen and then run the following command based off the guide next what we're going to do is configure this is going to be very similar to how we set up the eth1 node or geth in that we have two systems that we're setting up the beacon node and the validator node both of which we're going to set up a background process so let's go ahead and create
the user and we're going to copy and paste this command for creating the directory and then setting the appropriate permissions for that directory okay that all went well now let's go ahead and run this command and let's create and configure the service just like before we did with geth we're going to run this command which will open up a text editor and then based on this guide we will go ahead and copy and paste this entire block and then slightly modify it for format sake
and then to save this we will hit control x it's going to ask us if we want to say save it we'll hit y for yes and then enter to complete it now again this is the configuration file in order for the beacon node to function so we'll go ahead and continue on and then we're going to reload the daemon to apply the changes that we just made next we get to start our beacon node so let's go ahead and run the start command hit enter and let's verify that it is in fact up by running the status command and look at that we are up and running so to exit the screen we'll go ahead and
hit control c let's go ahead and clear our screen next what we're going to do is run the enable this allows the background process to start back up upon reboot now if we want to see the system logs to make sure that the beacon node is processing we can run this journal command let's go ahead and check that out and we can see that things are processing now everything won't work correctly on here exactly yet because what's happening is your beacon node is actually waiting for your geth node to fully sync so until that fully syncs this won't work properly however we can continue setting up the
rest of the validator while this runs in the background let's go ahead and hit ctrl c to exit and then clear our screen now we're going to do the same thing but for our validator so let's go ahead and create the user copy and paste that on the command line we are going to create the directory we're going to paste that into the command line and now what we're going to do is same thing we're going to run this command which will open up the text editor this whole block into the text editor and change the formatting on here to make sure that it's in line with what's on now something to note here for the
validator is the graffiti tag and that right here this is just an arbitrary string of text that you can put in anything you want and if and when your validator proposes a new block on the blockchain it will print whatever you put here as graffiti sort of like a you know digital graffiti tag saying that you were here so let's go ahead and put something funny there and then we'll do control x yes to save and then enter to exit there we go and continuing on let's go ahead and run the reload command that applies the changes that we had just made
copy and pasting that into the command and next what we're going to do is start up our validator so let's go ahead and run the start command we'll copy and paste that and let's copy and paste the status to verify that it is in fact running hey look at that all right so now we have a fully functional and running validator beacon node and so to exit this we're going to go ctrl c let's go ahead and clear our screen next we're going to run the enable command again this is to ensure that if your machine reboots so to do the background processes so let's go ahead run that
and again we can do the same thing here by running the journal command to look at the logs to make sure that things are processing and in fact things are again these two will probably both the beacon and validator node will throw errors until the eth1 node has properly synced that is okay this just verifies that things are functioning so let's go ahead and ctrl c to exit and clear our screen again and that's it you are now running your very own ethereum validator node now a couple items to note here again the eth1 node needs to properly sync and then at which time your beacon node will start syncing and then your validator will start picking up
something also to note if we go back to our browser here let's uh maximize our browser window and go back to the deposit transaction now one thing i want to point out here is the beacon chain deposit section where you have your validator public key this is literally your validator number so if we click into that we're going to see a couple things first we'll see the status of the deposit that we just made and right now we're seeing that there's a a bit of a wait so in about 15 to 16 hours we'll formally see that deposit process on the testnet and the other thing we can do here is if we copy this address next what we're going to do is go to the
piermont dot beacon chain address and then let's just copy and paste our validator address in there and now we can see the full status of where our validator is in relation to the test network so we can see that our deposit has gone through and now it's going to take looks like around 15 hours for our validator to be processed into the network and be contributing attestations and proposing blocks now we did cover a lot of information in this tutorial however the steps accomplished today only represent a minimally functioning i would highly recommend following all of the security steps in samir's guide
additionally if you do want to develop a dashboard to monitor your validator please feel free to follow the instructions provided by sumer which are also in the guides as always if you run into any issues at all the east acre community is here to help our goal is to be welcoming first and knowledgeable second there are no silly questions and no question too small simply ask and we'll do our best to help for more in-depth and advanced features make sure to check out our monthly e-staker validated workshops details on when those are will be hosted on our website at estaker estaker.cc alright that's it for me i'm envetica.eth and we'll see you around