Ethereum Mainnet Node Setup Guide: Step-by-Step Tutorial

·

Recommended Hardware Configuration

For optimal performance, use:

Minimum requirements:

👉 Get high-performance cloud servers for node hosting


Installation Steps

1. Install Go Language

yum install golang

Verify installation:

go version

2. Install Git

yum install https://centos6.iuscommunity.org/ius-release.rpm
yum install epel-release
yum install git2u

Check version:

git version

3. Clone go-ethereum Repository

git clone https://github.com/ethereum/go-ethereum.git
cd go-ethereum/
git checkout release/1.9
make all

4. Configure Geth Path

Add to /etc/profile:

export PATH=$PATH:/opt/ethereum/go-ethereum/build/bin

Reload:

source /etc/profile

5. Launch Geth with Key Parameters

geth --datadir data --cache 4096 --rpc --rpcport 6666 --rpcaddr 0.0.0.0 --ws --wsaddr 0.0.0.0 --wsport 6667 --wsorigins "*"

6. Run Geth in Background

nohup geth [parameters] & > nohup.out

Monitoring Sync Status

Attach to node:

geth attach data/geth.ipc

Check sync progress:

eth.syncing
eth.blockNumber
net.peerCount

Troubleshooting FAQs

Q: How to fix "missing block number for head header hash" error?
A: Run:

geth removedb --datadir data

Q: Why does my node frequently lag behind the mainnet?
A: Ensure port 30303 is open in your firewall for stable peer connections.

Q: What's the safest way to shut down Geth?
A: Use kill -INT [pid] to allow graceful termination.

Q: How long does initial sync typically take?
A: With recommended hardware, expect 36-48 hours for full sync completion.

Q: Can I run a node behind NAT?
A: Yes, but requires port forwarding for optimal connectivity.


Pro Tips

👉 Explore advanced node management tools


This guide covers all essentials from hardware selection to post-sync monitoring. For enterprise node deployments, always prioritize security configurations like IP whitelisting and rate limiting.