Install execution client (ETH1 node)

Create a jwtsecret file

A jwtsecret file contains a hexadecimal string that is passed to both Execution Layer client and Consensus Layer clients, and is used to ensure authenticated communications between both clients.

#store the jwtsecret file at /secrets
sudo mkdir -p /secrets

#create the jwtsecret file
openssl rand -hex 32 | tr -d "\n" | sudo tee /secrets/jwtsecret

#enable read access
sudo chmod 644 /secrets/jwtsecret

Currently Geth is used by >66% of the network.

Client diversity is extremely important for the network health of Ethereum: A bug in a client with a share of over 33% can cause Ethereum to go offline. If the client has a supermajority (>66%), a bug could cause the chain to incorrectly split, potentially leading to slashing.

Geth Aws Requirements:

  • t3.xlarge

  • 500 gb for testnet and 1 Tb for mainnet

  • ports: 12000, 30303

Choose the Latest Release of Geth from here.

Install Geth from Repository

sudo add-apt-repository -y ppa:ethereum/ethereum
sudo apt-get update -y
sudo apt-get install ethereum -y

Create data directory and give permission and mount EBS volume

sudo file -s /dev/xvdf
sudo mkfs -t ext4 /dev/xvdf
sudo mkdir /eth_storage
sudo mount /dev/xvdf /eth_storage/
sudo chown 1000.1000 /eth_storage -R
sudo mkdir /eth_storage/geth_storage
sudo chown 1000.1000 /eth_storage/geth_storage -R

Setup and configure systemd

Run the following to create a unit file to define your eth1.service configuration.

Simply copy/paste the following.

cat > $HOME/eth1.service << EOF
[Unit]
Description     = geth execution client service
Wants           = network-online.target
After           = network-online.target

[Service]
User            = $(whoami)
ExecStart       = /usr/bin/geth --mainnet --http.addr 0.0.0.0 --ws --ws.addr 0.0.0.0 --ws.port 8546 --ws.api eth,net,web3 --ws.origins="*" --http  --metrics --pprof --datadir /eth_storage/geth_storage --authrpc.addr 0.0.0.0 --authrpc.port 8551 --authrpc.vhosts * --authrpc.jwtsecret=/secrets/jwtsecret
Restart         = on-failure
RestartSec      = 3
TimeoutSec      = 300

[Install]
WantedBy    = multi-user.target
EOF

​Move the unit file to /etc/systemd/system and give it permissions.

sudo mv $HOME/eth1.service /etc/systemd/system/eth1.service
sudo chmod 644 /etc/systemd/system/eth1.service

Run the following to enable auto-start at boot time.

sudo systemctl daemon-reload
sudo systemctl enable eth1

Start the Node

sudo systemctl start eth1

Check Sync Status

Attach to the geth console with:

geth attach http://localhost:8545
eth.syncing

If it returns false, your geth node is synced.

To view Logs

journalctl -fu eth1

To Stop and Restart

sudo systemctl stop eth1
sudo systemctl restart eth1

Last updated