Deploying an Ethereum Mainnet RPC Node: A Developer’s Guide to Replacing Infura

·

Setting up your own Ethereum mainnet RPC (Remote Procedure Call) node is a powerful step for developers seeking full control over their blockchain interactions. By running a self-hosted node, you eliminate reliance on third-party services like Infura, avoid rate limits, and gain faster, more reliable access to real-time Ethereum data. This guide walks you through the complete process of deploying a production-ready Ethereum RPC node on a Linux server—ideal for development environments, dApp testing, and decentralized infrastructure projects.

Whether you're building smart contracts, integrating Web3 functionality, or exploring Ethereum's inner workings, having your own node enhances performance and security. Let’s dive into the technical requirements and setup steps.


Server Requirements for Optimal Performance

To successfully sync and maintain an Ethereum mainnet node, hardware specifications are critical. The blockchain's size and I/O demands mean not all servers are suitable.

Storage: Use NVMe SSD Only

Network Bandwidth

Operating System


Environment Setup on CentOS

Before installing Ethereum software, ensure your system is updated and essential tools are installed.

sudo yum update -y
sudo yum install screen iftop iotop -y

These tools help:

👉 Learn how to optimize server performance for blockchain workloads


Install Golang: Required for Building Geth

The official Ethereum client, Geth (Go Ethereum), is written in Go. Install Go via package manager:

sudo yum install golang -y

Or compile from source if you need a specific version.

Configure Go Environment (Critical for v1.13+)

If using Go 1.13 or later, set module and proxy settings to prevent build errors:

go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.io,direct

This ensures dependency resolution works smoothly during compilation.


Create a Persistent Session with Screen

Run the node in a detached session so it continues operating after you log out:

screen -S eth

Important Notes:

This keeps your Geth process alive even during SSH disconnections.


Download and Compile Geth from Source

We’ll install the latest stable release of Geth manually for maximum compatibility.

Set Up Data Directory

mkdir -p /data/eth/data

You can customize this path based on your storage layout.

Download and Extract Source Code

cd /root
wget -O go-ethereum-1.10.12.tar.gz https://github.com/ethereum/go-ethereum/archive/refs/tags/v1.10.12.tar.gz
tar -xvf go-ethereum-1.10.12.tar.gz
cd go-ethereum-1.10.12

Compile Geth

make all

This builds the geth binary in /build/bin/.


Verify Installation

Check that Geth compiled correctly:

/root/go-ethereum-1.10.12/build/bin/geth version

You should see output showing the version number and commit hash.


Configure Firewall Rules

Allow incoming connections on required ports:

firewall-cmd --permanent --zone=public --add-port=30303/tcp  # P2P communication
firewall-cmd --permanent --zone=public --add-port=8545/tcp  # HTTP RPC endpoint
firewall-cmd --reload

Alternatively, disable firewalld temporarily if you’re unfamiliar with firewall management (not recommended in production).

👉 Secure your blockchain infrastructure with best practices


Start the Ethereum Node

Launch Geth with optimized flags for fast syncing and RPC access:

ulimit -n 65535
/root/go-ethereum-1.10.12/build/bin/geth \
  --datadir /data/eth/data \
  --syncmode "fast" \
  --cache=2048 \
  --maxpeers=200 \
  --http \
  --http.addr=0.0.0.0 \
  --http.port=8545 \
  --http.api "web3,eth,debug,personal,net,admin" \
  --http.corsdomain "*" \
  --allow-insecure-unlock

Key Flags Explained:

After starting, press Ctrl+A, then D to safely detach.


Test Your Node

Verify the node is responsive and syncing:

Check Sync Status

curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"eth_syncing","params":[],"id":1}' http://127.0.0.1:8545

Get Latest Block Number

curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' http://127.0.0.1:8545

Returns hex value of the latest block (e.g., "0x1b4" = block 436).


Stop the Node Gracefully

Reattach to the screen session and stop Geth cleanly:

screen -r eth
# Then press Ctrl+C to shut down

A graceful shutdown prevents database corruption.


Frequently Asked Questions (FAQ)

Q: How long does it take to sync the Ethereum mainnet node?
A: With a 1TB NVMe SSD and 100Mbps international bandwidth, expect 12 to 24 hours. Slower disks or poor network conditions may extend this significantly.

Q: Can I use a virtual machine (VM)?
A: Only if the VM has direct access to high-performance NVMe storage. Most cloud VMs with virtualized disks suffer from I/O bottlenecks and may never complete sync.

Q: Why can’t I use a mechanical hard drive?
A: Ethereum requires thousands of random I/O operations per second during state sync. HDDs typically deliver <200 IOPS—far below the needed threshold.

Q: What happens if sync gets stuck near the latest block?
A: This usually indicates disk latency or insufficient memory. Try increasing --cache size or switching to a better VPS provider with raw SSD access.

Q: Is this setup safe for production applications?
A: Yes, but tighten security: restrict --http.addr to internal IPs, disable unsafe APIs (personal, admin), and use reverse proxies with authentication.

Q: Can I access my node remotely?
A: Yes—once port 8545 is open and exposed securely (e.g., via HTTPS proxy or API gateway), you can call RPC methods from any application.


Core Keywords for SEO Optimization

This guide naturally integrates the following keywords:

These terms align with developer search intent and improve visibility across technical queries.


Final Thoughts

Running your own Ethereum RPC node empowers developers with independence, speed, and reliability—critical advantages when building or testing decentralized applications. While the initial sync demands strong hardware, the payoff in control and performance is well worth it.

Once your node is live, you can integrate it directly into wallets, dApps, explorers, or backend systems without worrying about third-party rate limits or downtime.

👉 Explore advanced blockchain tools to enhance your development workflow