id | title | sidebar_label | description | keywords | ||||
---|---|---|---|---|---|---|---|---|
setup-goerlinode |
Setting Up Own Full Goerli Node |
Setup Goërli Node |
The sixth step on launching your own zkEVM network on the Goerli testnet. |
|
This is a step-by-step guide to setting up a full node on the Goërli Testnet to act as the Layer 1 (L1).
Follow the steps below to get started.
Before starting the setup, you will need at least 300 GB of free disk space to allocate a full Goerli node.
Next, make sure you have the following commands installed:
- wget
- jq
- docker
sudo apt update -y
sudo apt install -y wget jq docker.io
sudo usermod -aG docker $USER
newgrp docker && newgrp $USER
Additionally, you will need an L1 Goerli address to proceed with the setup that will act as the suggested fee recipient. Make sure you have this address provisioned.
-
Create a directory for your Goerli node:
mkdir -p ~/goerli-node/docker-volumes/{geth,prysm} cd ~/goerli-node/
-
Create a
docker-compose.yml
file and open it for editing:nano docker-compose.yml
-
Copy and paste the following content into the
docker-compose.yml
file:services: geth: image: ethereum/client-go:stable container_name: goerli-execution command: | --goerli: --http --http.vhosts=* --http.rpcprefix=/ --http.corsdomain=* --http.addr 0.0.0.0 --http.api eth,net,engine,admin volumes: - ./docker-volumes/geth:/root/.ethereum ports: - "0.0.0.0:${L1_RPC_PORT}:8545/$." - "0.0.0.0:30303:30303/udp" prysm: image: gcr.io/prysmaticlabs/prysm/beacon-chain:stable container_name: goerli-consensus command: | --prater --datadir=/data --jwt-secret=/geth/goerli/geth/jwtsecret --rpc-host=0.0.0.0 --grpc-gateway-host=0.0.0.0 --monitoring-host=0.0.0.0 --execution-endpoint=/geth/goerli/geth.ipc --accept-terms-of-use --suggested-fee-recipient=${L1_SUGGESTED_FEE_RECIPIENT_ADDR}/$. --checkpoint-sync-url=${L1_CHECKPOINT_URL**}/$. volumes: - ./docker-volumes/prysm:/data - ./docker-volumes/geth:/geth ports: - "0.0.0.0:3500:3500" - "0.0.0.0:4000:4000" - "0.0.0.0:12000:12000/udp" - "0.0.0.0:13000:13000" depends_on: - geth
-
Save and Close the
docker-compose.yml
file. -
Create an
.env
file and open it for editing:nano .env
-
Set the following environment variables in the
.env
file:L1_RPC_PORT=8845 L1_SUGGESTED_FEE_RECIPIENT_ADDR=0x # Put your Goerli account address L1_CHECKPOINT_URL=https://goerli.checkpoint-sync.ethpandaops.io
-
Save and Close the
.env
file.
-
Start the compose services:
docker-compose up -d
-
Check the logs of the
prysm
service to monitor the synchronization progress:docker-compose logs -f prysm
-
Wait for the initial sync to complete. You will see log messages similar to the following indicating the progress:
#goerli-consensus | time="2023-06-19 09:39:44" level=info msg="Synced up to slot 5888296" prefix=initial-sync
-
Check the logs of the
geth
service to monitor the initial download and sync progress:docker-compose logs -f geth
-
This process may take a couple of hours. Look for log messages similar to the following indicating the progress:
#goerli-execution | INFO [06-19|09:43:24.954] Syncing beacon headers downloaded=25600 left=9,177,918 eta=1h5m31.860s #goerli-execution | INFO [06-19|10:09:19.488] Syncing: state download in progress synced=0.30% state=331.34MiB accounts=81053@20.52MiB slots=1,112,986@239.47MiB codes=11681@71.34MiB >
Once both service logs show the sync completion and new blocks are being updated, you can verify the correctness of the RPC by making a call. For example, to get the current block number, use the following command:
printf "%d\n" $(curl -s -X POST --header "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":83}' http://localhost:8845 | jq -r .result)
If everything is correctly set up, you should see the current block number returned.
Congratulations! You have successfully set up your own full node on the Goerli Testnet. You can now use this node to perform transactions and interact with the Goerli network.