Setup Eth 2.0 Phase0 testnet for Prysm

There is a lot of work going on to scale up Etherem network which are part of Eth 2.0 initiatives. Specs are frozen for Eth2.0 Phase 0. One of the major feature for this release is Proof-of-Stake (POS). Validators can stake minimum of 32 ETH and participate to secure the network and earn compound interest.

It's worth noting that the Phase 0 will introduce proof-of-stake but mining and block formation will continue to happen on Eth1.0 chain. Some of the clients of Eth2.0 have already released their implementation on testnet or very close to release. Intrested users may try staking testETH at the testnet to understand the process.

Slide001-4

User need to deposit 32 ETH ( on mainnet) in a contract deployed on Eth 1.0 chain. Beacon chain listens to event logs of contract deployed on Eth1.0. Once the deposit is processed, user will be registered as a validator.

Prysm

Prysmatic Labs is developing Prysm, a full featured client for Ethereum 2.0. Prysm is implemented in Golang and has two major components: Beacon chain and Validators.

Read: Serenity - The Vision of Ethereum 2.0 for High level understanding of Eth2.0.

How to setup Eth2.0 Phase0 testnet for Prysm

Enough of theory, let's see how to do it in detail. There are a couple of ways to get it up and running. You can use Bazel to build and run or you can use Docker image. In this article I will go Bazel way...

Step 1: Install Bazel. To check the successful installation, fire following command.

bazel version

You will see output similar to the image below depending on version.

Screen-Shot-2019-07-16-at-9.35.25-PM

Step 2: Clone the repo

git clone https://github.com/prysmaticlabs/prysm.git

Step 3: Go to the cloned repo and build Beacon chain validator as follows:

bazel build //beacon-chain:beacon-chain

Screen-Shot-2019-07-16-at-9.37.23-PM

bazel build //validator:validator

Screen-Shot-2019-07-16-at-9.38.32-PM

Step 4: Start the Beacon chain

bazel run //beacon-chain -- --clear-db --datadir=/tmp/prysm-data

You can give the path you want as data directory "--datadir=any valid path you want".

It will take some time to sync the node after you start.

Screen-Shot-2019-07-16-at-9.40.18-PM

Step 5: Start validator

bazel run //validator

When you start it for first time, it will ask you to create a password. Enter the password and hit "ENTER".

Screen-Shot-2019-07-16-at-9.44.20-PM

It will take you to next step and ask you to choose keystore path , hit ENTER" to select default.

Screen-Shot-2019-07-16-at-9.44.39-PM

After you hit enter, it will give you data as shown below, copy that data, you are going to need to send this data to contract in next step.

Screen-Shot-2019-07-17-at-6.36.41-AM

Step 6: Next step is to deposit 3.2 Ether to contract on Eth1.0 chain.

Note: In actual implementation, you would need at least 32 Ether to stake.

For testing Prsymatic client, contract is deployed on Görli Testnet which will need just 3.2 Görli test ether to become a validator.

You are going to need Görli test Ether. You can try available faucet or you can go to this link from Prsymatic lab to get test Ether.

Select the wallet of your choice, I am using Metamask.

Screen-Shot-2019-07-16-at-10.52.40-PM

Clicking on Metamask will fire up Metamask windows as shown below.

Screen-Shot-2019-07-16-at-10.49.27-PM

Then connect to the account you want.

Screen-Shot-2019-07-16-at-10.51.13-PM

After you click connect , click on "need GoETH?" as shown below. It will fund your account with 3.5 test Ether.

Screen-Shot-2019-07-16-at-10.54.46-PM

Screen-Shot-2019-07-16-at-10.55.52-PM

Step 7: Next step is to deposit 3.2 test ether to contract. You can find the latest contract address form this link. It's in the bottom of the page.

"0x02A0bc47284d709C31Dbf7782266CDAd6a1A470B"

Screen-Shot-2019-07-16-at-10.57.24-PM

I am going to use etherscan.io to deposit Ether to above contract. Search for above contract address, it will get you to the screen below.

Etherscan-1

ether-scan-2-1
ethescan-connect
ether-scan-3
ether-scan-deposit

Screen-Shot-2019-07-16-at-10.58.52-PM
Once your deposit is proccessed, you will start seeing message like below in validator log.

activated

Screen-Shot-2019-07-16-at-3.44.48-PM

The Sapphire Testnet is a public testnet for Ethereum 2.0’s proof of stake beacon chain by Prysmatic Lab. The testnet is a single client, Prysm network. Prysm's Beacon chain implementation is up to date with the latest v0.8 spec. There is also a great set of visuals explaining the Phase-0 and different parts of Eth2 by the team.

To know more about the progress and upcoming developments, participate in An Overview of the Ethereum 2.0 | Prysmatic Labs Client meetup on July 31, 2019.

*Read more:

Resources: Prysmatic Lab GitHub

____________________________________________________________________________________________________

Follow us at Twitter, Facebook, Reddit and LinkedIn.

____________________________________________________________________________________________________

Subscribe to EtherWorld.co