Skip to content

Republic AI Node Installation Guide

Before beginning the installation, ensure your environment meets the following requirements:

  • Operating System: Ubuntu 22.04 LTS or newer.
  • Resources: 4+ CPU cores, 8GB+ RAM, and 200GB+ SSD storage.
  • Network: Open ports 30656 (P2P) and 30657 (RPC) if using the custom port configuration in this guide.

Update the local package index and install the necessary build tools and dependencies.

Terminal window
sudo apt update && sudo apt upgrade -y
sudo apt install curl git wget htop tmux build-essential jq make lz4 gcc unzip -y

Republic AI requires Go. This block installs version 1.25.5 and configures the environment paths.

Terminal window
cd $HOME
sudo rm -rf /usr/local/go
VER="1.25.5"
curl -Ls https://go.dev/dl/go$VER.linux-amd64.tar.gz | sudo tar -xzf - -C /usr/local
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile
source $HOME/.bash_profile
mkdir -p ~/go/bin
go version

Download the pre-compiled Republic AI binary and move it to your executable path.

Terminal window
cd $HOME
wget https://github.com/RepublicAI/networks/raw/refs/heads/main/testnet/releases/v0.3.0/republicd-linux-amd64 -O republicd
chmod +x republicd
mv republicd ~/go/bin/

Initialize the node configuration files. Replace "Your_Nodes_Name" with your preferred moniker.

Terminal window
republicd init "Your_Nodes_Name" --chain-id raitestnet_77701-1

Download the genesis file and the address book to ensure connectivity to the testnet peers.

Terminal window
wget -O $HOME/.republic/config/genesis.json http://45.76.1.67/republic/genesis.json
wget -O $HOME/.republic/config/addrbook.json http://45.76.1.67/republic/addrbook.json

The following commands modify app.toml and config.toml to use custom ports (prefix 30), preventing conflicts with other Cosmos-based nodes on the same machine.

Terminal window
sed -i -e "s%:1317%:30317%; s%:8080%:30080%; s%:9090%:30090%; s%:9091%:30091%; s%:8545%:30545%; s%:8546%:30546%; s%:6065%:30065%" $HOME/.republic/config/app.toml
sed -i -e "s%:26658%:30658%; s%:26657%:30657%; s%:6060%:30060%; s%:26656%:30656%; s%:26660%:30660%" $HOME/.republic/config/config.toml
sed -i -e "s|^node *=.*|node = \"tcp://localhost:30657\"|" $HOME/.republic/config/client.toml

To minimize disk usage, we recommend setting custom pruning and disabling the indexer unless you are running an RPC/Archive node.

Terminal window
# Configure Pruning
sed -i -e "s/^pruning *=.*/pruning = \"custom\"/" $HOME/.republic/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"100\"/" $HOME/.republic/config/app.toml
sed -i -e "s/^pruning-keep-every *=.*/pruning-keep-every = \"0\"/" $HOME/.republic/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"19\"/" $HOME/.republic/config/app.toml
# Set minimum gas price
sed -i 's|minimum-gas-prices =.*|minimum-gas-prices = "2500000000arai"|g' $HOME/.republic/config/app.toml
# Disable Indexer
sed -i -e "s/^indexer *=.*/indexer = \"null\"/" $HOME/.republic/config/config.toml

Choose one of the following methods to manage your node process.

Cosmovisor automates binary upgrades by monitoring the chain for upgrade proposals.

Terminal window
# Setup directory structure
mkdir -p $HOME/.republic/cosmovisor/genesis/bin
mv $HOME/go/bin/republicd $HOME/.republic/cosmovisor/genesis/bin/
# Create symlinks
sudo ln -s $HOME/.republic/cosmovisor/genesis $HOME/.republic/cosmovisor/current -f
sudo ln -s $HOME/.republic/cosmovisor/current/bin/republicd /usr/local/bin/republicd -f
# Install Cosmovisor binary
go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@v1.7.0
# Create systemd service
sudo tee /etc/systemd/system/republicd.service > /dev/null << EOF
[Unit]
Description=Republic Node (Cosmovisor)
After=network-online.target
[Service]
User=$USER
ExecStart=$(which cosmovisor) run start
Restart=on-failure
RestartSec=10
LimitNOFILE=65535
Environment="DAEMON_HOME=$HOME/.republic"
Environment="DAEMON_NAME=republicd"
Environment="UNSAFE_SKIP_BACKUP=true"
[Install]
WantedBy=multi-user.target
EOF

Use this for a simpler setup without automated upgrade handling.

Terminal window
sudo tee /etc/systemd/system/republicd.service > /dev/null <<EOF
[Unit]
Description=Republic Node
After=network-online.target
[Service]
User=$USER
WorkingDirectory=$HOME/.republic
ExecStart=$(which republicd) start --home $HOME/.republic
Restart=on-failure
RestartSec=5
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF

Reload the systemd daemon, enable the service, and monitor the logs to ensure the node is syncing.

Terminal window
sudo systemctl daemon-reload
sudo systemctl enable republicd
sudo systemctl restart republicd && sudo journalctl -u republicd -f -o cat

Check sync status:

Terminal window
republicd status 2>&1 | jq .SyncInfo