Quickly deploy an Ethereum node for RPC provision, using docker for easy setup and management, Nethermind and Nimbus clients.
Ethereum node is an instance that contains a full copy of the blockchains transaction history and state, this is connected to other nodes on the network for security and decentralisation.
This guide is without a validator client (for staking), and exposing the node externally to be used as an endpoint for connecting to the Ethereum blockchain.
Nimbus: is a super light-weight client to save on space and resources.
Node may take a few days to sync depending on Hardware, its recommended to have 2TB of storage (SSD or NVMe).
Install Docker
Update system, then install docker and docker compose plugin
sudo apt update && sudo apt upgrade -y
sudo apt install curl -y
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
sudo rm -r get-docker.sh
sudo usermod -aG docker $USER
check installed with
docker --version
docker compose version
Make working directory
mkdir -p /home/$USER/eth-node/el-client
mkdir /home/$USER/eth-node/cl-client
JWT authentication token, to allow EL-client to communicate with CL-client
mkdir /home/$USER/eth-node/jwtsecret
openssl rand -hex 32 | tr -d "\n" > "/home/$USER/eth-node/jwtsecret/jwtsecret.hex"
cd eth-node
nano docker-compose.yml
Paste the following docker-compose configuration
version: "3.9"
services:
execution:
stop_grace_period: 30s
container_name: execution-client
restart: always
image: nethermind/nethermind:latest
networks:
- eth-node-net
volumes:
- ./el-client:/el-client/data
- ./jwtsecret:/jwtsecret
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
ports:
- 30303:30303/tcp
- 30303:30303/udp
expose:
- 8545
- 8551
command:
- --datadir=/el-client/data
- --log=INFO
- --Sync.SnapSync=false
- --JsonRpc.Enabled=true
- --JsonRpc.Host=0.0.0.0
- --JsonRpc.Port=8545
- --JsonRpc.EnabledModules=[Web3,Eth,Subscribe,Net,]
- --JsonRpc.JwtSecretFile=/jwtsecret/jwtsecret.hex
- --JsonRpc.EngineHost=0.0.0.0
- --JsonRpc.EnginePort=8551
- --Network.DiscoveryPort=30303
- --HealthChecks.Enabled=false
- --Pruning.CacheMb=2048
logging:
driver: json-file
options:
max-size: 10m
max-file: "10"
consensus:
stop_grace_period: 30s
container_name: consensus-client
restart: always
image: statusim/nimbus-eth2:amd64-latest
user: $USER:$USER
networks:
- eth-node-net
volumes:
- ./cl-client:/data/beacon_node/mainnet_0
- ./jwtsecret:/jwtsecret
ports:
- 9000:9000/tcp
- 9000:9000/udp
- 127.0.0.1:5052:5052/tcp
- 127.0.0.1:8008:8008/tcp
expose:
- 9000
command:
- --data-dir=/data/beacon_node/mainnet_0
- --web3-url=http://execution:8551
- --jwt-secret=/jwtsecret/jwtsecret.hex
- --nat=extip:<YOUR_EXTERNAL_IP>
- --log-level=info
- --tcp-port=9000
- --udp-port=9000
- --rest
- --rest-address=0.0.0.0
- --rest-port=5052
- --metrics
- --metrics-address=0.0.0.0
- --metrics-port=8008
logging:
driver: json-file
options:
max-size: 10m
max-file: "10"
networks:
eth-node-net:
name: eth-node-network
more info on Nimbus here:
Replace <YOUR_EXTERNAL_IP>
with public IP address
open in firewall settings
sudo ufw allow 8545 # rpc port
sudo ufw allow 9000 # cl-p2p
sudo ufw allow 30303 # el-p2p
Port forward these ports also from your router settings.
This should allow connection the node as an RPC endpoint, with http:<public-ip-address-of-node>:8545
If connecting to this node from the same device, http:localhost:8545
sudo docker compose up -d
check logs
sudo docker compose logs -f execution
sudo docker compose logs -f consensus
Execution- nethermind
Consensus
Check running containers
sudo docker ps -a
Stop/Restart node
sudo docker stop <container-name> && sudo docker rm <container-name>
sudo docker start <container-name>
with docker compose, from working directory
sudo docker compose down
sudo docker compose up -d