Skip to content

Instantly share code, notes, and snippets.

@chrishobcroft
Last active December 18, 2022 13:41
Show Gist options
  • Save chrishobcroft/1f015c8c27d8a6631df3eabc20f4a979 to your computer and use it in GitHub Desktop.
Save chrishobcroft/1f015c8c27d8a6631df3eabc20f4a979 to your computer and use it in GitHub Desktop.

Geth + Teku

Precise commands to set up Geth + Teku on a clean Ubuntu Linux install:

ARM

For running on arm chips, simply replace amd64 with arm64 in all commands :)

Install pre-requisites

sudo apt install -y git gcc make default-jre

wget https://go.dev/dl/go1.17.3.linux-amd64.tar.gz
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.17.3.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin
go version

Clone the devnet config

cd ~
git clone https://github.com/eth2-clients/merge-testnets.git
cd ~/merge-testnets/merge-devnet-3

Build geth

git clone -b fix-optimistic-sync https://github.com/MariusVanDerWijden/go-ethereum.git
cd go-ethereum 
make geth
cd ..

Build teku

git clone https://github.com/ConsenSys/teku.git
cd teku
./gradlew installDist
cd ..

Run the clients

Window 1 - geth

cd ~/merge-testnets/merge-devnet-3
./go-ethereum/build/bin/geth init genesis.json  --datadir "datadir-teku"
./go-ethereum/build/bin/geth --datadir "datadir-teku" --http --http.api="engine,eth,web3,net,debug" --http.corsdomain "*" --networkid=1337502 --syncmode=full  --catalyst console

Window 2 - teku

cd ~/merge-testnets/merge-devnet-3
./teku/build/install/teku/bin/teku \
  --data-path "datadir-teku" \
  --network https://github.com/eth2-clients/merge-testnets/raw/main/merge-devnet-3/config.yaml \
  --initial-state https://github.com/eth2-clients/merge-testnets/raw/main/merge-devnet-3/genesis.ssz \
  --Xee-endpoint http://localhost:8545 \
  --p2p-discovery-bootnodes "enr:-Iq4QKuNB_wHmWon7hv5HntHiSsyE1a6cUTK1aT7xDSU_hNTLW3R4mowUboCsqYoh1kN9v3ZoSu_WuvW9Aw0tQ0Dxv6GAXxQ7Nv5gmlkgnY0gmlwhLKAlv6Jc2VjcDI1NmsxoQK6S-Cii_KmfFdUJL2TANL3ksaKUnNXvTCv1tLwXs0QgIN1ZHCCIyk" \
  --log-destination console
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment