Installation
# install dependencies, if needed
sudo apt update && sudo apt upgrade -y
sudo apt install curl git wget htop tmux build-essential jq make lz4 gcc unzip -y
Port = 20
# install go, if needed
cd $HOME
VER="1.22.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
# set vars
echo "export WALLET="wallet"" >> $HOME/.bash_profile
echo "export MONIKER="Chicharito"" >> $HOME/.bash_profile
echo "export NATIVE_CHAIN_ID="native-t1"" >> $HOME/.bash_profile
echo "export NATIVE_PORT="20"" >> $HOME/.bash_profile
source $HOME/.bash_profile
# download binary
cd $HOME
git clone https://github.com/gonative-cc/gonative && cd gonative
git checkout v0.1.1
make build
mv $HOME/gonative/out/gonative $HOME/go/bin/gonatived
gonatived version --long | grep -e version -e commit
# version: 0.1.1
# commit: 5bcbb57e4e4689cf515e1c9e6326ae9078f3bdfa
# comet_server_version: v1.0.0-beta.1
# cosmos_sdk_version: v0.52.0-rc.1.0.20250106202622-c6327ea6e403
# runtime_version: v2.0.0-20241219154748-69025c556666
# stf_version: v1.0.0-beta.1
# config and init app
gonatived config node tcp://localhost:${NATIVE_PORT}657
gonatived config set client chain-id native-t1
gonatived config set client keyring-backend os
gonatived init "Chicharito" --chain-id native-t1
# download genesis and addrbook
wget https://github.com/gonative-cc/network-docs/raw/refs/heads/master/genesis/genesis-testnet-1.json.gz
gzip -d genesis-testnet-1.json.gz
mv genesis-testnet-1.json $HOME/.gonative/config/genesis.json
sha256sum ~/.gonative/config/genesis.json
# 6c7c7ee70b89850dfe9b9c64b24debe67e36ddf5457c8555d4b979146b99e1b0
wget -O $HOME/.gonative/config/addrbook.json "https://share102.utsa.tech/native/addrbook.json"
# set seeds and peers
peers="[email protected]:52656,[email protected]:56406,[email protected]:26656,[email protected]:56406,[email protected]:52656,[email protected]:27656,[email protected]:40656,[email protected]:10007,[email protected]:26056,[email protected]:26656,[email protected]:15007,[email protected]:32107,[email protected]:26656,[email protected]:30656,[email protected]:24096,[email protected]:30656,[email protected]:26444,[email protected]:26656,[email protected]:38656,[email protected]:24656,[email protected]:12056,[email protected]:26656,[email protected]:24096,[email protected]:26656,[email protected]:26656,[email protected]:52656,[email protected]:26656,[email protected]:26656"
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$peers\"/" $HOME/.gonative/config/config.toml
seeds="ade4d8bc8cbe014af6ebdf3cb7b1e9ad36f412c0@testnet-seeds.polkachu.com:30656"
sed -i.bak -e "s/^seeds =.*/seeds = \"$seeds\"/" $HOME/.gonative/config/config.toml
# set custom ports in app.toml
sed -i.bak -e "s%:1317%:${NATIVE_PORT}317%g;
s%:8080%:${NATIVE_PORT}080%g;
s%:9090%:${NATIVE_PORT}090%g;
s%:9091%:${NATIVE_PORT}091%g;
s%:8545%:${NATIVE_PORT}545%g;
s%:8546%:${NATIVE_PORT}546%g;
s%:6065%:${NATIVE_PORT}065%g" $HOME/.gonative/config/app.toml
# set custom ports in config.toml file
sed -i.bak -e "s%:26658%:${NATIVE_PORT}658%g;
s%:26657%:${NATIVE_PORT}657%g;
s%:6060%:${NATIVE_PORT}060%g;
s%:26656%:${NATIVE_PORT}656%g;
s%^external_address = \"\"%external_address = \"$(wget -qO- eth0.me):${NATIVE_PORT}656\"%;
s%:26660%:${NATIVE_PORT}660%g" $HOME/.gonative/config/config.toml
# config pruning
sed -i -e "s/^pruning *=.*/pruning = \"custom\"/" $HOME/.gonative/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"100\"/" $HOME/.gonative/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"50\"/" $HOME/.gonative/config/app.toml
# set minimum gas price, enable prometheus and disable indexing
sed -i 's|minimum-gas-prices =.*|minimum-gas-prices = "0.1untiv"|g' $HOME/.gonative/config/app.toml
sed -i -e "s/prometheus = false/prometheus = true/" $HOME/.gonative/config/config.toml
sed -i -e "s/^indexer *=.*/indexer = \"null\"/" $HOME/.gonative/config/config.toml
# create service file
sudo tee /etc/systemd/system/gonatived.service > /dev/null <<EOF
[Unit]
Description=gonatived
After=network-online.target
[Service]
User=$USER
ExecStart=$(which gonatived) start
Restart=on-failure
RestartSec=3
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
# enable and start service
systemctl daemon-reload
systemctl enable gonatived
systemctl restart gonatived && journalctl -u gonatived -f -o cat
Create wallet
# to create a new wallet, use the following command. donβt forget toΒ save the mnemonic
gonatived keys add $WALLET
# to restore exexuting wallet, use the following command
gonatived keys add $WALLET --recover
# save wallet and validator address
WALLET_ADDRESS=$(gonatived keys show $WALLET -a)
VALOPER_ADDRESS=$(gonatived keys show $WALLET --bech val -a)
echo "export WALLET_ADDRESS="$WALLET_ADDRESS >> $HOME/.bash_profile
echo "export VALOPER_ADDRESS="$VALOPER_ADDRESS >> $HOME/.bash_profile
source $HOME/.bash_profile
# check sync status, once your node is fully synced, the output from above will print "false"
gonatived status 2>&1 | jq
# before creating a validator, you need to fund your wallet and check balance
gonatived query bank balances $WALLET_ADDRESS
Node Sync Status Checker
#!/bin/bash
rpc_port=$(grep -m 1 -oP '^laddr = "\K[^"]+' "$HOME/.gonative/config/config.toml" | cut -d ':' -f 3)
while true; do
local_height=$(curl -s localhost:$rpc_port/status | jq -r '.result.sync_info.latest_block_height')
network_height=$(curl -s https://t-native.rpc.utsa.tech/status | jq -r '.result.sync_info.latest_block_height')
if ! [[ "$local_height" =~ ^[0-9]+$ ]] || ! [[ "$network_height" =~ ^[0-9]+$ ]]; then
echo -e "\033[1;31mError: Invalid block height data. Retrying...\033[0m"
sleep 5
continue
fi
blocks_left=$((network_height - local_height))
if [ "$blocks_left" -lt 0 ]; then
blocks_left=0
fi
echo -e "\033[1;33mNode Height:\033[1;34m $local_height\033[0m \033[1;33m| Network Height:\033[1;36m $network_height\033[0m \033[1;33m| Blocks Left:\033[1;31m $blocks_left\033[0m"
sleep 5
done
Create validator
cd $HOME
# Create validator.json file
echo "{\"pubkey\":{\"@type\":\"/cosmos.crypto.ed25519.PubKey\",\"key\":\"$(gonatived comet show-validator | grep -Po '\"key\":\s*\"\K[^"]*')\"},
\"amount\": \"1000000untiv\",
\"moniker\": \"\",
\"identity\": \"\",
\"website\": \"\",
\"security\": \"\",
\"details\": \"I love Prysm β€οΈ\",
\"commission-rate\": \"0.1\",
\"commission-max-rate\": \"0.2\",
\"commission-max-change-rate\": \"0.01\",
\"min-self-delegation\": \"1\"
}" > validator.json
# Create a validator using the JSON configuration
gonatived tx staking create-validator validator.json \
--from $WALLET \
--chain-id native-t1 \
--gas auto --gas-adjustment 1.5 \
-y
Delete node
sudo systemctl stop gonatived
sudo systemctl disable gonatived
sudo rm -rf /etc/systemd/system/gonatived.service
sudo rm $(which gonatived)
sudo rm -rf $HOME/.gonative
sed -i "/NATIVE_/d" $HOME/.bash_profile
Last updated
Was this helpful?