Setting Up an Ethereum Private Network (Part 2)

·

Creating a private Ethereum network unlocks powerful opportunities for developers, testers, and blockchain enthusiasts to experiment without risking real assets. In the previous guide, we covered the foundational setup of a custom Ethereum blockchain using Geth. Now, we'll dive into advanced configurations: enabling RPC and IPC interfaces, and deploying ethstats to monitor your network in real time.

These components enhance functionality and observability—critical for debugging, integration, and long-term maintenance. While not mandatory, they're highly recommended for any serious development environment.

Whether you're building decentralized applications (dApps), testing smart contracts, or simulating enterprise blockchain solutions, understanding these tools gives you full control over your private network.

👉 Discover how blockchain developers streamline network testing with powerful tools and secure environments.


Enabling RPC for Remote Interaction

The Remote Procedure Call (RPC) interface allows external programs—like wallets, dApps, or scripts—to interact with your Geth node programmatically. By default, RPC is disabled for security reasons.

To enable it, launch Geth with the --rpc flag:

geth --rpc --rpcport 8545 --rpcaddr "localhost"

Here’s what each parameter does:

You can also specify which API modules are exposed via RPC using --rpcapi. Common modules include:

Example:

geth --rpc --rpcapi "eth,net,web3,personal"

⚠️ Security Note: Exposing personal or admin APIs over RPC poses significant risks, especially if accessible from external IPs. If you must use them, restrict access to localhost only and use SSH tunneling for remote management.

To allow all IP addresses (not recommended for production):

geth --rpc --rpcaddr "0.0.0.0"

For secure remote access, consider SSH port forwarding:

ssh -L 8545:localhost:8545 user@your-server

This way, you safely access the RPC endpoint through your local machine.


Using IPC for Local Application Integration

Inter-Process Communication (IPC) is a secure method for local applications—like Mist or MetaMask (legacy versions)—to communicate with Geth. Unlike RPC, IPC uses a Unix socket file instead of HTTP, making it faster and more secure since it's limited to the local system.

By default, Geth creates an IPC file at:

To customize the IPC path and expose specific APIs:

geth --ipcpath ~/mycustomnet/geth.ipc --ipcapi "eth,net,web3,personal"

Once Geth is running, open Mist or another compatible wallet—it will automatically detect and connect to your private network via the IPC file.

This approach is ideal for development workflows where security and performance matter most.


Running Multiple Geth Instances on One Machine

You can run multiple Geth nodes simultaneously—for example, connecting to mainnet, testnets (like Goerli), and your private network—all on one machine.

However, avoid conflicts by ensuring:

Example:

# Private network
geth --datadir "./mynet" --port 30303 --rpcport 8545 --ipcpath ./mynet/geth.ipc

# Testnet node
geth --goerli --datadir "./goerli" --port 30304 --rpcport 8546 --ipcpath ./goerli/geth.ipc

This flexibility makes local blockchain development efficient and scalable.


Monitoring Your Network with EthStats

Keeping track of node health, peer connections, and block production is essential. Enter EthStats, a real-time monitoring dashboard originally developed by Alethio and now maintained in open-source form.

EthStats consists of two parts:

  1. Eth-Net-Intelligence-API: Agent running on each node to collect data via RPC.
  2. Eth-NetStats: Web server that displays the data in a user-friendly interface.

Step 1: Install and Configure the Monitoring Agent

Ensure you have Node.js and npm installed. Then:

git clone https://github.com/cubedro/eth-net-intelligence-api
cd eth-net-intelligence-api
npm install
sudo npm install -g pm2

Edit the app.json configuration file:

{
  "name": "private-net",
  "script": "app.js",
  "log_date_format": "YYYY-MM-DD HH:mm:ss",
  "env": {
    "RPC_HOST": "localhost",
    "RPC_PORT": "8545",
    "LISTENING_PORT": "30303",
    "INSTANCE_NAME": "Node-1",
    "CONTACT_DETAILS": "[email protected]",
    "WS_SERVER": "http://localhost:3000",
    "WS_SECRET": "lalaland",
    "VERBOSITY": 2
  }
}

Key fields:

Start the agent:

pm2 start app.json

PM2 ensures the agent runs continuously and restarts automatically if it crashes.

👉 See how real-time network monitoring boosts developer productivity and system reliability.


Step 2: Deploy the EthStats Web Dashboard

Now set up the visual dashboard:

cd ..
git clone https://github.com/cubedro/eth-netstats
cd eth-netstats
npm install
sudo npm install -g grunt-cli
grunt

The grunt command compiles static assets (CSS, JS) needed for the UI.

Start the server:

WS_SECRET="lalaland" npm start

By default, it runs on port 3000. Open your browser and navigate to:

http://localhost:3000

You should see your node listed with live stats: block height, peers, hashrate, and more.

If the dashboard loads but shows no data:

  1. Run pm2 list to find your agent’s app name.
  2. Restart it: pm2 restart [app-name]
  3. Wait a few moments for synchronization.

Frequently Asked Questions (FAQ)

Q: Is RPC secure to use in a private network?

A: RPC is functional but inherently insecure when exposed over HTTP. Always restrict --rpcaddr to localhost unless behind a firewall or reverse proxy. Use SSH tunneling for remote access instead of opening ports publicly.

Q: Can I use MetaMask with my private network via IPC?

A: MetaMask no longer supports direct IPC connections. Instead, connect via RPC by adding a custom network in MetaMask with your private chain’s details (chain ID, RPC URL: http://localhost:8545).

Q: What are the core keywords for this guide?

A: The primary SEO keywords are: Ethereum private network, Geth RPC setup, IPC configuration, EthStats monitoring, blockchain node monitoring, private Ethereum network setup, Geth multiple instances, and secure RPC access.

Q: Why isn’t my EthStats dashboard showing data?

A: Ensure both services are running, the WS_SECRET matches exactly in both configurations, and your Geth node is syncing. Restart the PM2 agent after changes using pm2 restart app.

Q: Can I monitor multiple nodes with one EthStats dashboard?

A: Yes! Run the same agent (eth-net-intelligence-api) on each node with unique INSTANCE_NAMEs but the same WS_SERVER and WS_SECRET. All will appear on the same dashboard.

Q: Are there modern alternatives to EthStats?

A: Yes—tools like Grafana + Prometheus with Geth metrics export offer more customization and scalability. However, EthStats remains popular for its simplicity and ease of deployment in dev environments.

👉 Explore next-generation tools for monitoring blockchain networks securely and efficiently.


With RPC, IPC, and EthStats configured, your Ethereum private network becomes not just functional but observable and integrable with development tools. These enhancements empower developers to build, test, and debug with confidence—laying the groundwork for robust decentralized applications.

Whether you're simulating enterprise use cases or learning blockchain fundamentals, mastering these components is a critical step forward.