Skip to main content

Joining Testnet

This tutorial will provide all necessary instructions for joining the current public testnet. If you're interested in more advanced configuration and synchronization options, see Join Mainnet for a detailed walkthrough.

  • Version: v1.0.3
  • Chain ID: gotabit-test-1

How to Join

Build Tools

The following set of instructions assumes you are logged in as root.

  • You can run the relevant commands from a sudoer account.
  • The /root/ part in service file paths can be changed to /home/<user_name>/.

Install build tools and Go.

sudo apt-get update
sudo apt-get install -y make gcc
wget https://go.dev/dl/go1.18.5.linux-amd64.tar.gz
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.18.5.linux-amd64.tar.gz
export PATH=$PATH:/usr/local/go/bin

Installation & Configuration

You will need to install and configure the GotaBit binary using the script below. The GotabIT Hub Public Testnet is running GotaBit

Build the gotabitd binary and initialize the chain home folder.

cd $HOME
git clone https://github.com/gotabit/gotabit
cd gotabit
git checkout main
make install
gotabitd init <custom_moniker>

Prepare the genesis file.

cd $HOME
wget https://github.com/gotabit/testnets/raw/master/public/genesis.json.gz
gzip -d genesis.json.gz
mv genesis.json $HOME/.gotabit/config/genesis.json

# Set minimum gas price & peers
cd $HOME/.gotabit/config
sed -i 's/minimum-gas-prices = ""/minimum-gas-prices = "0.0025ugtb"/' app.toml
sed -i 's/seeds = ""/seeds = "639d50339d7045436c756a042906b9a69970913f@seed-01.testnet.gotabit.dev:26656"/' config.toml

State sync requires you to configure a trust height and trust hash. These depend on the current block height, so they will vary depending on when you are joining the network.

  • Visit a testnet explorer to find the block and hash for the current height - 1000.
  • Set these parameters in the code snippet below: <BLOCK_HEIGHT> and <BLOCK_HASH>.
cd $HOME/.gotabit/config
sed -i 's/enable = false/enable = true/' config.toml
sed -i 's/trust_height = 0/trust_height = <BLOCK_HEIGHT>/' config.toml
sed -i 's/trust_hash = ""/trust_hash = "<BLOCK_HASH>"/' config.toml
sed -i 's/rpc_servers = ""/rpc_servers = "https:\/\/rpc-testnet.gotabit.dev"/' config.toml

Start the Service

systemctl enable gotabitd.service
systemctl start gotabitd.service

To follow the service log, run journalctl -fu gotabitd

  • If you are using State Sync, the chain will start syncing once a snapshot is found and verified. Syncing to the current block height should take less than half an hour.
  • If you are using Fast Sync, the chain will start syncing once the first block after genesis is found among the peers. Syncing to the current block height will take several days.

Create a Validator (Optional)

If you want to create a validator in the testnet, request tokens through the faucet and follow the Running a validator instructions provided for mainnet.

Upgrading Your Node

Follow these instructions if you have a node that is already synced and wish to participate in a scheduled testnet software upgrade.

When the chain reaches the upgrade block height specified by a software upgrade proposal, the chain binary will halt and expect the new binary to be run (the system log will show ERR UPGRADE "<Upgrade name>" NEEDED at height: XXXX or something similar).

  • Stop the gotabitd service with systemctl stop gotabitd.service
  • Build or download the new binary, replacing the existing ~/go/bin one
  • Start the gotabitd service with systemctl start gotabitd.service