Installation packages and dependencies

Binary currently only works on Ubuntu 24.04.
bash
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

bash
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

Install node

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

Create a service

bash
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

bash
sudo systemctl daemon-reload
sudo systemctl enable republicd

Initialize the node & other

bash
republicd init "Moniker-Name" --chain-id raitestnet_77701-1
bash
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

bash
curl https://snapshot.vinjan-inc.com/republic/genesis.json -o ~/.republic/config/genesis.json

Info: Info

Updated every 24 hours.

bash
curl https://snapshot.vinjan-inc.com/republic/addrbook.json -o ~/.republic/config/addrbook.json

Port

bash
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
bash
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

Pruning

bash
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

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

Gas Settings

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

Starter Snap (Under Maintenance)

Info: Under Maintenance

This service is temporarily unavailable due to maintenance. Please use Vinjan as an alternative.

Check snapshot height
bash
echo "REPUBLIC Snapshot Height: $(curl -s https://files.mictonode.com/snapshots/republic/block-height.txt)"
bash
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

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

Log Command

bash
sudo journalctl -fu republicd -o cat

Create wallet

bash
republicd keys add $REP_WALLET

Import wallet

bash
republicd keys add $REP_WALLET --recover

Import private key

bash
republicd keys unsafe-export-eth-key $REP_WALLET

Create Validator

bash
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
bash
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

bash
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

bash
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

bash
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

bash
local_height=$(republicd status | jq -r .sync_info.latest_block_height); network_height=$(curl -s https://rpc-t.republic.vinjan-inc.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.