Run a non-validator node
Overview
This guide demonstrates how to run a non-validator node on the mainnet using Docker. A non-validator node is also known as an RPC (remote procedure call) node.
Before you start
Docker
- Install Docker Engine
- Install Docker Compose plugin
- Install Zstandard
System requirements
Recommended system requirements for running a non-validator node on the mainnet:
- 6-core CPU
- 25 GB RAM
- 700 GB high-speed SSD
- x86-64 architecture
These hardware requirements are rough guidelines, and each node operator should monitor their node to ensure good performance for the intended task. The size of your node will also grow over time.
Run the node
-
Set up directories:
Create a node directory:
mkdir ~/ronin
Go to the newly created directory:
cd ~/ronin
Create a chain data directory:
mkdir -p chaindata/data/ronin
-
Create a file called
docker-compose.yml
:vim docker-compose.yml
-
Paste the following into
docker-compose.yml
:version: "3"
services:
node:
image: ${NODE_IMAGE}
stop_grace_period: 5m
stop_signal: SIGINT
hostname: node
container_name: node
ports:
- 127.0.0.1:8545:8545
- 127.0.0.1:8546:8546
- 30303:30303
- 30303:30303/udp
- 6060:6060
volumes:
- ~/ronin/chaindata:/ronin
environment:
- SYNC_MODE=full
- PASSWORD=${PASSWORD}
- NETWORK_ID=${NETWORK_ID}
- RONIN_PARAMS=${RONIN_PARAMS}
- VERBOSITY=${VERBOSITY}
- MINE=${MINE}
- GASPRICE=${GASPRICE}
- ETHSTATS_ENDPOINT=${INSTANCE_NAME}:${CHAIN_STATS_WS_SECRET}@${CHAIN_STATS_WS_SERVER}:443This compose file defines the
node
service, which pulls a Ronin node image from the GitHub Container Registry. -
Create an
.env
file to store configuration parameters for the service:vim .env
-
Paste the following into
.env
and replace placeholder values (likeINSTANCE_NAME
) with your node's information:# The name of your node that you want displayed on https://ronin-stats.roninchain.com/
INSTANCE_NAME=INSTANCE_NAME
# The latest version of the node's image as listed in https://docs.roninchain.com/validators/setup/upgrade-validator
NODE_IMAGE=NODE_IMAGE
# The password used to encrypt the node's private key file
PASSWORD=PASSWORD
MINE=false
NETWORK_ID=2020
GASPRICE=20000000000
VERBOSITY=3
CHAIN_STATS_WS_SECRET=WSyDMrhRBe111
CHAIN_STATS_WS_SERVER=ronin-stats-ws.roninchain.com
RONIN_PARAMS=--http.api eth,net,web3,consortium --txpool.pricelimit 20000000000 --txpool.nolocals --discovery.dns enrtree://AIGOFYDZH6BGVVALVJLRPHSOYJ434MPFVVQFXJDXHW5ZYORPTGKUI@nodes.roninchain.com -
(Optional) Download the snapshot from the ronin-snapshot repo:
cd ~/ronin/chaindata/data/ronin/
wget -q -O - <snapshot URL from the README file in the repo> | tar -I zstd -xvf - -
Start the node:
cd ~/ronin && docker-compose up -d
This command pulls a Ronin node image and starts the service you defined.
-
Review the log:
docker logs node -f --tail 100
-
After a few minutes, check the status of your node on the Ronin Network Status page. If it's green, the node is connected and up to date with the network.