Guides/Tutorials
July 26, 2022

Teritori testnet

The multichain hub for Web3 tribes on Cosmos SDK & GNØ Land

You can say thank you by using my discord invite link to join Teritori discord.
My video tutorial of setting up a validator: Youtube.

Prepare the server:

# Make sure your machine is up to date:
apt update && apt upgrade -y 

# Install dependencies
sudo apt install curl build-essential git wget jq make gcc tmux htop nvme-cli pkg-config libssl-dev libleveldb-dev tar clang bsdmainutils ncdu unzip libleveldb-dev -y

# Install GO 1.18+:
wget -c https://go.dev/dl/go1.18.3.linux-amd64.tar.gz && rm -rf /usr/local/go && tar -C /usr/local -xzf go1.18.3.linux-amd64.tar.gz && rm -rf go1.18.3.linux-amd64.tar.gz

Setup your environnement (you can skip this part if you already had go installed before):

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 && . $HOME/.bash_profile

Verify the installation:

go version
# Should return go version go1.18.3 linux/amd64

Setup the chain:

Clone the Teritori repository and install the v2 of testnet:

git clone https://github.com/TERITORI/teritori-chain && cd teritori-chain
git checkout teritori-testnet-v2
make install

Verify the installation:

teritorid version
# Should return  <version> - <commit>

Continue:

Init the chain:

# REPLACE <YOUR_MONIKER> and delete the <> signs
teritorid init <YOUR_MONIKER> --chain-id teritori-testnet-v2

Download the genesis file:

wget -O $HOME/.teritorid/config/genesis.json "https://raw.githubusercontent.com/TERITORI/teritori-chain/teritori-testnet-v2/genesis/genesis.json"
# Check the genesis file
sha256sum ~/.teritorid/config/genesis.json
# b9d9f4abcac2bb8153d19df36fcde2ec09b61baa2243cc512b37baa38194a09d

Update node configuration:

# Save the variable in config, so we dont need to use chain-id flag for every CLI command in config.toml
teritorid config chain-id teritori-testnet-v2

# Add peers in the config file:
sed -i.bak 's/persistent_peers =.*/persistent_peers = "[email protected]:26656,[email protected]:26656,[email protected]:26656"/' $HOME/.teritorid/config/config.toml

# Clear the seeds
seeds="" sed -i.bak -e "s/^seeds =.*/seeds = \"$seeds\"/" $HOME/.teritorid/config/config.toml

# Downlaod the addrbook
rm $HOME/.teritorid/config/addrbook.json
wget -O $HOME/.teritorid/config/addrbook.json https://raw.githubusercontent.com/StakeTake/guidecosmos/main/teritori/teritori-testnet-v2/addrbook.json

Systemctl:

Create service file:

sudo tee /etc/systemd/system/teritorid.service > /dev/null <<EOF
[Unit]
Description=teritorid
After=network-online.target

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

[Install]
WantedBy=multi-user.target
EOF

Enable and launch the service file:

systemctl enable teritorid
systemctl daemon-reload
systemctl restart teritorid

Setup the logs:

journalctl -u teritorid.service -f -o cat

Check the latest block height and node status:

teritorid status 2>&1 | jq ."SyncInfo"."latest_block_height"

curl localhost:26657/status

Create the wallet:

# Create new one
teritorid keys add <name_wallet> --keyring-backend os

# Recover existing
teritorid keys add <name_wallet> --recover --keyring-backend os

# REPLACE <name_wallet> with your wallet name and delete the <> signs

SAVE THE MNEMONIC PHRASE

Use the faucet in Teritori discord in the #faucet channel:

$request <your address>
# Replace <your address> with your actual address
# and delete the <> signs

Creating a validator:

Before creating a validator wait for the node to fully sync, you can check your sync status with this command:

curl localhost:26657/status | grep catching_up

Or by checking the latest block on the explorer and your node latest block height:

teritorid status 2>&1 | jq ."SyncInfo"."latest_block_height"

Create the validator:

teritorid tx staking create-validator \
 --commission-max-change-rate=0.01 \
 --commission-max-rate=0.2 \
 --commission-rate=0.05 \
 --amount 1000000utori \
 --pubkey=$(teritorid tendermint show-validator) \
 --moniker=<YOUR_MONIKER> \
 --chain-id=teritori-testnet-v2 \
 --min-self-delegation=1000000 \
 --from=<YOUR_KEY>
 --fees 500utori  

Here's a command for more advanced users (it icnludes all the possible variables, so you can remove the ones you're not going to change):

teritorid tx staking create-validator \
 --chain-id teritori-testnet-v2 \
 --commission-rate=0.1 \
 --commission-max-rate=0.1 \
 --commission-max-change-rate=0.01 \
 --amount=1000000utori \
 --pubkey $(teritorid tendermint show-validator) \
 --moniker "name_moniker" \
 --details "text optional" \
 --security-contact "email" \
 --website="https://" \
 --identity A0B46500B5712345 \
 --min-self-delegation "1000000" \
 --from name_wallet \
 --fees 500utori 

If you want to edit your validator, just change

create-validator

to

edit-validator

and include the variables you want to change.

Check your validator in the explorer:

ttimmatti - Teritori

Thank you and good luck!