Mainnet

Terp Network

Stake With Us
Installation Guide
Tendermint CLI
Public Endpoint
State Sync
Custom Explorer
Stake With Us
Stake With Us
Installation Guide
Tendermint CLI
Public Endpoint
State Sync
Custom Explorer

How To Install Full Node Terp Network Mainnet

Setting up vars

Your Nodename (validator) that will shows in explorer

NODENAME=<Your_Nodename_Moniker>

Save variables to system

echo "export NODENAME=$NODENAME" >> $HOME/.bash_profile
if [ ! $WALLET ]; then
    echo "export WALLET=wallet" >> $HOME/.bash_profile
fi
echo "export TERP_CHAIN_ID=morocco-1" >> $HOME/.bash_profile
source $HOME/.bash_profile

Update packages

sudo apt update && sudo apt upgrade -y

Install dependencies

sudo apt install curl build-essential git wget jq make gcc tmux net-tools -y

Install go

if ! [ -x "$(command -v go)" ]; then
     ver="1.20.3"
     cd $HOME
     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" >> ~/.bash_profile
     source ~/.bash_profile
fi

Download and build binaries

cd $HOME
git clone https://github.com/terpnetwork/terp-core.git
cd terp-core
git checkout v1.0.0
make install

Config app

terpd config chain-id $TERP_CHAIN_ID

Init app

terpd  init $NODENAME --chain-id $TERP_CHAIN_ID

Download configuration

wget -O $HOME/.terp/config/genesis.json https://mainnet-files.itrocket.net/terp/genesis.json
wget -O $HOME/.terp/config/addrbook.json https://mainnet-files.itrocket.net/terp/addrbook.json

Set seeds and peers

SEEDS="d8256642afae77264bcce1631d51233a9d00249b@terp-mainnet-seed.itrocket.net:13656"
PEERS="a81dc3bf1bb1c3837b768eeb82659eecc971890b@terp-mainnet-peer.itrocket.net:13656"
sed -i -e "s/^seeds *=.*/seeds = \"$SEEDS\"/; s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.terp/config/config.toml

Disable indexing and set gas-prices

sed -i 's/minimum-gas-prices =.*/minimum-gas-prices = "0.0uterp"/g' $HOME/.terp/config/app.toml
sed -i -e "s/^indexer *=.*/indexer = \"null\"/" $HOME/.terp/config/config.toml

Config pruning

sed -i -e "s/^pruning *=.*/pruning = \"nothing\"/" $HOME/.terp/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"100\"/" $HOME/.terp/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"50\"/" $HOME/.terp/config/app.toml

Create service

sudo tee /etc/systemd/system/terpd.service > /dev/null <<EOF
[Unit]
Description=Terp node
After=network-online.target
[Service]
User=$USER
ExecStart=$(which terpd) start --home $HOME/.terp
Restart=on-failure
RestartSec=3
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF

Register and start service

sudo systemctl daemon-reload
sudo systemctl enable terpd
sudo systemctl restart terpd && sudo journalctl -u terpd -f -o cat

Guidence for create validator

Create wallet

To create new wallet you can use command below. Don’t forget to save the mnemonic

terpd keys add $WALLET

To recover your wallet using seed phrase

terpd keys add $WALLET --recover

Show your wallet list

terpd keys list

Save wallet info

Add wallet and validator address into variables

TERP_WALLET_ADDRESS=$(terpd keys show $WALLET -a)
TERP_VALOPER_ADDRESS=$(terpd keys show $WALLET --bech val -a)
echo 'export TERP_WALLET_ADDRESS='${TERP_WALLET_ADDRESS} >> $HOME/.bash_profile
echo 'export TERP_VALOPER_ADDRESS='${TERP_VALOPER_ADDRESS} >> $HOME/.bash_profile
source $HOME/.bash_profile

Fund your wallet

In order to create validator first you need to fund your wallet.

N/A

Create validator

check your wallet balance:

terpd query bank balances $TERP_WALLET_ADDRESS

To create your validator run command below

terpd tx staking create-validator \
  --amount 1000000uterp \
  --from $WALLET \
  --commission-max-change-rate "0.1" \
  --commission-max-rate "0.2" \
  --commission-rate "0.1" \
  --min-self-delegation "1" \
  --pubkey  $(terpd tendermint show-validator) \
  --moniker $NODENAME \
  --chain-id $TERP_CHAIN_ID \
  --gas auto \
  --gas-adjustment 1.3 \
  --fees 70000uthiol

Check your validator key

[[ $(terpd q staking validator $TERP_VALOPER_ADDRESS -oj | jq -r .consensus_pubkey.key) = $(terpd status | jq -r .ValidatorInfo.PubKey.value) ]] && echo -e "\n\e[1m\e[32mTrue\e[0m\n" || echo -e "\n\e[1m\e[31mFalse\e[0m\n"

Get list of validators

terpd q staking validators -oj --limit=3000 | jq '.validators[] | select(.status=="BOND_STATUS_BONDED")' | jq -r '(.tokens|tonumber/pow(10; 6)|floor|tostring) + " \t " + .description.moniker' | sort -gr | nl

Usefull commands

Service management

Check logs

journalctl -fu terpd -o cat

Start service

sudo systemctl start terpd

Stop service

sudo systemctl stop terpd

Restart service

sudo systemctl restart terpd

Node info

Synchronization info

terpd status 2>&1 | jq .SyncInfo

Validator info

terpd status 2>&1 | jq .ValidatorInfo

Node info

terpd status 2>&1 | jq .NodeInfo

Show node id

terpd tendermint show-node-id

Wallet operations

List of wallets

terpd keys list

Recover wallet

terpd keys add $WALLET --recover

Delete wallet

terpd keys delete $WALLET

Get wallet balance

terpd query bank balances $TERP_WALLET_ADDRESS

Transfer funds

terpd tx bank send $TERP_WALLET_ADDRESS <TO_TERP_WALLET_ADDRESS> 1000000uterp

Voting

terpd tx gov vote 1 yes --from $WALLET --chain-id=$TERP_CHAIN_ID

Staking, Delegation and Rewards

Delegate stake

terpd tx staking delegate $TERP_VALOPER_ADDRESS 1000000uterp --from=$WALLET --chain-id=$TERP_CHAIN_ID --gas=auto

Redelegate stake from validator to another validator

terpd tx staking redelegate <srcValidatorAddress> <destValidatorAddress> 1000000uterp --from=$WALLET --chain-id=$TERP_CHAIN_ID --gas=auto

Withdraw all rewards

terpd tx distribution withdraw-all-rewards --from=$WALLET --chain-id=$TERP_CHAIN_ID --gas=auto

Withdraw rewards with commision

terpd tx distribution withdraw-rewards $TERP_VALOPER_ADDRESS --from=$WALLET --commission --chain-id=$TERP_CHAIN_ID

Validator management

Edit validator

terpd tx staking edit-validator \
  --moniker=$NODENAME \
  --identity=<your_keybase_id> \
  --website="<your_website>" \
  --details="<your_validator_description>" \
  --chain-id=$TERP_CHAIN_ID \
  --from=$WALLET

Unjail validator

bcnad tx slashing unjail \
  --broadcast-mode=block \
  --from=$WALLET \
  --chain-id=$TERP_CHAIN_ID \
  --gas=auto

RPC

https://mainnet-terp-rpc.konsortech.xyz

API

https://mainnet-terp-api.konsortech.xyz

Peers

6f3677c65945ddb6946cbdaa6ec74b4cfec737f8@mainnet-terp.konsortech.xyz:37656

State Sync

sudo systemctl stop terpd

cp $HOME/.terp/data/priv_validator_state.json $HOME/.terp/priv_validator_state.json.backup
terpd tendermint unsafe-reset-all --home $HOME/.terp --keep-addr-book

SNAP_RPC="https://mainnet-terp-rpc.konsortech.xyz:443"

LATEST_HEIGHT=$(curl -s $SNAP_RPC/block | jq -r .result.block.header.height); \
BLOCK_HEIGHT=$((LATEST_HEIGHT - 2000)); \
TRUST_HASH=$(curl -s "$SNAP_RPC/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash)

echo $LATEST_HEIGHT $BLOCK_HEIGHT $TRUST_HASH

peers="6f3677c65945ddb6946cbdaa6ec74b4cfec737f8@mainnet-terp.konsortech.xyz:37656"
sed -i 's|^persistent_peers *=.*|persistent_peers = "'$peers'"|' $HOME/.terp/config/config.toml

sed -i -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ; \
s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"$SNAP_RPC,$SNAP_RPC\"| ; \
s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \
s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"|" $HOME/.terp/config/config.toml

mv $HOME/.terp/priv_validator_state.json.backup $HOME/.terp/data/priv_validator_state.json

sudo systemctl restart terpd
sudo journalctl -u terpd -f --no-hostname -o cat