# How to run a node on Goerli/Prater ## Who is this guide for? This guide is meant as a starting point for users with some experience running nodes and validators. It is not meant to be a beginners guide, chances are copying and running commands from here will not work, some tweaking might be needed. We see this as a guide for people making better guides :) The mentioned better guides, especially for beginners can be found here: - [Somer Esat, fresh Goerli setup Lighthouse/Geth](https://someresat.medium.com/guide-to-staking-on-ethereum-ubuntu-g%C3%B6erli-lighthouse-8d0a2a811e6e) - [Somer Esat, fresh Goerli setup Teku/Geth](https://someresat.medium.com/guide-to-staking-on-ethereum-ubuntu-g%C3%B6erli-teku-6512b26f1372) - [Remy, Prepare an existing setup for the merge](https://github.com/remyroy/ethstaker/blob/main/prepare-for-the-merge.md) - [Remy, fresh Goerli setup Lighthouse/Geth](https://github.com/remyroy/ethstaker/blob/main/merge-goerli-prater.md) - [Remy, fresh Goerli setup Teku/Besu](https://github.com/remyroy/ethstaker/blob/main/merge-goerli-prater-alt.md) - [Coincashew, change existing setup for merge](https://www.coincashew.com/coins/overview-eth/ethereum-merge-upgrade-checklist-for-home-stakers-and-validators) - [Metanull, change existing setup for merge](https://github.com/metanull-operator/eth2-ubuntu/blob/master/merge_updates.md) - [Chrishobcroft](https://github.com/chrishobcroft/TestingTheMerge/blob/main/goerli-prater-merge.md) - [Philknows](https://hackmd.io/@philknows/rJegZyH9q) ## What is being merged? The EL chain Goerli and CL beaconchain Prater are going to be merged. The merged chain will be called Goerli, the name Prater is soft-deprecated (flags using the name will work, but not supported long term). ## What's new in Goerli? The client behaviour in Goerli is identical to [Ropsten](https://blog.ethereum.org/2022/05/30/ropsten-merge-announcement/). If your staking setup works on Ropsten, it will work on Goerli as well. ## How do I know my node is properly configured? We have a basic checklist that can be found [here](https://notes.ethereum.org/@launchpad/merge-configuration-checklist). The checklist provides a list of things to check once your nodes are seutp as well as a common list of pitfalls to avoid. ## This is too complicated, Do you have an overview? Yes we do, [this FAQ](https://notes.ethereum.org/@launchpad/node-faq-merge) might provide you with some context and what next steps you'd need to take. ## Which version/branch do I use? Consensus layer | client name | git branch | docker image | | ----------- | ---------- | ------------ | | Lighthouse |unstable| sigp/lighthouse:v2.4.0 | | Teku | master | consensys/teku:22.7.0 | | Lodestar | master | chainsafe/lodestar:v0.41.0 | | Nimbus | unstable | statusim/nimbus-eth2:multiarch-v22.7.0 | | Prysm | develop | gcr.io/prysmaticlabs/prysm/beacon-chain:v2.1.4-rc.0 | Execution layer | client name | git branch | docker image | | ----------- | ---------- | ------------ | | Geth | master | ethereum/client-go:v1.10.21 | | Nethermind | master | nethermind/nethermind:1.13.5 | | Erigon | alpha | thorax/erigon:v2022.07.04 | | Besu | main | hyperledger/besu:22.7.0-RC3 | ## Preparation - Generate the JWT secret with `openssl rand -hex 32 | tr -d "\n" > "/opt/jwtsecret"`. This file needs to be passed to both the Execution Client and the Consensus Client. - Your CL will need to be configured with an Ethereum address to receive transaction fees. These fees are available to be spent instantly, so please configure an address you have access to. More information can be found [here](https://launchpad.ethereum.org/en/merge-readiness/#fee-recipient). ## Run an Execution Layer Client ### Geth We need to download and install geth Pre-requisites: `git`, `make`, `go`, `gcc`. (use geth branch `master` from github.com/ethereum/go-ethereum) ``` git clone -b master https://github.com/ethereum/go-ethereum.git cd go-ethereum make geth cd .. ``` ``` ./go-ethereum/build/bin/geth --goerli \ --datadir "geth-datadir" \ --http \ --http.api="eth,web3,net" \ --http.vhosts="*" --http.corsdomain "*" \ --authrpc.jwtsecret=/opt/jwtsecret \ --authrpc.vhosts="*" \ console ``` If you do not specify a JWT secret, then geth will automatically generate one for you. You will then have to specify this secret in the Consensus Layer client. Note: In case the CL does not specify a virtual host when making the request, it will be rejected by geth unless `--authrpc.vhosts="*"` has been set. Allowing wildcard virtual host matching on the _authenticated_ port is not a security concern. ### Nethermind Clone and build the `master` branch of Nethermind ``` git clone --recursive https://github.com/NethermindEth/nethermind.git cd nethermind/src/Nethermind dotnet build Nethermind.sln -c Release ``` In the `nethermind/src/Nethermind/` folder ``` cd Nethermind.Runner dotnet run -c Release -- --config goerli \ --JsonRpc.Host=0.0.0.0 \ --JsonRpc.JwtSecretFile=/opt/jwtsecret ``` ### Erigon ``` git clone -b alpha https://github.com/ledgerwatch/erigon cd erigon make erigon rpcdaemon ./build/bin/erigon --chain=goerli \ --datadir goerli-testnet \ --authrpc.jwtsecret=/opt/jwtsecret \ --http --http.api=engine,net,eth ``` ### Besu Support for ropsten is baked into the besu `main` branch. If you want to use pre-built binaries, you can get the current [22.4.4 besu snapshot artifact](https://hyperledger.jfrog.io/ui/native/besu-binaries/besu/22.4.4-SNAPSHOT/), or use the docker image `hyperledger/besu:22.4.4`. Otherwise if you want to build from source, clone the repo and build besu: ``` git clone --recursive https://github.com/hyperledger/besu.git cd besu ./gradlew installDist # installs in build/install/besu # Alternatively, using Docker: # ./gradlew distDocker # build and tags a docker image ``` To run besu as an execution client on goerli: ``` build/install/besu/bin/besu \ --network=goerli \ --rpc-http-enabled=true \ --rpc-http-host="0.0.0.0" \ --rpc-http-cors-origins="*" \ --sync-mode="X_SNAP" \ --data-storage-format="BONSAI"\ --Xmerge-support=true \ --rpc-ws-host="0.0.0.0" \ --host-allowlist="*" \ --engine-rpc-enabled=true \ --engine-host-allowlist="*" \ --engine-jwt-enabled=true \ --engine-jwt-secret=/opt/jwtsecret ``` ## Run a Consensus Layer Client ### How to sync a CL beacon node? There are two ways to sync a CL beacon node. They are: - Genesis sync - Similar to how the EL sync today - Checkpoint sync - Extremely fast sync method that has a lot of advantages for the CL As counter-intuitive as it may be, Genesis syncing the beacon chain is not the most secure approach. You can find more information on the topic [here](https://ethereum.org/en/developers/docs/consensus-mechanisms/pos/weak-subjectivity/). To perform a Genesis Sync, No additional flag/work is required. This is the default behaviour on all clients. To perform Checkpoint Sync, Please follow our guide and add the Checkpoint Sync flags **in addition** to the flags defined below. The guide can be found [here](https://notes.ethereum.org/@launchpad/checkpoint-sync). ### Lighthouse Minimum requirement: `rustc 1.59.0` Clone and build from source (use branch `unstable`) ``` git clone -b unstable https://github.com/sigp/lighthouse.git cd lighthouse make cd .. ``` Start the client ``` lighthouse \ --spec mainnet \ --network goerli \ --debug-level info \ beacon_node \ --datadir ./testnet-lh1 \ --eth1 \ --http \ --http-allow-sync-stalled \ --metrics \ --merge \ --execution-endpoints http://127.0.0.1:8551 \ --enr-udp-port=9000 \ --enr-tcp-port=9000 \ --discovery-port=9000 \ --jwt-secrets="/opt/jwtsecret" \ --suggested-fee-recipient=<enter-eth-address-here> \ ``` ### Lodestar Clone and build the client ``` git clone https://github.com/chainsafe/lodestar.git cd lodestar yarn install --ignore-optional yarn run build cd .. ``` Start the client ``` cd lodestar ./lodestar beacon --rootDir="../lodestar-beacondata" \ --network=goerli \ --eth1.enabled=true \ --execution.urls="http://127.0.0.1:8551" \ --network.connectToDiscv5Bootnodes \ --network.discv5.enabled=true \ --chain.defaultFeeRecipient=<Enter-eth-address-here> \ --jwt-secret="/opt/jwtsecret" ``` ### Teku Ensure Java 11 or above is installed (Ubuntu: `sudo apt install default-jre`). ``` git clone https://github.com/ConsenSys/teku.git cd teku ./gradlew installDist cd .. ``` The teku executable is now available in `./teku/build/install/teku/bin/teku`. You can also use the [pre-built distribution](https://artifacts.consensys.net/public/teku/raw/names/teku.tar.gz/versions/develop/teku-develop.tar.gz) or the `consensys/teku:develop` docker image. Start the client ``` ./teku/build/install/teku/bin/teku \ --data-path "datadir-teku" \ --network goerli \ --ee-endpoint http://localhost:8551 \ --ee-jwt-secret-file "/opt/jwtsecret" \ --log-destination console \ --validators-proposer-default-fee-recipient=<Enter-eth-address-here> \ ``` ### Prysm Please ensure you have the latest version of the configs! (Specified in the preparation step) ``` git clone -b develop https://github.com/prysmaticlabs/prysm.git cd prysm bazel build //beacon-chain:beacon-chain cd .. ``` Start the client ``` cd prysm bazel run //beacon-chain -- \ --goerli \ --datadir $db_path \ --suggested-fee-recipient=<Enter-eth-address-here> \ --http-web3provider=http://localhost:8551 \ --jwt-secret=/opt/jwtsecret ``` ### Nimbus Pre-requisites: `git`, `make`, `gcc`. Clone and build from source (use branch `unstable`) ``` git clone --branch=unstable https://github.com/status-im/nimbus-eth2.git cd nimbus-eth2 make update OVERRIDE=1 make nimbus_beacon_node cd .. ``` Start the client ``` nimbus-eth2/build/nimbus_beacon_node \ --network=goerli \ --web3-url=http://127.0.0.1:8551 \ --rest \ --metrics \ --jwt-secret="/opt/jwtsecret" \ --suggested-fee-recipient=<Enter-eth-address-here> ```