🔌 Installation

1️⃣ Installation packages and dependencies

Reminder

Binary currently only works on Ubuntu 24.04.
sudo apt update && sudo apt upgrade -y
sudo apt install curl git wget htop tmux build-essential make lz4 gcc unzip jq zstd tar -y

➡️ Go Installation

cd $HOME
VER="1.25.6"
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

2️⃣ Install node

Reminder

You can change the port and wallet name.
echo "export REP_WALLET="mictowallet"" >> $HOME/.bash_profile
echo "export REP_PORT="47"" >> $HOME/.bash_profile
source $HOME/.bash_profile
cd $HOME
mkdir -p $HOME/.republic/cosmovisor/upgrades/v0.1.0/bin
wget https://media.githubusercontent.com/media/RepublicAI/networks/main/testnet/releases/v0.1.0/republicd-linux-amd64 -O $HOME/.republic/cosmovisor/upgrades/v0.1.0/bin/republicd
chmod +x $HOME/.republic/cosmovisor/upgrades/v0.1.0/bin/republicd
sudo ln -sfn $HOME/.republic/cosmovisor/upgrades/v0.1.0 $HOME/.republic/cosmovisor/current
sudo ln -sfn $HOME/.republic/cosmovisor/current/bin/republicd /usr/local/bin/republicd
go install cosmossdk.io/tools/cosmovisor/cmd/[email protected]
cd

➡️ Create a service

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

[Service]
User=$USER
ExecStart=$(which cosmovisor) run start --home $HOME/.republic --chain-id raitestnet_77701-1
Restart=on-failure
RestartSec=10
LimitNOFILE=65535
Environment="DAEMON_HOME=$HOME/.republic"
Environment="DAEMON_NAME=republicd"
Environment="UNSAFE_SKIP_BACKUP=true"
Environment="PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:$HOME/.republic/cosmovisor/current/bin"

[Install]
WantedBy=multi-user.target
EOF

➡️ Let’s activate it

sudo systemctl daemon-reload
sudo systemctl enable republicd

➡️ Initialize the node & other

republicd init "Moniker-Name" --chain-id raitestnet_77701-1
sed -i -e '/^chain-id = /c\chain-id = "raitestnet_77701-1"' $HOME/.republic/config/client.toml
sed -i -e "s|^node *=.*|node = \"tcp://localhost:${REP_PORT}657\"|" $HOME/.republic/config/client.toml
sed -i -e '/^keyring-backend = /c\keyring-backend = "test"' $HOME/.republic/config/client.toml

➡️ Genesis & addrbook

curl https://files.mictonode.com/configs/republic/genesis.json -o ~/.republic/config/genesis.json
curl https://files.mictonode.com/configs/republic/addrbook.json -o ~/.republic/config/addrbook.json

➡️ Port

sed -i.bak -e "s%:26658%:${REP_PORT}658%g;
s%:26657%:${REP_PORT}657%g;
s%:6060%:${REP_PORT}060%g;
s%:26656%:${REP_PORT}656%g;
s%^external_address = \"\"%external_address = \"$(wget -qO- eth0.me):${REP_PORT}656\"%;
s%:26660%:${REP_PORT}660%g" $HOME/.republic/config/config.toml
sed -i.bak -e "s%:1317%:${REP_PORT}317%g;
s%:8080%:${REP_PORT}080%g;
s%:9090%:${REP_PORT}090%g;
s%:9091%:${REP_PORT}091%g;
s%:8545%:${REP_PORT}545%g;
s%:8546%:${REP_PORT}546%g;
s%:6065%:${REP_PORT}065%g" $HOME/.republic/config/app.toml

➡️ Peers and Seeds

SEEDS=""
PEERS="[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:18656,[email protected]:26656,[email protected]:23656,[email protected]:13356,[email protected]:18656,[email protected]:26656,[email protected]:55856,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:13356,[email protected]:26656,[email protected]:26656,[email protected]:34656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:13356,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26756,[email protected]:26656,[email protected]:26656,[email protected]:43656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:43656,[email protected]:36656"
sed -i -e "s/^seeds *=.*/seeds = \"$SEEDS\"/; s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.republic/config/config.toml

➡️ 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-interval *=.*/pruning-interval = \"10\"/" $HOME/.republic/config/app.toml

➡️ Indexer & Other

sed -i -e "s/^indexer *=.*/indexer = \"null\"/" $HOME/.republic/config/config.toml

➡️ Gas Settings

sed -i 's|minimum-gas-prices =.*|minimum-gas-prices = "1000000000arai"|g' $HOME/.republic/config/app.toml

➡️ Starter Snap

Check snapshot height
echo "REPUBLIC Snapshot Height: $(curl -s https://files.mictonode.com/snapshots/republic/block-height.txt)"
sudo apt update && sudo apt install zstd -y
republicd comet unsafe-reset-all --home $HOME/.republic --keep-addr-book

SNAPSHOT_URL="https://files.mictonode.com/snapshots/republic/"
LATEST_SNAPSHOT=$(curl -s $SNAPSHOT_URL | grep -oP 'republic_\d+\.tar\.zst' | sort -t_ -k2 -n | tail -n 1)

if [ -n "$LATEST_SNAPSHOT" ]; then
  FULL_URL="${SNAPSHOT_URL}${LATEST_SNAPSHOT}"
  
  if curl -s --head "$FULL_URL" | head -n 1 | grep "200" > /dev/null; then
    echo "Downloading and extracting $LATEST_SNAPSHOT..."
    
    curl "$FULL_URL" | zstd -dc - | tar -xf - -C $HOME/.republic
    
    echo "Snapshot restore complete."
  else
    echo "Snapshot URL not accessible"
  fi
else
  echo "No snapshot found"
fi

➡️ Let’s get started

sudo systemctl restart republicd
sudo journalctl -fu republicd -o cat

➡️ Log Command

sudo journalctl -fu republicd -o cat

➡️ Create wallet

republicd keys add $REP_WALLET

➡️ Import wallet

republicd keys add $REP_WALLET --recover

➡️ Import private key

republicd keys unsafe-export-eth-key $REP_WALLET

➡️ Create Validator

cat > $HOME/validator.json << EOF
{
	"pubkey": $(republicd comet show-validator),
	"amount": "1000000000000000000arai",
	"moniker": "Moniker-Name",
	"identity": "optional identity signature (ex. UPort or Keybase)",
	"website": "validator's (optional) website",
	"security": "validator's (optional) security contact email",
	"details": "validator's (optional) details",
	"commission-rate": "0.1",
	"commission-max-rate": "0.2",
	"commission-max-change-rate": "0.05",
	"min-self-delegation": "1"
}
EOF
republicd tx staking create-validator $HOME/validator.json --chain-id=raitestnet_77701-1 --gas="auto" --gas-adjustment="1.5" --gas-prices="1000000000arai" --from=$REP_WALLET -y

➡️ Delegate to Yourself

republicd tx staking delegate $(republicd keys show $REP_WALLET --bech val -a) 1000000000000000000arai --from $REP_WALLET --chain-id raitestnet_77701-1 --gas="auto" --gas-adjustment="1.5" --gas-prices="1000000000arai" -y 

➡️ Edit Validator

republicd tx staking edit-validator \
--chain-id raitestnet_77701-1 \
--commission-rate 0.05 \
--new-moniker "validator-name" \
--identity "" \
--details "" \
--website "" \
--security-contact "" \
--from $REP_WALLET \
--node http://localhost:${REP_PORT}657 \
--gas="auto" --gas-adjustment="1.5" --gas-prices="1000000000arai" \
-y

➡️ Complete deletion

cd $HOME
sudo systemctl stop republicd
sudo systemctl disable republicd
sudo rm -rf /etc/systemd/system/republicd.service
sudo systemctl daemon-reload
sudo rm -f /usr/local/bin/republicd
sudo rm -f $(which republicd)
sudo rm -rf $HOME/.republic
sed -i "/REP_PORT_/d" $HOME/.bash_profile

➡️ Block check

local_height=$(republicd status | jq -r .sync_info.latest_block_height); network_height=$(curl -s https://republic-testnet-rpc.mictonode.com/status | jq -r .result.sync_info.latest_block_height); blocks_left=$((network_height - local_height)); echo "Your node height: $local_height"; echo "MictoNode height: $network_height"; echo "Blocks left: $blocks_left"
  • Your node height - the current block of your node
  • Network height - the last block of the network
  • Blocks left - how many blocks your node has left to sync.