Ethereum will start tomorrow(1st December) the first phase of its migration to Ethereum 2.0 mainnet. Check this step by step and see how to become a Validator.
Ethereum will start tomorrow(1st December) the first phase of its migration to Ethereum 2.0 mainnet. One of the biggest changes it brings is the switch from the consensus protocol proof of work, to the proof of stake.
Ethereum decentralised ecosystem that is currently maintained by Miners (proof of work) will be replaced with Validators (proof of stake).
Instead of having to setup powerful mininghardware, and waste a lot of power energy, contribute to the blockchain will be a lot simpler and environment-friendly: Anyone with at least32ETH (~$17.000)can “stake”, become a validator of the Ethereum blockchain, and of course.. profit (~20% APY on the first Year).
Although it’s possible to join with a lower amount, unfortunately this article is not suitable for that purpose — theseStaking Servicesmay be what you’re looking for.
Requirements (for the tutorial below):
- 32 Eths for every Validator — You can setup as many Validators as you want.
- An Ubuntu 18/20 Server with at least 600GB SSD, and 16GB Ram — It costs me around €50/monthon Hetzner.com
Step 1 — Full Node of ETH 1.0
We’ll start by the most time consuming step, syncing with the ETH1.0 blockchain. Due to the current size of the network, it would take between24 to 48hrsto fully sync your full node.
As we’ll have to keep synced with the network while validating the ETH 2.0, we’ll install and run Go Ethereum (Geth).
#Add Reposudo add-apt-repository -y ppa:ethereum/ethereum#Install Gethsudo apt-get updatesudo apt-get install ethereum
To ensure it’s aways running, even after a crash or a reboot, we’ll create an Ubuntu service for Geth:
#Create Service / Unitsudo nano /etc/systemd/system/geth.service
And paste the following code:
[Unit]Description=Geth[Service]ExecStart=/usr/bin/geth --http --syncmode fastStandardOutput=append:/root/geth.logRemainAfterExit=noRestart=on-failureRestartSec=5s[Install]WantedBy=default.target
Then:
#Enable Servicesudo systemctl enable geth#Start Servicesudo systemctl start geth#Ensure it's running, by checking logstail -f /root/geth.log
Step 2— Generate your ETH2 Deposit Address(es)
Download the most recent releaseEth2.0-deposit-cli/releases.
Then run:
#Generate Ethereum 2.0 Deposit Address./deposit new-mnemonic
After you complete the interactive CLI, you may have saved your 24-word mnemonic, together with some files — deposit_data, and keystore(s) — we’ll come to these later.
Store the mnemonic in a safe place as it’s the only way to withdrawal your funds later.
Step 3 — Make the Deposit(s) via ETH2 Launchpad
After you have the addresses ready, it’s time to visit the launchpad to make the deposit simply and securely.
Read and accept everything, until you reach theUpload Deposit Filepart. You’ll have to upload the recently createddeposit_data-xxxxx.json
Connect your preferred wallet, and fund the deposit until you fund the addresses generated.
Step 4— Setup Prysm — Implementation of ETH 2.0
To continue our setup, we’ll install Prysm, which is basically an implementation of Ethereum 2.0 written in Go. If you want to learn more, check this link:https://docs.prylabs.network/docs/getting-started
#Create Directory for Installationcd ~ && mkdir prysm && cd prysm#Install Prysm from Sourcecurl https://raw.githubusercontent.com/prysmaticlabs/prysm/master/prysm.sh --output prysm.sh && chmod +x prysm.sh
Then we Run the Beacon Node connecting it to the Ethereum 1 Full Node of Step 1. It must be fully Synced with the Network, otherwise we’ll have an error. If it’s happening just wait, and try again later.
#Start beacon Node/root/prysm/prysm.sh beacon-chain --http-web3provider=http://localhost:8545
When the beacon node finally runs, we can create another Ubuntu Service to ensure the beacon node will be always running like we did before for Geth
#Create Service / Unitsudo nano /etc/systemd/system/prysm_beacon.service
And paste the following code:
[Unit]Description=Geth[Service]ExecStart=/bin/bash /root/prysm/prysm.sh beacon-chain --http-web3provider=http://localhost:8545RemainAfterExit=noRestart=on-failureRestartSec=5s[Install]WantedBy=default.target
Then:
#Enable Servicesudo systemctl enable prysm_beacon#Start Servicesudo systemctl start prysm_beacon
Step 5— Import the Funded ETH2 Addresses
We’re almost over: Now you have to copy/upload the generated keys at step 2, and funded at step 3 to the server, and run the following code, with the parameter of their location
#Import Accounts to Prysm/root/prysm/prysm.sh validator accounts import — keys-dir=/root/prysm/validator_keys
It will ask you to ask you for a password to secure the wallet, and also the password you used to generate the key(s) in step 2
Step 6— Run your Validator
We’re good to Go!
Our Ethereum 1.0 node is running and synced, our beacon node is running, and our account(s) are well funded and imported — Let’s start our Validator:
#Start Prysm Validator/root/prysm/prysm.sh validator
If it runs, it means everything is done with Prysm —Your Node is 100% ready to start Validating — , let’s start the automation, by creating a file called “pw”, and input there the wallet password you created on Step 5.
Then we’ll create another Ubuntu Service that loads thatpw file, and autostarts, ensuring the validator runs all the time.
#Create Service / Unitsudo nano /etc/systemd/system/validator.service
And paste the following code:
[Unit]Description=Validator[Service]ExecStart=/bin/bash /root/prysm/prysm.sh validator --wallet-password-file /root/prysm/pwStandardOutput=append:/root/validator.logRemainAfterExit=noRestart=on-failureRestartSec=5s[Install]WantedBy=default.target
Then:
#Enable Servicesudo systemctl enable validator#Start Servicesudo systemctl start validator#Ensure it's running, by checking logstail -f /root/validator.log
Written byJoão Silva| Business Development Manager at Cleverti