How To Setup a Teku Validator Node
EthStaker Workshops and Technical Guides · January 2021 · 25:05
This EthStaker workshop walks through setting up a validator on Teku, the Java-based Ethereum consensus client built by Consensys. It covers installing the client, generating validator keys, and connecting to the beacon chain to begin proposing and attesting blocks. The session is aimed at solo stakers running their own hardware rather than relying on custodial or pooled staking 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 all right let's go ahead and get started with setting up our techyou validator node on the puremont testnet so let's dive right into the guides here uh just one warning in fact it's on the guides as well this is for the puremont test net this is not for mainnet please do not send any ether to the deposit contract or do anything with main net assets as they will not work correctly so let's go ahead and continue on one of the steps that we will be skipping because it's outside of the scope of this validator series
is connecting to the server remotely since this is a local environment this is not applicable to us so we're going to go ahead and skip however the first thing we are going to do is update our server and make sure that we are running all of the latest software so go ahead and uh let's copy and paste this into our command line uh just real quick for those of you who are not familiar with working in the command line these dollar signs are going to be very common within this guide this is simply to represent a new command so we copy everything to the right of the dollar sign we don't actually copy the dollar sign along with it so again let's go ahead and copy and paste this update command it'll ask us for our administrative password let's put that in and we'll just wait for this to update
all right that first line has completed let's go ahead and run the second command here and we're all set so let's go ahead and continue on we are also going to skip step two in securing the server configuring the firewall and allowing ssh access again these are outside of the scope of what we're trying to do here we simply want to spin up a validator and nothing more however i highly recommend you look over these steps in the guides and follow them as you would at home so stopping at the allow go ethereum portion what we're going to do here is open up the applicable ports for both the es1 and eth2 node starting with copy and pasting this command we're just going to
open up port 30303 and then the port 9000 for teku there are commands here for opening up the ports to allow for graffana and prometheus which are monitoring and a dashboard for your validator again this is also outside of the scope of this validator series these steps are outlined perfectly in these guides if you want to follow along at home please do so all right so let's clear our screen first by typing the word clear and hitting enter and now what we're going to do is download and install the ethereum one geth node let's go ahead and start by downloading the program
all right that's completed downloading let's go ahead and update the package and now we're going to install geth using the install command so let's go ahead and copy and paste that over to our command line and hit enter all right let's go ahead and clear our screen now that geth has been installed first before we start it what we're going to do is create a background service this allows the program to run in the background while we process other parts of it mainly adding the beacon chain and the validator packages also we don't have to worry about having sessions in our server
with having a background program do this we can we just know that everything is running in the background even after reboots which is great so let's go ahead and do that by creating user let's copy this next command by creating the data directory for our geth node and then copying this command to give the appropriate permissions for the directory we had just created now what we're going to do is create the background service with this command you'll notice after issuing it it's going to open up a text editor that's exactly what we want to see and we're simply going to copy and paste the configuration listed in the listed in the guide by sumer
so let's go ahead and copy and paste it and then just briefly update this for formatting sake there we go now to save this what we're going to do is hit control x it's going to ask us do we want to save we'll hit y for yes and then enter to complete that transaction moving right along we're going to go ahead and run the reload command this will apply the changes we had just made and now what we're going to do is start up our geth node let's first issue the start command just copying pasting that and let's run the status command to verify that it is in fact running correctly awesome so we see it's active and running very good so let's go ahead and hit ctrl c to exit and then let's hit go ahead and clear a
screen again all right now what we want to do is run the enable command this allows the geth node to restart if and when your server is rebooted that way you don't have to start everything back up in case there's a reboot so let's go ahead and run the enable command and right here is the log or the journal command rather that allows us to peer into the geth1 node logs so let's go ahead and make sure those are processing and it looks like everything is running correctly so we can see here in the latest logs that our geth node is looking for a number of peers once it has reached the minimum level of peers it will start processing blocks and syncing with
the eth1 chain so let's go ahead and leave that running let's go ahead and hit control c and then clear our screen one more time all right so we have our geth note created the next thing we're going to do is generate our validator keys so let's go ahead and step right into that the first thing we want to do is verify that we are in fact in the home directory using this command and let's install curl we're going to need that to download the deposit cli file all right that is finished now we're just going to [Music] copy and paste this entire curl command and what it's going to do is download
the deposit cli file which is a command line based wizard that is ultimately going to generate our seed phrase our deposit file and our keystore file looks like that is finished downloading let's go ahead and run this command which unloads or unpacks the files that we had just downloaded and that is complete so let's go ahead and change directories into the one that we had just unpacked let's go ahead and clear our screen and let's move on to this next command now what we're actually going to do here is run the deposit cli file however let's go ahead and copy and paste this in our text document first because there's a variable here that we want to change and
that is the number of validators that we need to specifically outline in our case it's just going to be one if for example you were going to run multiple validators say 10 or 20 or whatever the amount is that's the number you would put there another note here and point out is the chain flag and we can clearly see that we're running on the pyrmont test net if you were running on any other test net or main net for example you would simply change out piermont from mainnet let's go ahead and copy and paste the command into our command line and looks like the program is running the first thing it's going to ask us to do is generate a password for our key stores let's go ahead and do that we'll confirm the password
and here we have the seed phrase that the program has generated let's go ahead and copy and paste that into our text document real quick something to note you would never for any reason share the seed phrase with anyone that isn't you effectively anyone that has access or control of your seed phrase has access and control of your validator and thus your ether so make sure you keep it in a safe place away from others and also safe that you know exactly where you put it and how to access it let's go ahead and hit enter it's going to ask to confirm the seed phrase that we had written it down correctly let's go ahead and copy and paste that and there we go it's confirmed now the deposit cli program is generating our
key stores and our deposit files and they have put both of those in this directory location we're actually going to copy and paste that into our text file because we're going to refer to that later all right let's go ahead and hit the enter key and clear our screen let's go ahead and continue right along with sumer's guide one of the things we want to do here is just a quick housekeeping step and that is to change directories to our home directory and then remove the tar file that we had just downloaded since we're no longer in use of it all right the next step is to install all the prerequisite files to run teku so let's go ahead and start
doing that first starting with the install command here all right that's completed let's verify that we're everything worked correctly by just making sure that the java version renders and it doesn't fact so let's go ahead and clear our screen next what we're going to do is clone and build the tecu client and let's go ahead and first verify that we are in the home directory by issuing cd space tilde and then what we're going to do is copy and paste this command into our text document and what we're going to do is change this version number so as of the writing of this guide the teku client has been updated so this was
initially 20.11. we're going to change this to 21.3.0 okay let's go ahead and copy and paste this to our command line alright looks like that's completed let's go ahead and change into the tekku directory and then let's compile using gradle i'm just going to copy and paste this command here all right so let's go ahead and change directories to our home directory and then run this command let's go ahead and clear our screen next
what we're going to do is configure the beacon node this is going to be the exact same steps just like we followed for the eth1 node we're going to create a background and then run that service so let's first add the user let's go ahead and make the data next what we're going to do before we copy and paste this command let's go ahead and put it in our text editor here and we've got a variable path that we need to update with our specific validator key directory so we're just going to replace the validator key path with our specific path and then
we're going to copy and paste that in our command line great let's go ahead and change into the we'll do an ls which is a list looks like everything is in there and then we're just going to remove our deposit data so we're going to do sudo rm and then just double click the deposit data and right click and then it'll copy it over and we're all set validator password file
just like we did before now what we're going to do is create the validator password file so let's go ahead and clear our screen and then run the following command next what we're going to do is open up this command but before we do so let's copy this into our text editor and we need to put the name of our json file so we're just going to copy and paste our key store and then now that we have that made let's go ahead and paste it into our command line now what we're going to do is input the password that we had created during the deposit
cli so let's go ahead and do that to save this we'll just hit control x then y to save and enter to save everything else next what we're going to do is set the appropriate permissions so let's go ahead and copy these commands and we'll just do an ls to make sure that those permissions rendered correctly and they did in fact okay wonderful now let's go ahead and run the following commands there we go
now let's create our teku configuration file so let's go ahead and clear our next what we're going to do is just copy and paste the configuration file provided in the guide and what we're going to do here first is change the validator graffiti string this is just an arbitrary string of text that you can put on that will publish once your validator proposes a block so to save this let's go ahead and hit control x then y to save and enter to get out let's clear our screen we're going to do the same thing here
this is for the background service for teku we're just going to copy and paste the configuration and then slightly modify for formatting sake and then to save we'll do control x then y to save and enter to exit and moving right along the next thing we're going to do is run the following command to reload the system daemon for the changes to take effect into the system the taku service let's go ahead and issue the start command let's go ahead and issue the status
command next to make sure that it is in fact running and it looks like we're up and running we can see that we're active and so to exit the screen let's go ahead and hit control c and let's go ahead and clear our screen i'm continuing on with some air's guide let's go ahead and run the enable command this allows the system to or excuse me if your system gets rebooted this command makes sure that the teku service also reboots and starts up so we'll go ahead and run that let's confirm that everything is processing correctly by running the journal command this allows us to peer into the logs and looks like we're all set there and we can see that the client is
started so let's go ahead and hit ctrl c to exit and then clear our screen all right so the next thing we're going to do is fund the validator keys and we're going to switch over to the website piermont.launchpad.ethereum.org and we're going to hit the become a validator button now we're going to very quickly go through these screens for the sake of this demonstration however if you actually are interested in running a validator node please make sure that you read and understand these screens as they go in depth in outlining the exact roles responsibilities and risks involved with running a validator so please make sure that you understand
these things we'll go ahead and click continue and we'll just go through and accept these screens again please make sure that you understand all of them and if you don't and need some clarification we're always available on the e-stake or discord invite dot gg slash e-sticker all right here we're going to put in the number of validators that we run all right now we're going to now what we're going to do is supply the number of validators that we're going to run in our case it's just going to be the
one the rest of these options can remain the defaults and then at the bottom here we're just going to confirm that we have our mnemonic phrase stored in a safe location all right now it's time to upload our deposit file so we can very easily do that by opening up a file manager it's on the left hand side here of your ubuntu task manager let's double click eth2 deposit cli folder double click into the validator keys and we can see both our deposit data and our keystore file what we're interested in is just uploading the deposit file literally just click and drag it into the website and we're set let's go ahead and click continue now
that our deposit data has been uploaded the last step is to fund or deposit our gorly east to the blockchain let's go ahead and connect our wallet all right our wallet is connected let's go ahead and click continue now what we're doing is confirming the summary page yes we want to spin up one validator we'll be using 32 gourley eath we know understand and acknowledge the risks responsibilities of being a node operator actually deposit the funds so let's go ahead and click confirm deposit it's going to open up our wallet yes we want to deposit 32 gore the eth
we are on the gorly testnet go ahead and confirm the transaction has started we can watch this using etherscan what we'll do is just wait a moment here for the transaction to process it shouldn't take long at all all right and our transaction has processed successfully so let's go ahead and click continue 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 test net 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.beaconchain 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 samir 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