Guide to Joining The bitsong-testnet-2

This article will provide a guide for joining BitSong’s second testnet. This guide replaces the previous guide and hopefully makes the process a bit smoother. As always, you can checkout the code over at GitHub, and if you’re a pro at validating you can probably follow along over there and skip to the tldr at the bottom.

Getting Started

First off, you’ll need to setup a server. Having a dedicated server helps ensure that your validator is highly available and doesn’t go offline. BitSong Network uses Tendermint consensus, which selects a leader for each block. If your validator is offline when it gets chosen as a leader, consensus will take longer, and you could even get slashed!

For this guide, we’ll be using a server with the following specifications:

  • Ubuntu 18.04 OS
  • 2 CPUs
  • 4GB RAM
  • 24GB SSD
  • Allow incoming connections on ports 26656
  • Static IP address (Elastic IP for AWS, floating IP for DigitalOcean, etc )

You can get a server with these specifications on most cloud service providers (AWS, DigitalOcean, Google Cloud Platform, Linode, etc).

After logging into your server, we’ll install security updates and the required packages to run BitSong:

Update Ubuntu

sudo apt update
sudo apt upgrade -y

Installs packages necessary to run go

sudo apt install build-essential libleveldb1v5 git unzip -y

Installs go

wget https://dl.google.com/go/go1.12.linux-amd64.tar.gz
sudo tar -xvf go1.12.linux-amd64.tar.gz
sudo mv go /usr/local

Updates environmental variables to include go

cat <<EOF >> ~/.profile
export GOPATH=$HOME/go
export GO111MODULE=on
export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin
EOF

source ~/.profile

To verify that go is installed:

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

Install the Go-BitSong daemon

Next, we’ll install the software needed to run the BitSong blockchain.

Clone the bitsong repository

git clone https://github.com/bitsongofficial/go-bitsong.git

# install binaries
cd go-bitsong
git checkout v0.2.1
make install

To verify the version

bitsongd version --long

# name: go-bitsong
# server_name: bitsongd
# client_name: bitsongcli
# version: 0.2.1
# commit: 1f6a83d03eef1208e58f8a1068ff1afaee16e4a8
# build_tags: netgo,ledger
# go: go version go1.12.7 linux/amd64

Now, we’ll setup the bitsongd software to run the current BitSong testnet:

# Replace <your-moniker> with the publicly viewable name for your validator.
# bitsong-testnet-2 is the name of the current testnet

bitsongd init --chain-id bitsong-testnet-2 <your-moniker>

Note: bitsongd init sets the node-id of your validator. You can see this value by doing bitsongd tendermint show-node-id . The node-id value will become part of your genesis transaction, so if you are planning on submitting a genesis transaction, don’t reset your node-id by doing bitsongd unsafe-reset-all or changing your public IP address.

# Create a wallet for your node. <your-wallet-name> is just a human readable name you can use to remember your wallet. It can be the same or different than your moniker.

bitsongcli keys add <your_wallet_name>

This will spit out your recovery mnemonic. Be sure to back up your mnemonic before proceeding to the next step!

Launching the testnet :rocket:

We will release the genesis file by August 11, 2019 at 18:00 UTC . You can read about the genesis file params here.

Validators can download the genesis file and start their node anytime after the genesis file is released. The chain will be set to launch August 12, 2019 at 15:00 UTC.

To start validating the testnet after the genesis has been released, run the following commands:

# Delete the old genesis  
rm -f ~/.bitsongd/config/genesis.json

# Copy the genesis file to the bitsongd directory  
wget https://raw.githubusercontent.com/bitsongofficial/networks/master/bitsong-testnet-2/genesis.json -P ~/.bitsongd/config

# create a systemd file to run the bitsongd daemon  
# replace <your_user> where necessary  
sudo tee /etc/systemd/system/bitsongd.service > /dev/null <<EOF  
[Unit]  
Description=BitSong Network Daemon  
After=network-online.target

[Service]  
User=<your_user>  
ExecStart=/home/<your_user>/go/bin/bitsongd start --p2p.seeds "f9d91f1f553a945ccb621ea43c49f5fe43a08d0d@88.99.143.175:26656,5550991ceef17818658894d148209f7622b169dd@94.130.14.220:26656"
Restart=always  
RestartSec=3  
LimitNOFILE=4096

[Install]  
WantedBy=multi-user.target  
EOF

Start the node

sudo systemctl enable bitsongd  
sudo systemctl start bitsongd

To check on the status of the node

bitsongcli status  
sudo journalctl -u bitsongd -f

Joining the Testnet Via Faucet

At launch, transactions will not be enabled on bitsong-testnet-2. Transactions should be enabled via governance around August 15rd, 2019 at 18:00 UTC .

To join the BitSong testnet after launch, you can use our Telegram Testnet Wallet.

To get testnet coins:

# Get the address of your wallet  
bitsongcli keys show -a <your_wallet_name>

Go to the Telegram Bot -> Wallet -> Get FAUCET tokens and paste your address

# Confirm that your account is funded 
bitsongcli q account $(bitsongcli keys show -a <your_wallet_name>) --chain-id bitsong-testnet-2

To create a validator:

Set your node to wait for transactions to confirm

bitsongcli config broadcast-mode block

Create the validator, be sure to replace < your-wallet-name > and < your-moniker >

bitsongcli tx staking create-validator \
  --amount=1000000000ubtsg \
  --pubkey=$(bitsongd tendermint show-validator) \
  --moniker=<your-moniker> \
  --commission-rate="0.10" \
  --commission-max-rate="0.20" \
  --commission-max-change-rate="0.01" \
  --min-self-delegation="1" \
  --from=<your-wallet-name>
  --chain-id=bitsong-testnet-2

Confirm that you have voting power (look at the last value in the output. It should show voting power > 0)

bitsongcli status

Summary

  • BitSong testnet 2 has chain-id bitsong-testnet-2
  • The testnet will launch at 2019–08–12 15:00:00 UTC
  • Genesis transactions should be submitted by 2019–08–11 15:00:00 UTC
  • Genesis transactions should be submitted for 10000000000ubtsg
  • Transactions will be turned off at launch and activated via governance proposal.
  • We will be submitting multiple governance proposals during this testnet. You can stay up to date in Discord Validator Chat.
1 Like

Very detailed documentation, thank you.

3 Likes

Thank you @bitcat. Enjoy our new community

1 Like