Code Monkey home page Code Monkey logo

testnets's Introduction

testnets

c11

Source Testnet Set up

Source Testnet is now using "sourcetest-1" and v3.0.0 of the Source Blockchain. "Sourcechain-testnet" has been shutdown.

If you are reusing your testnet box, you must first remove the old data. Validators from the previous testnet will have usource available to start a new node, use your same wallet:

sudo systemctl stop sourced && \
cd $HOME && \
rm -rf .source && \
rm -rf source && \
rm -rf $(which sourced)

For full Source Chain Documentation and testnet set up click: HERE

Minimum hardware requirements

8GB RAM 250GB of disk space 1.4 GHz amd64 CPU

Install Go

Prerequisites: Make sure to have Golang >=1.19.

ver="1.19" && \
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 Source Chain Repo

git clone https://github.com/Source-Protocol-Cosmos/source.git

Compile sourced Binary

cd ~/source
git fetch
git checkout v3.0.1
make build && make install

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

sourced init <moniker-name> --chain-id=sourcetest-1

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

sourced keys add <walletName>
    or
sourced keys add <walletName> --recover

Download Genesis File

curl -s  https://raw.githubusercontent.com/Source-Protocol-Cosmos/testnets/master/sourcetest-1/genesis.json > ~/.source/config/genesis.json

Genesis sha256

sha256sum ~/.source/config/genesis.json
# c8b8e28f1cc2c6bb708d963146842da9e367874267d90ab99a13a6bd736d5682

Seed nodes to add to config.toml

nano ~/.source/config/config.toml
# Comma separated list of nodes to keep persistent connections to persistent_peers = 
"[email protected]:26656,[email protected]:26656"

Set Minimum Gas Price

nano ~/.source/config/app.toml
0.025usource

Setup validator node

Below are the instructions to generate & submit your genesis transaction

Generate genesis transaction (gentx)

  1. Initialize the Source directories and create the local genesis file with the correct chain-id:
sourced init <moniker-name> --chain-id=sourcetest-1
  1. Create a local key pair (skip this step if you already have a key):
sourced keys add <key-name>
  1. Add your account to your local genesis file with a given amount and the key you just created. Use only 10000000000usource, other amounts will be ignored.
sourced add-genesis-account $(sourced keys show <key-name> -a) 10000000000usource
  1. Create the gentx, use only 9000000000usource:
sourced gentx <key-name> 9000000000usource --chain-id=sourcetest-1

If all goes well, you will see a message similar to the following:

Genesis transaction written to "/home/user/.source/config/gentx/gentx-******.json"
  1. Start the chain
sourced start
  1. Create Validator
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) \
--moniker “<key-name>” \
--chain-id sourcetest-1 \
--gas-prices 0.025usource \
--from <key-name>

Submit genesis transaction

  • Fork the testnets repo into your Github account

  • Clone your repo using

    git clone https://github.com/<your-github-username>/testnets
  • Copy the generated gentx json file to <repo_path>/testnets/gentx/

    > cd testnet-genesis
    > cp ~/.source/config/gentx/gentx*.json ./sourcechain-testnet/gentx/
  • Commit and push to your repo

  • Create a PR onto https://github.com/Source-Protocol-Cosmos/testnets

  • Only PRs from individuals / groups with a history successfully running nodes will be accepted. This is to ensure the network successfully starts on time.

Running in production

Note, we'll be going through some upgrades for this testnet. Consider using Cosmovisor to make your life easier.

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
After=network-online.target

[Service]
User=<YOUR_USERNAME>
ExecStart=/home/<YOUR-USERNAME>/go/bin/sourced start --home /home/<YOUR-USERNAME>/.source
Restart=on-failure
RestartSec=3
LimitNOFILE=4096

[Install]
WantedBy=multi-user.target

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

testnets's People

Contributors

sourcenexxus avatar source-protocol-cosmos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.