Doc – Republic Testnet
Minimum Hardware
| NODE | CPU | RAM | SSD | OS |
|---|---|---|---|---|
| republicd | 8 | 16 | 200 GB | Ubuntu 22.04 LTS |
Install Dependencies
sudo apt update && sudo apt upgrade -y
sudo apt install curl git wget htop tmux build-essential jq make lz4 gcc unzip -y
Install Go
cd $HOME
VER="1.22.5"
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
Set Var
echo "export WALLET="wallet"" >> $HOME/.bash_profile
echo "export MONIKER="test"" >> $HOME/.bash_profile
echo "export REPUBLIC_CHAIN_ID="raitestnet_77701-1"" >> $HOME/.bash_profile
echo "export REPUBLIC_PORT="21"" >> $HOME/.bash_profile
source $HOME/.bash_profile
Download Binary
cd $HOME
rm -rf republicd
wget https://github.com/RepublicAI/networks/raw/refs/heads/main/testnet/releases/v0.1.0/republicd-linux-amd64 -O republicd
chmod +x republicd
mv republicd $HOME/go/bin/
Config and Init App
republicd config node tcp://localhost:${REPUBLIC_PORT}657
REPUBLIC config keyring-backend os
REPUBLIC config chain-id raitestnet_77701-1
REPUBLIC init "test" --chain-id raitestnet_77701-1
Download Genesis and Addrbook
curl -L https://raw.githubusercontent.com/RepublicAI/networks/main/testnet/genesis.json > ~/.republicd/config/genesis.json
Pruning, Gas and Prometheus
sed -i 's/minimum-gas-prices =.*/minimum-gas-prices = "0arai"/' ~/.republicd/config/app.toml
Create Service File
sudo tee /etc/systemd/system/republicd.service > /dev/null << EOF
[Unit]
Description=Republic Node
After=network-online.target
[Service]
User=root
ExecStart=$(which republicd) start
Restart=always
RestartSec=3
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
Start
sudo systemctl daemon-reload
sudo systemctl enable republicd
sudo systemctl restart republicd && sudo journalctl -u republicd -fo cat
State Sync
SNAP_RPC1="https://rpc-republic.onenov.xyz"
SNAP_RPC2="https://rpc-republic.onenov.xyz"
# Get latest block height
LATEST_HEIGHT=$(curl -s $SNAP_RPC1/block | jq -r .result.block.header.height)
# Calculate trust height (2000 blocks before latest)
BLOCK_HEIGHT=$((LATEST_HEIGHT - 2000))
# Get trust hash
TRUST_HASH=$(curl -s "$SNAP_RPC1/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash)
# Update config.toml
sed -i.bak -E "s|^(enable[[:space:]]+=[[:space:]]+).*|\\1true| ; \
s|^(rpc_servers[[:space:]]+=[[:space:]]+).*|\\1\\"$SNAP_RPC1,$SNAP_RPC2\\"| ; \
s|^(trust_height[[:space:]]+=[[:space:]]+).*|\\1$BLOCK_HEIGHT| ; \
s|^(trust_hash[[:space:]]+=[[:space:]]+).*|\\1\\"$TRUST_HASH\\"|" ~/.republicd/config/config.toml
# Verify changes
echo "State sync configuration:"
grep -E "enable|rpc_servers|trust_height|trust_hash" ~/.republicd/config/config.toml
Create and Restore Address
Republicd keys add wallet
# Restore wallet
Republicd keys add wallet --recover
# List
Republicd keys list
Check Balance
Republicd q bank balances $(Republicd keys show wallet -a)
Create Validator
republicd comet show-validator
cat > $HOME/.republic/validator.json << EOF
{
"pubkey": {
"@type": "/cosmos.crypto.ed25519.PubKey",
"key": "$(republicd comet show-validator | jq -r .key)"
},
"amount": "1000000000000000000arai",
"moniker": " ",
"identity": " ",
"website": " ",
"security": " ",
"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 /root/.republic/validator.json --from wallet --chain-id raitestnet_77701-1 --gas-prices=2500000000arai --gas=300000 --yes
Delegate to own
republicd tx staking delegate $(republicd keys show wallet --bech val -a) 100000000000000000arai --from wallet --chain-id raitestnet_77701-1 --gas-prices=3500000000arai --gas-adjustment=1.5 --gas=auto --keyring-backend test --yes
Unjail Validator
republicd tx slashing unjail --from wallet --chain-id raitestnet_77701-1 --gas-prices=2500000000arai --gas=300000 --yes
Vote
Republicd tx gov vote 1 yes --from wallet--chain-id raitestnet_77701-1 --gas-prices=2500000000arai --gas=300000 --yes
Delete node
sudo systemctl stop republicd
sudo systemctl disable republicd
sudo rm /etc/systemd/system/republicd.service
sudo systemctl daemon-reload
rm -f $(which republicd)
rm -rf .republic