Bare Metal

Author: [ jleopoldA ]

System Requirements

CPU
OS
RAM
DISK

8 Core

Ubuntu 24.04.1 LTS

32 GB

7TB SSD

Ronin has a size of (SIZE HERE) as of (DATE HERE)

Pre-Requisites

Ronin requires the installation of Go.

Update System

sudo apt update -y && sudo apt upgrade -y && sudo apt autoremove -y

Set up Firewall

Set Explicit Default Firewall Rules

sudo ufw default deny incoming
sudo ufw default allow outgoing

Allow SSH

sudo ufw allow 22/tcp

Allow Remote RPC Connections with Ronin Node

sudo ufw allow 8545
sudo ufw allow 8546

Allow P2P Connections

sudo ufw allow 30303/tcp && sudo ufw allow 30303/udp

Enable Firewall

sudo ufw enable

To Check Status / Current Rules of UFW

sudo ufw status verbose

Install GO

This step is necessary if GO is not installed.

Check for Latest Version of GO

# This will return the latest version of GO
curl -s https://go.dev/VERSION?m=text

# Example response
go1.23.3
time 2024-11-06T18:46:45Z

Download the Latest GO Tarball

# Downloading using the above example response
wget https://go.dev/dl/go1.23.3.linux-amd64.tar.gz

# Example command if the above version is different
wget https://go.dev/dl/VERSION.linux-amd64.tar.gz

Extract and Install GO

sudo tar -C /usr/local -xzf go1.23.3.linux-amd64.tar.gz 

Set Up Environment Variables

echo "export PATH=\$PATH:/usr/local/go/bin" >> ~/.bashrc
source ~/.bashrc

Check Installation

go version

# Example response
go version go1.23.3 linux/amd64

Install Ronin

Clone the Ronin Repo

cd /root

# The below command will create a directory called 'ronin'
# The path to it will be /root/ronin
git clone https://github.com/axieinfinity/ronin

Build Ronin

cd /ronin/cmd/ronin
go build -o ronin

Initialize Ronin Genesis Block

Ronin requires the initialization of its Genesis Block before being run.

./ronin init --datadir /opt/ronin /root/ronin/genesis/mainnet.json

Create System Service

# Copy and paste the code below and run it within your terminal.
sudo echo "[Unit]
Description=Ronin Node
After=network.target
StartLimitIntervalSec=200
StartLimitBurst=5

[Service]
Type=simple
Restart=on-failure
RestartSec=5
TimeoutSec=900
User=root
Nice=0
LimitNOFILE=200000
WorkingDirectory=/root/ronin/
ExecStart=/root/ronin/cmd/ronin/ronin \
	--gcmode archive --syncmode full \
	--http --http.addr 0.0.0.0 --http.api eth,net,web3 --http.port 8545 \
	--ws --ws.addr 0.0.0.0 --ws.port 8546 --ws.api eth,net,web3 \
	--datadir /opt/ronin \
        --port 30303 --networkid 2020 \
	--discovery.dns enrtree://AIGOFYDZH6BGVVALVJLRPHSOYJ434MPFVVQFXJDXHW5ZYORPTGKUI@nodes.roninchain.com
Restart=on-failure
LimitNOFILE=1000000
StandardOutput=journal
StandardError=journal

[Install]
WantedBy=multi-user.target" > /etc/systemd/system/ronin.service

Run Ronin Node

sudo systemctl daemon-reload # Refresh after systemd configuration changes
sudo systemctl enable ronin.service # Enable ronin.service at start up
sudo systemctl start ronin.service # Starts ronin.service
sudo systemctl stop ronin.service # Stops ronin.service
sudo systemctl restart ronin.service # Restarts ronin.service

View Logs for Debugging

journactl -fu ronin.service -xe

Query Ronin Node

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

# Example response
{"jsonrpc":"2.0","id":1,"result":"0x40e2d5"}

References

Last updated