hongbai-testnet node guide
Installation
Before you start. Replace every <PLACEHOLDER> with your own value and double-check the commands against the project's official documentation. Never share your mnemonic or priv_validator_key.json, and never run the same validator key on two servers.
1. Install dependencies
sudo apt update && sudo apt upgrade -y sudo apt install -y curl git wget htop tmux build-essential jq make lz4 gcc unzip ufw2. 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" echo 'export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin' >> $HOME/.bash_profile source $HOME/.bash_profile go version3. Build the binary
cd $HOME rm -rf <REPO_DIR> git clone <REPO> cd <REPO_DIR> git checkout <VERSION> make install # check the binary <BINARY> version --long | grep -e version -e commit4. Initialise the node
<BINARY> init <MONIKER> --chain-id <CHAIN_ID> --home $HOME/<HOME> <BINARY> config set client chain-id <CHAIN_ID> --home $HOME/<HOME> <BINARY> config set client keyring-backend file --home $HOME/<HOME> <BINARY> config set client node tcp://localhost:<PORT>657 --home $HOME/<HOME>5. Genesis and addrbook
wget -O $HOME/<HOME>/config/genesis.json <GENESIS_URL> wget -O $HOME/<HOME>/config/addrbook.json <ADDRBOOK_URL>6. Configure the node
# minimum gas price, seeds and peers sed -i -e "s|^minimum-gas-prices *=.*|minimum-gas-prices = \"<MIN_GAS_PRICE>\"|" $HOME/<HOME>/config/app.toml sed -i -e "s|^seeds *=.*|seeds = \"<SEEDS>\"|" $HOME/<HOME>/config/config.toml sed -i -e "s|^persistent_peers *=.*|persistent_peers = \"<PEERS>\"|" $HOME/<HOME>/config/config.toml # pruning (validator) 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/<HOME>/config/app.toml # indexer off for a validator-only node (keep "kv" if this node serves RPC/API to users) sed -i -e 's|^indexer *=.*|indexer = "null"|' $HOME/<HOME>/config/config.toml # prometheus metrics (bound by the port plan below, keep it firewalled) sed -i -e 's|^prometheus *=.*|prometheus = true|' $HOME/<HOME>/config/config.toml7. Custom ports
# every chain on the server gets its own port block (<PORT>xxx) so nodes never collide PORT=<PORT> sed -i.bak -e "s%:26658%:${PORT}658%g; s%:26657%:${PORT}657%g; s%:6060%:${PORT}060%g; s%:26656%:${PORT}656%g; s%:26660%:${PORT}660%g" $HOME/<HOME>/config/config.toml sed -i.bak -e "s%:1317%:${PORT}317%g; s%:8080%:${PORT}080%g; s%:9090%:${PORT}090%g; s%:9091%:${PORT}091%g; s%:8545%:${PORT}545%g; s%:8546%:${PORT}546%g; s%:6065%:${PORT}065%g" $HOME/<HOME>/config/app.toml # advertise the public p2p port EXT_IP=$(curl -s https://api.ipify.org) sed -i -e "s|^external_address *=.*|external_address = \"${EXT_IP}:${PORT}656\"|" $HOME/<HOME>/config/config.toml # open ONLY the p2p port to the world; RPC/API/gRPC stay private sudo ufw allow ${PORT}656/tcp comment '<BINARY> p2p'8. Create the service
sudo tee /etc/systemd/system/<BINARY>.service > /dev/null <<EOF2 [Unit] Description=<BINARY> node After=network-online.target [Service] User=$USER ExecStart=$(which <BINARY>) start --home $HOME/<HOME> Restart=on-failure RestartSec=5 LimitNOFILE=65535 [Install] WantedBy=multi-user.target EOF2 sudo systemctl daemon-reload sudo systemctl enable <BINARY>9. Start and sync
sudo systemctl start <BINARY> sudo journalctl -u <BINARY> -f -o cat # in another terminal: wait until "catching_up" is false <BINARY> status 2>&1 | jq .sync_info10. Wallet and validator
# 1) wallet (write the mnemonic down OFFLINE; never share it) <BINARY> keys add wallet --keyring-backend file --home $HOME/<HOME> # or restore: <BINARY> keys add wallet --recover # 2) fund the wallet, then wait for the node to finish syncing (catching_up = false) # 3) validator definition cat > $HOME/validator.json <<EOF2 { "pubkey": $(<BINARY> comet show-validator --home $HOME/<HOME>), "amount": "1000000uom", "moniker": "<MONIKER>", "identity": "<KEYBASE_IDENTITY>", "website": "<WEBSITE>", "security": "<SECURITY_EMAIL>", "details": "<DETAILS>", "commission-rate": "0.05", "commission-max-rate": "0.20", "commission-max-change-rate": "0.01", "min-self-delegation": "1" } EOF2 # 4) create the validator <BINARY> tx staking create-validator $HOME/validator.json \ --from wallet \ --chain-id <CHAIN_ID> \ --keyring-backend file \ --gas auto --gas-adjustment 1.5 --gas-prices <MIN_GAS_PRICE> \ --home $HOME/<HOME> -y
Cheat sheet
### Node
<BINARY> status 2>&1 | jq .sync_info # sync status
sudo journalctl -u <BINARY> -f -o cat # live logs
sudo systemctl restart <BINARY> # restart
curl -s localhost:<PORT>657/net_info | jq .result.n_peers # peers count
### Keys and balance
<BINARY> keys list --home $HOME/<HOME>
<BINARY> q bank balances $( <BINARY> keys show wallet -a --home $HOME/<HOME> )
### Staking
<BINARY> tx staking delegate <VALOPER> 1000000uom --from wallet --chain-id <CHAIN_ID> --gas auto --gas-adjustment 1.5 --gas-prices <MIN_GAS_PRICE> -y
<BINARY> tx distribution withdraw-all-rewards --from wallet --chain-id <CHAIN_ID> --gas auto --gas-adjustment 1.5 --gas-prices <MIN_GAS_PRICE> -y
<BINARY> tx distribution withdraw-rewards <VALOPER> --commission --from wallet --chain-id <CHAIN_ID> --gas auto --gas-adjustment 1.5 --gas-prices <MIN_GAS_PRICE> -y
### Validator
<BINARY> tx slashing unjail --from wallet --chain-id <CHAIN_ID> --gas auto --gas-adjustment 1.5 --gas-prices <MIN_GAS_PRICE> -y
<BINARY> q staking validator <VALOPER>
<BINARY> q slashing signing-info $(<BINARY> comet show-validator --home $HOME/<HOME>)
### Governance
<BINARY> q gov proposals --status voting_period
<BINARY> tx gov vote <PROPOSAL_ID> yes --from wallet --chain-id <CHAIN_ID> --gas auto --gas-adjustment 1.5 --gas-prices <MIN_GAS_PRICE> -y