# RepublicAI-Testnet

#### Install Dependencies

```
sudo apt update && sudo apt upgrade -y
sudo apt install -y curl git jq patchelf
```

#### Install GLIBC 2.39 (Isolated)

```
cd $HOME
wget -O glibc-2.39-ubuntu24.tar.gz https://raw.githubusercontent.com/coinsspor/coinsspor/main/glibc-2.39-ubuntu24.tar.gz
tar -xzvf glibc-2.39-ubuntu24.tar.gz
sudo mkdir -p /opt/glibc-2.39/lib
sudo mv glibc-transfer/* /opt/glibc-2.39/lib/
/opt/glibc-2.39/lib/ld-linux-x86-64.so.2 --version
rm -rf glibc-transfer glibc-2.39-ubuntu24.tar.gz
```

#### Install Go (if not installed)

```
go version || {
    cd $HOME
    GO_VERSION="1.22.5"
    wget "https://golang.org/dl/go${GO_VERSION}.linux-amd64.tar.gz"
    sudo rm -rf /usr/local/go
    sudo tar -C /usr/local -xzf "go${GO_VERSION}.linux-amd64.tar.gz"
    rm "go${GO_VERSION}.linux-amd64.tar.gz"
    
    echo 'export GOROOT=/usr/local/go' >> $HOME/.bash_profile
    echo 'export GOPATH=$HOME/go' >> $HOME/.bash_profile
    echo 'export GO111MODULE=on' >> $HOME/.bash_profile
    echo 'export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin' >> $HOME/.bash_profile
    source $HOME/.bash_profile
}
go version
```

#### Download and Patch Republic Binary

```
cd $HOME
VERSION="v0.1.0"
curl -L "https://media.githubusercontent.com/media/RepublicAI/networks/main/testnet/releases/${VERSION}/republicd-linux-amd64" -o republicd
chmod +x republicd
patchelf --set-interpreter /opt/glibc-2.39/lib/ld-linux-x86-64.so.2 republicd
patchelf --set-rpath /opt/glibc-2.39/lib republicd
sudo cp republicd $HOME/go/bin/republicd
republicd version
```

#### Initialize Node

```
republicd init dongqn --chain-id 	raitestnet_77701-1
curl -s https://raw.githubusercontent.com/RepublicAI/networks/main/testnet/genesis.json > $HOME/.republic/config/genesis.json

```

#### Configure Peers

```
PEERS="e281dc6e4ebf5e32fb7e6c4a111c06f02a1d4d62@3.92.139.74:26656,cfb2cb90a241f7e1c076a43954f0ee6d42794d04@54.173.6.183:26656,dc254b98cebd6383ed8cf2e766557e3d240100a9@54.227.57.160:26656"
sed -i "s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.republic/config/config.toml
```

#### Configure Gas Price and Pruning

```
# Set minimum gas price
sed -i 's/minimum-gas-prices = "0arai"/minimum-gas-prices = "250000000arai"/' $HOME/.republic/config/app.toml

# Configure pruning (optional - saves disk space)
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 = "19"|' \
  $HOME/.republic/config/app.toml
```

#### Create Systemd Service

<pre><code><strong>sudo tee /etc/systemd/system/republicd.service > /dev/null &#x3C;&#x3C;EOF
</strong>[Unit]
Description=Republic Node
After=network-online.target

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

[Install]
WantedBy=multi-user.target
EOF
</code></pre>

#### Start Node

```
systemctl daemon-reload
systemctl enable republicd
systemctl restart republicd && journalctl -u republicd -f -o cat
```

### Verify Installation

```
republicd status 2>&1 | jq
```

### Wallet Operations

```abap
- Create New Wallet
republicd keys add wallet
- Import Existing Wallet
republicd keys add wallet --recover
- Check Balance
republicd query bank balances $(republicd keys show wallet -a)

```

### Create Validator

```
republicd tx staking create-validator \
  --amount=1000000000000000000000arai \
  --pubkey=$(republicd comet show-validator \
  --moniker="dongqn" \
  --identity="0D60B8464B1B7BB3" \
  --details="Making Node Setup Dongqn" \
  --website="https://dongqn.com" \
  --chain-id=raitestnet_77701-1 \
  --commission-rate="0.10" \
  --commission-max-rate="0.20" \
  --commission-max-change-rate="0.01" \
  --min-self-delegation="1" \
  --gas=auto \
  --gas-adjustment=1.5 \
  --gas-prices="250000000arai" \
  --from=wallet \
  -y
```
