Skip to main content

Setup

Prerequisites

Install Docker Engine and the Docker Compose plugin:

Choose your node type

Choose the network

Configuration

1. Set up the directories

mkdir -p ~/ronin/docker 
cd ~/ronin

Create a directory for chain data:

mkdir -p chaindata/data/ronin

2. In the docker directory, create a docker-compose.yml file with the following configuration:

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}
- STATE_SCHEME=path
- ETHSTATS_ENDPOINT=${INSTANCE_NAME}:${CHAIN_STATS_WS_SECRET}@${CHAIN_STATS_WS_SERVER}:443

This compose file defines the node service that pulls a Ronin node image from the GitHub Container Registry.

3. In the docker directory, create an .env file and add the following content, replacing the <...> placeholder values with your 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/developers/nodes/upgrade-node-version
NODE_IMAGE=<NODE_IMAGE>

# The password used to encrypt the node's private key file
PASSWORD=<PASSWORD>

MINE=false

GASPRICE=20000000000
NETWORK_ID=2020
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 --cache 4096 --state.scheme path --discovery.dns enrtree://AIGOFYDZH6BGVVALVJLRPHSOYJ434MPFVVQFXJDXHW5ZYORPTGKUI@nodes.roninchain.com

The latest NODE_IMAGE can be found here.

(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 -

4. Start the node:

cd ~/ronin/docker && docker-compose up -d

This command pulls a Ronin node image and starts the service you defined.

6. Review the log.

docker logs node -f --tail 100

7. After a few minutes, check the status of your node on the Ronin Analytics page. If it's green, the node is connected and up to date with the network.

info

We no longer support Hash-Based State Storage (HBSS) with our snapshots. The documentation has been updated accordingly and already uses Path-Based State Storage (PBSS). If your setup still uses HBSS, follow the steps below to migrate to PBSS.

Migrating from Hash-Based to Path-Based State Storage

To enable the Path-Based State Storage mode, make these changes:

  1. Remove existing chaindata
rm -rf ~/ronin/chaindata/data/ronin/*`

Important: You must remove all existing chaindata before using PBSS mode as it's not compatible with the traditional storage format.

  1. Update the .env File Add --state.scheme path to your RONIN_PARAMS:
RONIN_PARAMS= [...] --state.scheme path
  1. Update the docker-compose.yml File

Add the STATE_SCHEME environment variable:

environment:
# Other environment variables...
- STATE_SCHEME=path
  1. Start/Restart the node for applying the change:
cd ~/ronin/docker && docker-compose up -d