Skip to main content

Installation

Minimum hardware requirement

4-8 Cores, 16G Ram, 500G NVME, Ubuntu 22.04 - 24.04

Installation of required packages

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

Installation GO

cd ~
VER="1.23.4" # Make sure that this version does not broke any other apps you run!
wget "https://golang.org/dl/go$VER.linux-amd64.tar.gz"
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf "go$VER.linux-amd64.tar.gz"
rm "go$VER.linux-amd64.tar.gz"
[ ! -f ~/.bash_profile ] && touch ~/.bash_profile
echo "export PATH=$PATH:/usr/local/go/bin:~/go/bin" >> ~/.bash_profile
source $HOME/.bash_profile
[ ! -d ~/go/bin ] && mkdir -p ~/go/bin
echo "export PORT="42"" >> $HOME/.bash_profile
source $HOME/.bash_profile

Downloading and installing node

wget https://github.com/RepublicAI/networks/releases/download/v0.3.0/republicd-linux-amd64 -O republicd
chmod +x republicd
mv republicd $HOME/go/bin/
republicd version --long | grep -e version -e commit

Set node configuration

republicd init NodeName --chain-id raitestnet_77701-1

Downloading genesis and addressbook

curl -L https://snapshots.nodesync.top/Testnet/Republicai/genesis.json > $HOME/.republic/config/genesis.json
curl -L https://snapshots.nodesync.top/Testnet/Republicai/addrbook.json > $HOME/.republic/config/addrbook.jso
# Set seeds and peers

peers="6313f892ee50ca0b2d6cc6411ac5207dbf2d164b@peers-t.republic.vinjan-inc.com:13356,[email protected]:13356,[email protected]:26656"
sed -i -e "s|^persistent_peers *=.*|persistent_peers = \"$peers\"|" $HOME/.republic/config/config.toml


# Set minimum gas price
sed -i -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"2500000000arai\"/" $HOME/.republic/config/app.toml

# Set indexer
sed -i 's|^indexer *=.*|indexer = "null"|' $HOME/.republic/config/config.toml

# Set pruning
sed -i \
-e 's|^pruning *=.*|pruning = "custom"|' \
-e 's|^pruning-keep-recent *=.*|pruning-keep-recent = "100"|' \
-e 's|^pruning-keep-every *=.*|pruning-keep-every = "0"|' \
-e 's|^pruning-interval *=.*|pruning-interval = "20"|' \
$HOME/.republic/config/app.toml

# Change ports

sed -i -e "s%:26657%:${PORT}57%" $HOME/.republic/config/client.toml
sed -i -e "s%:26658%:${PORT}58%; s%:26657%:${PORT}57%; s%:6060%:${PORT}60%; s%:26656%:${PORT}56%; s%:26660%:${PORT}60%" $HOME/.republic/config/config.toml
sed -i -e "s%:1317%:${PORT}17%; s%:9090%:${PORT}90%; s%:8545%:${PORT}45%; s%:8546%:${PORT}46%; s%:6065%:${PORT}65%" $HOME/.republic/config/app.toml

# Download latest chain data snapshot
curl -L https://snapshots.nodesync.top/Testnet/Republicai/republicai_latest.tar.lz4 | lz4 -dc - | tar -xf - -C $HOME/.republic

Creating service file

sudo tee /etc/systemd/system/republicd.service > /dev/null <<EOF
[Unit]
Description=republic
After=network-online.target

[Service]
User=$USER
ExecStart=$(which republicd) start
Restart=on-failure
RestartSec=3
LimitNOFILE=65535

[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable republicd

Start node

sudo systemctl start republicd && sudo journalctl -fu republicd -o cat