Installing and Running an Ethereum 2 Prysm Validator on the Mainnet
Tags: attestant, eth2, staking, ethereum
Published: 2020-12-17 06:40:07

---
title: Installing and Running an Ethereum 2 Prysm Validator on the Mainnet
published: true
date: 2020-12-10 11:16:10 UTC
tags: attestant,eth2,staking,ethereum
canonical_url: https://medium.com/coinmonks/installing-and-running-an-ethereum-2-prysm-validator-on-the-testnet-c004dd7eece8
---

![](https://cdn-images-1.medium.com/max/498/1*xg5oFPCy3dwapfa6oVkCjA.png)

Chain started: 1st December 2020

Last tested and updated: 9th December 2020

Source code hash: ade3b2f2dffc242341dfc0793984b431a889e5b2

Ubuntu: 20.04

Technical Skills: A basic understanding of Linux

![](https://cdn-images-1.medium.com/max/1000/1*P-x6EaqLcXUgiwNHIZBtGA.png)

The purpose of this document is to provide a simple go to guide for a basic install and running a validator on the Prysm Ethereum 2 Mainnet. It is intended to be the minimum set of steps to get a node up and running and if you do need more details then refer to the Prysm documentation. More detailed instructions can be found on the [Prysm site](https://docs.prylabs.network/docs/getting-started/). There are a lot more complexities that have to be considered for running a validator such as setting up firewalls, rolling logs, etc but this is the bare minimum to get a Prysm validator running.

These are the steps for installing the Mainnet node on Ubuntu 20.04 and are likely to work on different code versions but we only tested it on the source code hash above. [Attestant](https://www.attestant.io/) are constantly building nodes and updating this document, if you have any issues please let us know. These instructions were used for building a node on the date specified above on the Mainnet beacon chain launched on the 1st December 2020. The instructions below also show you how to obtain the source code hash for the current version of the software you have downloaded.

Attestant tested the install on 8th-generation 1.80 GHz Kaby Lake Intel Core i5–8250U/i7–8550U processor with 64GB and 1TB SSD.

**Note:** Each new command line starts with a $ and each line needs to be run separately with a return. The $ is command prompt and should not be copied.

### Installing Ethereum 1 Geth Node

Ethereum 2 requires you to interact with the deposit contract on the Ethereum 1 Mainnet. So this next step is to install and run a geth Ethereum 1 node. Warning: This will take time a few days to sync and currently takes up 330GB of disk space.

#### Install Geth and Screen

```
$ sudo add-apt-repository -y ppa:ethereum/ethereum
$ sudo apt install ethereum screen -y
```

#### Run Etheruem 1 Mainnet

Run geth, unattached to the terminal process, by using the tool “[screen](https://linuxize.com/post/how-to-use-linux-screen/)” which was installed above.

```
$ sudo mkdir -p /var/log/geth && sudo chown $USER /var/log/geth
$ screen -S Eth1Mainnet
$ geth --http &>> /var/log/geth/etheruem1Mainnet.log
$ Ctrl+a d
```

Etheruem 1 is required to run and to be completely synced, so that the Prysm beacon node and validator can determine when ETH1 deposits have been made.

To view the progress of the sycn then you can tail the logs:

```
$ tail -f /var/log/geth/etheruem1Mainnet.log
```

### Install Prysm Client

The code is changing on a daily basis so be prepared pull down the code regularly.

```
$ sudo apt-get install cmake git -y
$ git clone [https://github.com/prysmaticlabs/prysm.git](https://github.com/prysmaticlabs/prysm.git)
$ cd prysm
```

The instructions were tested with the hash at the top of this document. To get the source code hash of the current version you have pulled down then run the following:

```
$ git rev-parse HEAD
```

### Run the Beacon Chain

The following command will start up the beacon chain; with the chain data written to the beaconChain directory .eth2 and the log output to a log file in your home directory.

```
$ sudo mkdir -p /var/log/prysm && sudo chown $USER /var/log/prysm
% screen -S PrysmBeaconChain
$ $HOME/prysm.sh beacon-chain --http-web3provider=[http://127.0.0.1:8545/](http://127.0.0.1:8545/) --log-file=/var/log/prysm/prysmBeaconChain.log 
$ Ctrl+a d
```

To get the most up-to-date version of the software you can just restart the beacon chain and validator which will automatically pull down the software, compile it and run. To re-enter the screen process then you just re-attach to that screen. Useful if you want to kill the process.

```
$ screen -r PrysmBeaconChain
```

If you want to view the logs in real-time then you can tail the log file in /var/log/prysm/.

```
$ tail -f /var/log/prysm/prysmBeaconChain.log
```

### Create Validation and Withdrawal Keys

If you want to do this for real on the Mainnet then creating your keys via the Ethereum foundation’s [launchpad](https://launchpad.ethereum.org/summary). We would recommend going through the process on the Pyrmont [launchpad](https://pyrmont.launchpad.ethereum.org/) first to familiar yourself with the entire process before depositing the Mainnet. If you use the launchpad you can skip this entire key generation process. We also don’t cover creating the deposit data for your validator and withdrawal keys and sending them to Ethereum 1, as the Launchpad covers all these steps.

In this document we will show you how to create accounts using Prysm but internally at Attestant we use ethdo and instructions can be found [here](https://steve-berryman.medium.com/creating-ethereum-2-withdrawal-keys-using-ethdo-6e41b14ddd7b) for an alternative wallet.

It is good security practice to have a complex passphrase generated randomly. Use a password generator, for example pwgen, to create a 24+ mixed case alphanumeric passphrase (pwgen -B 24 -c 1). Store this passphrase somewhere safe and secure such as a password manager. Run the following to install, run and store the result in a file called password.txt:

```
$ sudo apt install pwgen
$ pwgen -B 24 -c 1 -y -n > password.txt
```

#### Create a wallet with a number of accounts

In order to participate in staking you will need to create a Ethereum 2 validator and withdrawal key. For more information on the role of these keys you can see our [blog](https://www.attestant.io/posts/exploring-staking-keys/) and a specific blog on the withdrawal key you can be seen [here](https://www.attestant.io/posts/protecting-withdrawal-keys/).

In this next step we create a wallet which has a number of accounts generated from one set of seeds. In this context we define a _wallet_ to be a collection of Ethereum 2 keys that are grouped under a single name and an _account_ to be a single Ethereum 2 key.

A validator can validate multiple keys, so you can go ahead and create a number of keys. Run the following command and specify the number of accounts you want to create:

```
$ $HOME/prysm/prysm.sh validator wallet create --wallet-dir=$HOME/myTestWallet --keymanager-kind=derived --wallet-password-file=password.txt --skip-mnemonic-25th-word-check=false
```

To list the accounts you just created:

```
$ $HOME/prysm/prysm.sh validator accounts list --wallet-dir=myTestWallet --wallet-password-file=password.txt
```

#### Restore the wallet

Before you use a wallet you should make sure you can restore it from your seed words. So delete the wallet and check it can be restored by running the following, which will prompt you for your seed phrase:

```
$ rm -rf $HOME/myTestWallet
$ $HOME/prysm/prysm.sh validator wallet recover --wallet-password-file=password.txt --wallet-dir=$HOME/myTestWallet --skip-mnemonic-25th-word-check=false
```

### **Running the Validator**

Now that we have the beacon chain running, created validator and withdrawal keys and sent the deposit data to the Eth1 contract, we are now ready to run the validator process. Run the following commands below and the validator will wait until it sees the deposit event raised for your key on Ethereum 1 Mainnet.

```
$ cd prysm
$ screen -S ValidatorTestChain
$ $HOME/prysm/prysm.sh validator --wallet-dir=$HOME/myTestWallet --wallet-password-file=password.txt
$ Ctrl+a d
```

If you want to view the logs in real-time then you can tail the log file in your home directory.

```
$ tail -f $HOME/validator.log
```

Below is our validator log waiting for our validating keys to kick-in:

```
validator-v1.0.4-linux-amd64: OK
gpg: Signature made Mon 07 Dec 2020 17:46:35 GMT
gpg: using RSA key 0AE0051D647BA3C1A917AF4072E33E4DF1A5036E
gpg: Good signature from "Preston Van Loon <[preston@prysmaticlabs.com](mailto:preston@prysmaticlabs.com)>" [unknown]
gpg: WARNING: This key is not certified with a trusted signature!
gpg: There is no indication that the signature belongs to the owner.
Primary key fingerprint: 0AE0 051D 647B A3C1 A917 AF40 72E3 3E4D F1A5 036E
Verified /home/prysm/dist/validator-v1.0.4-linux-amd64 has been signed by Prysmatic Labs.
Starting Prysm validator --wallet-dir=/home/myTestWallet --wallet-password-file=password.txt
[2020-12-09 12:07:10] WARN flags: Running on ETH2 Mainnet
[2020-12-09 12:07:10] INFO node: Opened validator wallet keymanager-kind=derived wallet=/home/myTestWallet/derived
[2020-12-09 12:07:10] INFO node: Checking DB databasePath=/home/myTestWallet/derived
[2020-12-09 12:07:10] INFO node: Starting validator node version=Prysm/v1.0.4/b4437e6cecd78257d2699f42073a90a940baf716. Built at: 2020-12-07 16:42:42+00:00
[2020-12-09 12:07:10] WARN validator: You are using an insecure gRPC connection. If you are running your beacon node and validator on the same machines, you can ignore this message. If you want to know how to enable secure connections, see: [https://docs.prylabs.network/docs/prysm-usage/secure-grpc](https://docs.prylabs.network/docs/prysm-usage/secure-grpc)
[2020-12-09 12:07:10] INFO validator: Waiting for beacon chain start log from the ETH 1.0 deposit contract
[2020-12-09 12:07:10] INFO validator: Validating for public key publicKey=0x820911a11f28
[2020-12-09 12:07:10] INFO validator: Validating for public key publicKey=0xa8382c7fb4be
[2020-12-09 12:07:10] INFO validator: Validating for public key publicKey=0xa2915cc13106
[2020-12-09 12:07:10] INFO validator: Validating for public key publicKey=0x81003ebb24fb
[2020-12-09 12:07:10] INFO validator: Validating for public key publicKey=0x870e7ea5e3a8
```

### Useful Links

[Creating Ethereum 2 withdrawal keys](https://steve-berryman.medium.com/creating-ethereum-2-withdrawal-keys-using-ethdo-6e41b14ddd7b)

Attestant [Ethereum Staking](https://www.attestant.io/posts/) Posts

[Ethereum 2.0 Staking](https://www.attestant.io/posts/exploring-staking-keys/) Keys

[Ethereum 2.0 Withdrawal Keys](https://www.attestant.io/posts/protecting-withdrawal-keys/)

### Contact

If you wish to know more about Attestant, you can contact us by email [info@attestant.io](mailto:info@attestant.io) or Telegram [https://t.me/attestant](https://t.me/attestant)

#### Also, Read

- The [Best Crypto Trading Bots](https://medium.com/coinmonks/whats-the-best-crypto-trading-bot-in-2020-top-8-bitcoin-trading-bot-c16adeb13317)
- [Deribit Review](https://medium.com/coinmonks/deribit-review-options-fees-apis-and-testnet-2ca16c4bbdb2) | Options, Fees, APIs and Testnet
- [FTX Crypto Exchange Review](https://medium.com/coinmonks/ftx-crypto-exchange-review-53664ac1198f)
- [Bybit Exchange Review](https://medium.com/coinmonks/bybit-exchange-review-dbd570019b71)
- The Best Bitcoin [Hardware wallet](https://medium.com/coinmonks/the-best-cryptocurrency-hardware-wallets-of-2020-e28b1c124069?source=friends_link&sk=324dd9ff8556ab578d71e7ad7658ad7c)
- [Crypto Copy Trading Platforms](https://medium.com/coinmonks/top-10-crypto-copy-trading-platforms-for-beginners-d0c37c7d698c)
- The Best [Crypto Tax Software](https://medium.com/coinmonks/best-crypto-tax-tool-for-my-money-72d4b430816b)
- [Best Crypto Trading Platforms](https://medium.com/coinmonks/the-best-crypto-trading-platforms-in-2020-the-definitive-guide-updated-c72f8b874555)
- Best [Crypto Lending Platforms](https://medium.com/coinmonks/top-5-crypto-lending-platforms-in-2020-that-you-need-to-know-a1b675cec3fa)
- [Ledger Nano S vs Trezor one vs Trezor T vs Ledger Nano X](https://blog.coincodecap.com/ledger-nano-s-vs-trezor-one-ledger-nano-x-trezor-t)
- [BlockFi vs Celsius](https://medium.com/coinmonks/blockfi-vs-celsius-vs-hodlnaut-8a1cc8c26630) vs Hodlnaut
- [Bitsgap review](https://medium.com/coinmonks/bitsgap-review-a-crypto-trading-bot-that-makes-easy-money-a5d88a336df2) — A Crypto Trading Bot That Makes Easy Money
- [Quadency Review](https://medium.com/coinmonks/quadency-review-a-crypto-trading-automation-platform-3068eaa374e1)- A Crypto Trading Bot Made For Professionals
- [PrimeXBT Review](https://medium.com/coinmonks/primexbt-review-88e0815be858) | Leverage Trading, Fee and Covesting
- [HaasOnline Review](https://medium.com/coinmonks/haasonline-review-d8d1a3400419) and Get a 10% discount
- [Ellipal Titan Review](https://medium.com/coinmonks/ellipal-titan-review-85e9071dd029)
- [SecuX Stone Review](https://blog.coincodecap.com/secux-stone-hardware-wallet-review)
- [BlockFi Review](https://medium.com/coinmonks/blockfi-review-53096053c097) | Earn up to 8.6% interests on your Crypto
- [Best Crypto APIs](https://medium.com/coinmonks/best-crypto-apis-for-developers-5efe3a597a9f) for Developers
- [Best Blockchain Analysis Tools](https://bitquery.io/blog/best-blockchain-analysis-tools-and-software)
- [Crypto arbitrage](https://medium.com/coinmonks/crypto-arbitrage-guide-how-to-make-money-as-a-beginner-62bfe5c868f6) guide: How to make money as a beginner
- Top [Bitcoin Node](https://blog.coincodecap.com/bitcoin-node-solutions) Providers
- Best [Crypto Charting Tool](https://medium.com/coinmonks/what-are-the-best-charting-platforms-for-cryptocurrency-trading-85aade584d80)
- What are the [best books to learn about Bitcoin](https://medium.com/coinmonks/what-are-the-best-books-to-learn-bitcoin-409aeb9aff4b)?

> [Get Best Software Deals Directly In Your Inbox](https://medium.com/coinmonks/newsletters/coinmonks)

[![](https://cdn-images-1.medium.com/max/584/1*BoDnKUyK8p4hitHAJZ5Pdw.png)](https://medium.com/coinmonks/newsletters/coinmonks)

* * *