Gitopia – Testnet – Node Deployment Guide

Chain: gitopia-janus-testnet-2

This guide is outdated.

System requirements: 4 CPU, 16GB RAM, 1TB SSD

Update server:

sudo apt update && sudo apt upgrade -y

Install additional packages:

sudo apt install make clang git pkg-config libssl-dev build-essential git gcc chrony curl jq ncdu bsdmainutils htop net-tools lsof fail2ban wget -y

Install GO and check version:

ver="1.19.1" && \
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 version

Clone repository and build binary:

cd $HOME && rm -rf gitopia
git clone -b v1.2.0 gitopia://gitopia/gitopia && cd gitopia
make install

Move binary:

chmod +x /root/go/bin/gitopiad && sudo mv /root/go/bin/gitopiad /usr/local/bin/gitopiad 
cd $HOME

Set variables (choose your node and wallet name):

GITOPIA_CHAIN="gitopia-janus-testnet-2"
GITOPIA_MONIKER="your_node_name"
GITOPIA_WALLET="your_wallet_name"

Add variables to bash profile:

echo 'export GITOPIA_CHAIN='${GITOPIA_CHAIN} >> $HOME/.bash_profile
echo 'export GITOPIA_MONIKER='${GITOPIA_MONIKER} >> $HOME/.bash_profile
echo 'export GITOPIA_WALLET='${GITOPIA_WALLET} >> $HOME/.bash_profile
source $HOME/.bash_profile

Initialize the node:

gitopiad init $GITOPIA_MONIKER --chain-id=$GITOPIA_CHAIN

Set chain id in the config:

gitopiad config chain-id $GITOPIA_CHAIN

Download genesis and address book:

wget -O $HOME/.gitopia/config/addrbook.json "http://65.108.6.45:8000/gitopia/addrbook.json"
wget https://server.gitopia.com/raw/gitopia/testnets/master/gitopia-janus-testnet-2/genesis.json.gz
gunzip genesis.json.gz
mv genesis.json $HOME/.gitopia/config/genesis.json

Set up pruning (optionally):

pruning="custom"
pruning_keep_recent="100"
pruning_keep_every="0"
pruning_interval="50"
sed -i -e "s/^pruning *=.*/pruning = \"$pruning\"/" $HOME/.gitopia/config/app.toml
sed -i -e "s/^pruning-keep-recent *=.*/pruning-keep-recent = \"$pruning_keep_recent\"/" $HOME/.gitopia/config/app.toml
sed -i -e "s/^pruning-keep-every *=.*/pruning-keep-every = \"$pruning_keep_every\"/" $HOME/.gitopia/config/app.toml
sed -i -e "s/^pruning-interval *=.*/pruning-interval = \"$pruning_interval\"/" $HOME/.gitopia/config/app.toml

Turn off indexer (optionally):

indexer="null"
sed -i -e "s/^indexer *=.*/indexer = \"$indexer\"/" $HOME/.gitopia/config/config.toml

Add seeds and peers:

SEEDS="[email protected]:26656"
PEERS="[email protected]:26656,[email protected]:11356,[email protected]:11356,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:19656,[email protected]:46656,[email protected]:26656,[email protected]:26656,[email protected]:29686,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:7040,[email protected]:656,[email protected]:7040,[email protected]:7040,[email protected]:7070,[email protected]:26878,[email protected]:27956,[email protected]:31656,[email protected]:37656,[email protected]:36656,[email protected]:27001,[email protected]:26656,[email protected]:36656,[email protected]:24656,[email protected]:36656,[email protected]:60756,[email protected]:17656,[email protected]:12656,[email protected]:46656,[email protected]:11156,[email protected]:41656,[email protected]:16656,[email protected]:35656,[email protected]:26656,[email protected]:34656,[email protected]:34656,[email protected]:26656,[email protected]:26656,[email protected]:34656,[email protected]:15656,[email protected]:28656,[email protected]:26656,[email protected]:16656,[email protected]:26656,[email protected]:22656,[email protected]:26676,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:19656,[email protected]:41656,[email protected]:11056,[email protected]:26656,[email protected]:13656,[email protected]:26656,[email protected]:26656,[email protected]:29656,[email protected]:60756,[email protected]:33656,[email protected]:60756,[email protected]:26656,[email protected]:60756,[email protected]:56656,[email protected]:26656,[email protected]:38816,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:36656,[email protected]:41656,[email protected]:32656,[email protected]:41656,[email protected]:41656,[email protected]:26656,[email protected]:26556,[email protected]:13656,[email protected]:22656,[email protected]:46656,[email protected]:30656,[email protected]:26858,[email protected]:41656,[email protected]:26256,[email protected]:26656,[email protected]:26656,[email protected]:30656,[email protected]:26156,[email protected]:26656,[email protected]:56656,[email protected]:36656,[email protected]:26656,[email protected]:26656,[email protected]:56656,[email protected]:656,[email protected]:28656,[email protected]:51656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:15609,[email protected]:41656,[email protected]:44256,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:40656,[email protected]:26656,[email protected]:26656,[email protected]:6656,[email protected]:11656,[email protected]:656,[email protected]:26656,[email protected]:41656,[email protected]:16656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:41656,[email protected]:41656,[email protected]:41656,[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:36656,[email protected]:26656,[email protected]:26656,[email protected]:26656"
sed -i -e "s/^seeds *=.*/seeds = \"$SEEDS\"/; s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.gitopia/config/config.toml

Set minimum gas price:

sed -i -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0utlore\"/" $HOME/.gitopia/config/app.toml

Create service:

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

[Service]
User=$USER
ExecStart=$(which gitopiad) start --home $HOME/.gitopia
Restart=on-failure
RestartSec=10
LimitNOFILE=65535

[Install]
WantedBy=multi-user.target
EOF

Start service:

sudo systemctl daemon-reload
sudo systemctl enable gitopiad
sudo systemctl restart gitopiad

Check logs (node should start syncing):

sudo journalctl -u gitopiad -f -o cat

Check status (wait catching_up: false):

curl localhost:26657/status

Create new wallet (save mnemonic in a safe place):

gitopiad keys add $GITOPIA_WALLET

Recover old wallet (if exists):

gitopiad keys add $GITOPIA_WALLET --recover

Add address to bash profile:

GITOPIA_ADDR=$(gitopiad keys show $GITOPIA_WALLET -a)
echo 'export GITOPIA_ADDR='${GITOPIA_ADDR} >> $HOME/.bash_profile
source $HOME/.bash_profile

Ask tokens from faucet and check balance:

gitopiad query bank balances $GITOPIA_ADDR

Create validator:

gitopiad tx staking create-validator \
  --amount 1000000utlore \
  --from $GITOPIA_WALLET \
  --commission-max-change-rate "0.05" \
  --commission-max-rate "0.2" \
  --commission-rate "0.1" \
  --min-self-delegation "1" \
  --pubkey  $(gitopiad tendermint show-validator) \
  --moniker $GITOPIA_MONIKER \
  --chain-id $GITOPIA_CHAIN

Add validator address to bash profile:

GITOPIA_VALOPER=$(gitopiad keys show $GITOPIA_WALLET --bech val -a)
echo 'export GITOPIA_VALOPER='${GITOPIA_VALOPER} >> $HOME/.bash_profile
source $HOME/.bash_profile

Check validator status:

gitopiad query staking validator $GITOPIA_VALOPER

How to delegate your tokens to validator (leave some or commissions):

gitopiad tx staking delegate $GITOPIA_VALOPER 1000000utlore --from $GITOPIA_WALLET

How to unjail your validator:

gitopiad tx slashing unjail --from $GITOPIA_WALLET

How to remove node:

sudo systemctl stop gitopiad
sudo systemctl disable gitopiad
cd $HOME
rm /etc/systemd/system/gitopiad.service
rm /usr/local/bin/gitopiad
rm -r gitopia/
rm -r .gitopia/

Share post: