sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
# Test docker is working
sudo docker run hello-world
# Install docker compose
sudo apt-get update
sudo apt-get install docker-compose-plugin
# Test the docker version
docker compose version
Setup Ronin Node
Make and switch to the working directory for the ronin node
mkdir -p ~/ronin/docker
cd ~/ronin
Make a directory for the chain data
mkdir -p chaindata/data/ronin
Go into the docker directory, create a docker-compose.yml file with the following configuration:
This compose file defines the node service that pulls a Ronin node image from the GitHub Container Registry.
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/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 --cache 4096 --discovery.dns enrtree://AIGOFYDZH6BGVVALVJLRPHSOYJ434MPFVVQFXJDXHW5ZYORPTGKUI@nodes.roninchain.com
(Optional) Download the snapshot from the ronin-snapshot repo - If you want to sync the ronin chain data in time and not wait for weeks before it is fully synced.
cd ~/ronin/chaindata/data/ronin/
wget -q -O - <snapshot URL from the README file in the repo> | tar -I zstd -xvf -
Run the node
cd ~/ronin/docker && docker-compose up -d
Monitor the node
Use docker logs to monitor the rootstock node. The -f flag ensures you are following the log output.
docker logs node -f --tail 100
You should see a response similar to this once your node starts syncing
INFO [11-14|21:24:17.122] Imported new chain segment blocks=1 txs=11 mgas=1.280 elapsed=16.911ms mgasps=75.657 number=39,923,835 hash=1afff2..417928 dirty=0.00B
INFO [11-14|21:24:20.156] Imported new chain segment blocks=1 txs=16 mgas=3.102 elapsed=25.749ms mgasps=120.449 number=39,923,836 hash=52613d..18b334 dirty=0.00B
INFO [11-14|21:24:23.139] Imported new chain segment blocks=1 txs=15 mgas=3.349 elapsed=30.903ms mgasps=108.379 number=39,923,837 hash=e34fa3..50d71d dirty=0.00B
INFO [11-14|21:24:26.089] Imported new chain segment blocks=1 txs=12 mgas=1.821 elapsed=20.431ms mgasps=89.147 number=39,923,838 hash=7b568b..250cb0 dirty=0.00B
INFO [11-14|21:24:29.155] Imported new chain segment blocks=1 txs=18 mgas=4.263 elapsed=26.391ms mgasps=161.523 number=39,923,839 hash=f16921..a764e8 dirty=0.00B
INFO [11-14|21:24:30.882] Deep froze chain segment blocks=20 elapsed=5.064ms number=39,833,839 hash=925558..afa3ca
INFO [11-14|21:24:32.101] Imported new chain segment blocks=1 txs=7 mgas=1.347 elapsed=18.884ms mgasps=71.350 number=39,923,840 hash=d1019d..13e80a dirty=0.00B
INFO [11-14|21:24:35.177] Imported new chain segment blocks=1 txs=14 mgas=2.823 elapsed=23.487ms mgasps=120.211 number=39,923,841 hash=5e0d2a..f2691b dirty=0.00B
Query the node
To get the web3 client version
curl http://localhost:8545 -s -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":67}'