Skip to content

Latest commit

 

History

History
190 lines (145 loc) · 7.21 KB

eth2-staking-prysm.md

File metadata and controls

190 lines (145 loc) · 7.21 KB
description
A quick guide to setting up your Eth2 node or validator on Prysm with Alchemy as your web3 provider.

Setting up an Eth 2.0 Staking Validator with Prysm

This guide assumes you have already generated your validator keys and have submitted your initial 32 Eth to the beacon chain. If you have not done so, please follow this guide.

To learn more about Prysm, check out their Eth2 Documentation.

{% hint style="info" %} Note: The instructions below were adopted from the Prysm Getting Started Guide. {% endhint %}

Running an Eth2 node

1. Get Prysm

Follow this guide to install Prysm using an installation script, or if you prefer Docker check out these instructions.

2. Connect eth2 node to eth1 node (Alchemy)

During the transition period from eth1 to eth2, beacon nodes will need to monitor the eth1 chain for data. Additionally, eth2 validators are required to "burn" 32 of their ETH into an eth1 smart contract in order to become validators, which requires connection to an eth1 node.

This is where you can connect your eth2 node to Alchemy mainnet or Goerli testnet.

All you have to do is specify the --http-web3provider flag to your Alchemy HTTP endpoint when running your Prysm node:

Using the Prysm installation script:

{% tabs %} {% tab title="Mainnet" %}

./prysm.sh beacon-chain --http-web3provider=https://eth-mainnet.alchemyapi.io/v2/YOUR-API-KEY

{% endtab %}

{% tab title="Testnet" %}

./prysm.sh beacon-chain --http-web3provider=https://eth-goerli.alchemyapi.io/v2/YOUR-API-KEY --pyrmont

{% endtab %} {% endtabs %}

Using Docker:

{% tabs %} {% tab title="Mainnet" %}

docker run -it -v $HOME/.eth2:/data -p 4000:4000 -p 13000:13000 -p 12000:12000/udp --name beacon-node \
 gcr.io/prysmaticlabs/prysm/beacon-chain:stable \
 --datadir=/data \
 --rpc-host=0.0.0.0 \
 --monitoring-host=0.0.0.0 \
 --http-web3provider=https://eth-mainnet.alchemyapi.io/v2/YOUR-API-KEY

{% endtab %}

{% tab title="Testnet" %}

docker run -it -v $HOME/.eth2:/data -p 4000:4000 -p 13000:13000 -p 12000:12000/udp --name beacon-node \
 gcr.io/prysmaticlabs/prysm/beacon-chain:stable \
 --datadir=/data \
 --rpc-host=0.0.0.0 \
 --monitoring-host=0.0.0.0 \
 --http-web3provider=https://eth-mainnet.alchemyapi.io/v2/YOUR-API-KEY
 --pyrmont

{% endtab %} {% endtabs %}

Congrats! Now you've officially started running an eth2 Beacon node! 🎉

Running an eth 2.0 validator

Complete steps 1 and 2 from above.

For Testnet Validators

If you want to be a validator in the Pyrmont eth2 testnet prior to jumping into mainnet, you'll still need to stake 32 testnet ETH. You can request testnet ETH by joining the Prysm discord server or requesting from a faucet.

The Eth2 Launchpad has a step by step process for establishing your validator:

Copy the path to the validator_keys folder under the eth2.0-deposit-cli directory you created during the onboarding process. For example, if your eth2.0-deposit-cli installation is in your $HOME (or %LOCALAPPDATA% on Windows) directory, you can then run the following commands for your operating system.

Using the Prysm installation script:

{% tabs %} {% tab title="Mainnet" %}

./prysm.sh validator accounts import --keys-dir=$HOME/eth2.0-deposit-cli/validator_keys

{% endtab %}

{% tab title="Testnet" %}

./prysm.sh validator accounts import --keys-dir=$HOME/eth2.0-deposit-cli/validator_keys --pyrmont

{% endtab %} {% endtabs %}

Using Docker

{% tabs %} {% tab title="Mainnet" %}

docker run -it -v $HOME/eth2.0-deposit-cli/validator_keys:/keys \
 -v $HOME/Eth2Validators/prysm-wallet-v2:/wallet \
 --name validator \
 gcr.io/prysmaticlabs/prysm/validator:stable \
 accounts import --keys-dir=/keys --wallet-dir=/wallet

{% endtab %}

{% tab title="Testnet" %}

docker run -it -v $HOME/eth2.0-deposit-cli/validator_keys:/keys \
  -v $HOME/Eth2Validators/prysm-wallet-v2:/wallet \
  --name validator \
  gcr.io/prysmaticlabs/prysm/validator:stable \
  accounts import --keys-dir=/keys --wallet-dir=/wallet --pyrmont

{% endtab %} {% endtabs %}

3. Run your validator

In a separate terminal window (from your beacon node), start running the validator using the command below:

Using the Prysm installation script

{% tabs %} {% tab title="Mainnet" %}

./prysm.sh validator

{% endtab %}

{% tab title="Testnet" %}

./prysm.sh validator --pyrmont

{% endtab %} {% endtabs %}

Using Docker

{% tabs %} {% tab title="Mainnet" %}

docker run -it -v $HOME/Eth2Validators/prysm-wallet-v2:/wallet \
 -v $HOME/Eth2:/validatorDB \
 --network="host" --name validator \
 gcr.io/prysmaticlabs/prysm/validator:stable \
 --beacon-rpc-provider=127.0.0.1:4000 \
 --wallet-dir=/wallet \
 --datadir=/validatorDB

{% endtab %}

{% tab title="Testnet" %}

docker run -it -v $HOME/Eth2Validators/prysm-wallet-v2:/wallet \
  -v $HOME/Eth2:/validatorDB \
  --network="host" --name validator \
  gcr.io/prysmaticlabs/prysm/validator:stable \
  --beacon-rpc-provider=127.0.0.1:4000 \
  --wallet-dir=/wallet \
  --datadir=/validatorDB \
  --pyrmont

{% endtab %} {% endtabs %}

4. Be ready for your validator assignment

Keep both terminal windows running so that your validator can receive tasks and execute validator responsibilities. You should already be aware of all the responsibilities and staking logistics for being a validator.

You can check the status of your validator using block explorers: beaconcha.in and beacon.etherscan.io.

You are now officially an Ethereum 2.0 validator, congrats! 🎉