Source Chain Testnet Setup

Instructions for building sourced binary and connecting to the Source Chain Testnet.

Current Testnet

***At this time, Source Chain is in a testing phase and provides a Public Testnet. The Testnet can be utilized to deploy Nodes, Validator Nodes and to deploy and test Smart Contracts.
Below is the list of Source Chain testnets and their current status. You will need to know the version tag for installation of the sourced binary.
For details of upgrades on the current testnet, as well as syncing, you can check out the testnets repo.
If you get stuck, please ask on Discord.
Current Github version tag

Minimum Hardware Requirements

The minimum recommended hardware requirements for running a validator for the Source Chain testnets are:
  • 16GB RAM
  • 200GB of disk space
  • 2 Cores (modern CPU's)
These specifications are the minimum recommended. As Source Chain is a smart contract platform, it can at times be very demanding on hardware. Low spec validators WILL get stuck on difficult to process blocks.
Note that the testnets accumulate data as the blockchain continues. This means that you will need to expand your storage as the blockchain database gets larger with time.

Choose an Operating System

The operating system you use for your node is entirely your personal preference. You will be able to compile the sourced daemon on most modern linux distributions and recent versions of macOS.
For the tutorial, it is assumed that you are using an Ubuntu LTS release.
If you have chosen a different operating system, you will need to modify your commands to suit your operating system.

Install pre-requisites

# update the local package list and install any available upgrades
sudo apt-get update && sudo apt upgrade -y
# install toolchain and ensure accurate time synchronization
sudo apt-get install make build-essential gcc git jq chrony -y

Install Go

Follow the instructions here to install Go.
For an Ubuntu LTS, you can probably use:
sudo tar -C /usr/local -xzf go1.18.2.linux-amd64.tar.gz
Please install Go v1.18 or later.
Unless you want to configure in a non standard way, then set these in the .profile in the user's home (i.e. ~/) folder.
nano ~/.profile
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export GO111MODULE=on
export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin
After updating your ~/.profile you will need to source it:
source ~/.profile

Install Ignite Cli

Follow the instructions here to install Ignite CLI. (Ignite CLI can also be used in an online Gitpod container here)
sudo curl! | sudo bash

Clone Source Chain Repo

git clone -b testnet

Compile sourced binary

cd ~/source
ignite chain build

Initialize the Source directories and create the local genesis file with the correct chain-id:

sourced init <moniker-name> --chain-id=sourcechain-testnet

Create a local key pair (or add existing key):

# Create new keypair
sourced keys add <key-name>
# Restore existing source wallet with mnemonic seed phrase.
# You will be prompted to enter mnemonic seed.
sourced keys add <key-name> --recover
# Query the keystore for your public address
sourced keys show <key-name> -a
Replace <key-name> with a key name of your choosing.
After creating a new key, the key information and seed phrase will be shown. It is essential to write this seed phrase down and keep it in a safe place. The seed phrase is the only way to restore your keys.

Download Genesis File

curl -s > ~/.source/config/genesis.json

Genesis sha256

sha256sum ~/.source/config/genesis.json
This should return:
# 2bf556b50a2094f252e0aac75c8018a9d6c0a77ba64ce39811945087f6a5165d

Seed nodes to add to config.toml

nano ~/.source/config/config.toml
Find the appropriate section and add:
# Comma separated list of nodes to keep persistent connections to persistent_peers =

Set Minimum Gas Price

nano ~/.source/config/app.toml

Start the chain

sourced start
It will take some time to catch up and sync to the network. Check your status with:
sourced status

Running in production

Create a systemd file for your Source service:
sudo nano /etc/systemd/system/sourced.service
Copy and paste the following and update:
Description=Source daemon
ExecStart=/home/<YOUR-USERNAME>/go/bin/sourced start --home /home/<YOUR-USERNAME>/.source
This assumes $HOME/.source to be your directory for config and data. Your actual directory locations may vary.
Enable and start the new service:
sudo systemctl enable sourced
sudo systemctl start sourced
Check status:
sourced status
Check logs:
journalctl -u sourced -f

Get some testnet tokens

Testnet tokens can be requested from the #faucet channel on Discord.
To request tokens type $request <your-public-address> in the message field and press enter.

Setup cosmovisor

Follow these instructions to setup cosmovisor and start the node.

Upgrade to a validator

To upgrade the node to a validator, you will need to submit a create-validator transaction:
sourced tx staking create-validator \
--amount 1000000000usource \
--commission-max-change-rate "0.1" \
--commission-max-rate "0.20" \
--commission-rate "0.1" \
--min-self-delegation "1" \
--details "validators write bios too" \
--pubkey=$(sourced tendermint show-validator) \
--chain-id sourcechain-testnet \
--gas-prices 0.025usource \
--from <key-name>

Backup critical files

There are certain files that you need to backup to be able to restore your validator if, for some reason, it damaged or lost in some way. Please make a secure backup of the following files located in ~/.source/config/:
  • priv_validator_key.json
  • node_key.json
It is recommended that you encrypt the backup of these files.