Installation

Selfchain Testnet v2

Installation

// Download binaries
wget "https://1501792788-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcIZFCZY4EPKDYaPcDZLG%2Fuploads%2FjZ2W5fQRc1EfLuI6Sbe4%2Fselfchaind-linux-amd64?alt=media&token=a3023826-ab65-405f-8112-cf696d1be00d" -O selfchaind-linux-amd64
// change permission
chmod +x selfchaind-linux-amd64
// init (change moniker to your own)
./selfchaind-linux-amd64 init moniker
// download genesis file
curl -Ls https://green.codeblocklabs.com/testnet/selfchain-v2/genesis.json > $HOME/.selfchain/config/genesis.json
// set persistent peers
PEERS="[email protected]:22056,[email protected]:11556,[email protected]:3056,[email protected]:11556,[email protected]:11556,[email protected]:11556,[email protected]:11556,[email protected]:11556,[email protected]:11556,[email protected]:11556,[email protected]:11556,[email protected]:26656,[email protected]:11556,[email protected]:56656,[email protected]:11556,[email protected]:11556,[email protected]:11556,[email protected]:11556,[email protected]:11556,[email protected]:11556,[email protected]:11556,[email protected]:11556,[email protected]:11556,[email protected]:11556,[email protected]:11556,[email protected]:11556,[email protected]:11556,[email protected]:11456,[email protected]:11556,[email protected]:11556,[email protected]:11556,[email protected]:11556,[email protected]:43656,[email protected]:3056,[email protected]:11556,[email protected]:11556,[email protected]:31056,[email protected]:13656,[email protected]:26657,[email protected]:13656,[email protected]:22056,[email protected]:19656,[email protected]:3056,[email protected]:26656,[email protected]:3056,[email protected]:31056,[email protected]:11356,[email protected]:3056,[email protected]:11556,[email protected]:27656,[email protected]:26656,[email protected]:26656"
sed -i -e "s|^persistent_peers *=.*|persistent_peers = \"$PEERS\"|" $HOME/.selfchain/config/config.toml
// run the binary
./selfchaind-linux-amd64 start 
// Download the v2.0.0 version
wget "https://green.codeblocklabs.com/testnet/selfchain-v2/selfchaind" -O selfchaind
// change permission
chmod +x selfchaind
// open new screen
screen -S selfchain
// run the v2.0.0 binary
nohup ./selfchaind > selfchain.log 2>&1 &
// Only if you need to download the Addrbook, use command below:

curl -Ls https://green.codeblocklabs.com/testnet/selfchain-v2/addrbook.json $HOME/.selfchain/config/addrbook.json

When the nodes already synced and everything's good, request faucet on selfchain discord and create validator.


Setting Up Services

// Create bin folder
mkdir ~/bin
// Copy binary
cp selfchaind ~/bin/
// Change permission
chmod +x ~/bin/selfchaind
// add to path
export PATH="$PATH:/home/username/location_to_bin_folder"
// reload shell configuration
source ~/.bashrc
// test
./selfchaind version --long

If test was success, you can now create the services configuration file.

# Set Service file
sudo tee /etc/systemd/system/selfchaind.service > /dev/null <<EOF
[Unit]
Description=selfchain mainnet node
After=network-online.target
[Service]
User=$USER
ExecStart=$(which selfchaind) start
Restart=always
RestartSec=3
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload
sudo systemctl enable selfchaind
// Start the nodes on services
sudo systemctl restart selfchaind && sudo journalctl -fu selfchaind -o cat

Last updated