Mainnet

Selfchain

Installation Guide
Node CLI
Public Endpoint
State Sync
Snapshot
Custom Explorers
Decentralization Maps
Installation Guide
Installation Guide
Node CLI
Public Endpoint
State Sync
Snapshot
Custom Explorers
Decentralization Maps

How To Install Full Node Selfchain Mainnet

Setting up vars

Your Nodename (validator) that will shows in explorer

NODENAME=<Your_Nodename_Moniker>

Save variables to system

echo "export NODENAME=$NODENAME" >> $HOME/.bash_profile
if [ ! $WALLET ]; then
    echo "export WALLET=wallet" >> $HOME/.bash_profile
fi
echo "export SELFCHAIN_CHAIN_ID=self-1" >> $HOME/.bash_profile
source $HOME/.bash_profile

Update packages

sudo apt update && sudo apt upgrade -y

Install dependencies

sudo apt install curl build-essential git wget jq make gcc tmux net-tools ccze -y

Install go

if ! [ -x "$(command -v go)" ]; then
  ver="1.22.4"
  cd $HOME
  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" >> ~/.bash_profile
  source ~/.bash_profile
fi

Download and build binaries

cd $HOME
wget https://github.com/hotcrosscom/Self-Chain-Releases/releases/download/mainnet-v1.0.1/selfchaind-linux-amd64
chmod +x selfchaind-linux-amd64
mv selfchaind-linux-amd64 /root/go/bin/selfchaind

Init app

selfchaind init $NODENAME --chain-id $SELFCHAIN_CHAIN_ID

Download configuration

cd $HOME
wget -O $HOME/.selfchain/config/genesis.json https://snap2.konsortech.xyz/selfchain/genesis.json
wget -O $HOME/.selfchain/config/addrbook.json https://snap2.konsortech.xyz/selfchain/addrbook.json

Disable indexing

indexer="null"
sed -i -e "s/^indexer *=.*/indexer = \"$indexer\"/" $HOME/.selfchain/config/config.toml

Config pruning

sed -i 's|pruning = "default"|pruning = "custom"|g' $HOME/.selfchain/config/app.toml
sed -i 's|pruning-keep-recent = "0"|pruning-keep-recent = "100"|g' $HOME/.selfchain/config/app.toml
sed -i 's|pruning-interval = "0"|pruning-interval = "19"|g' $HOME/.selfchain/config/app.toml

Set minimum gas price

sed -i 's|minimum-gas-prices =.*|minimum-gas-prices = "0.005uslf"|g' $HOME/.selfchain/config/app.toml

Create service

sudo tee /etc/systemd/system/selfchaind.service > /dev/null << EOF
[Unit]
Description=Selfchain Node
After=network-online.target
[Service]
User=$USER
ExecStart=$(which selfchaind) start
Restart=on-failure
RestartSec=10
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF

Register and start service

sudo systemctl daemon-reload
sudo systemctl enable selfchaind
sudo systemctl restart selfchaind && sudo journalctl -u selfchaind -f -o cat

Guide for Validator CLI

Create wallet

To create new wallet you can use command below. Don’t forget to save the mnemonic

seflchaind keys add $WALLET

To recover your wallet using seed phrase

seflchaind keys add $WALLET --recover

Show your wallet list

seflchaind keys list

Save wallet info

Add wallet and validator address into variables

SELFCHAIN_WALLET_ADDRESS=$(seflchaind keys show $WALLET -a)
SELFCHAIN_VALOPER_ADDRESS=$(seflchaind keys show $WALLET --bech val -a)
echo 'export SELFCHAIN_WALLET_ADDRESS='${SELFCHAIN_WALLET_ADDRESS} >> $HOME/.bash_profile
echo 'export SELFCHAIN_VALOPER_ADDRESS='${SELFCHAIN_VALOPER_ADDRESS} >> $HOME/.bash_profile
source $HOME/.bash_profile

Create validator

check your wallet balance:

seflchaind query bank balances $SELFCHAIN_WALLET_ADDRESS

To create your validator run command below

selfchaind tx staking create-validator \
  --amount 1000000uself \
  --from $WALLET \
  --commission-max-change-rate "0.01" \
  --commission-max-rate "0.2" \
  --commission-rate "0.1" \
  --min-self-delegation "1" \
  --pubkey  $(selfchaind tendermint show-validator) \
  --moniker $NODENAME \
  --chain-id $SELF_CHAIN_ID
  --gas-adjustment 1.4 \
  --gas auto \
  --gas-prices 0.005uslf

Check your validator key

[[ $(seflchaind q staking validator $SELFCHAIN_VALOPER_ADDRESS -oj | jq -r .consensus_pubkey.key) = $(seflchaind status | jq -r .validator_info.PubKey.value) ]] && echo -e "\n\e[1m\e[32mTrue\e[0m\n" || echo -e "\n\e[1m\e[31mFalse\e[0m\n"

Get list of validators

seflchaind q staking validators -oj --limit=3000 | jq '.validators[] | select(.status=="BOND_STATUS_BONDED")' | jq -r '(.tokens|tonumber/pow(10; 6)|floor|tostring) + " \t " + .description.moniker' | sort -gr | nl

Usefull commands

Service management

Check logs

journalctl -fu seflchaind -o cat

Start service

sudo systemctl start seflchaind

Stop service

sudo systemctl stop seflchaind

Restart service

sudo systemctl restart seflchaind

Node info

Synchronization info

seflchaind status 2>&1 | jq .sync_info

Validator info

seflchaind status 2>&1 | jq .validator_info

Node info

seflchaind status 2>&1 | jq .node_info

Show node id

seflchaind tendermint show-node-id

Wallet operations

List of wallets

seflchaind keys list

Recover wallet

seflchaind keys add $WALLET --recover

Delete wallet

seflchaind keys delete $WALLET

Get wallet balance

seflchaind query bank balances $SELFCHAIN_WALLET_ADDRESS

Transfer funds

seflchaind tx bank send $SELFCHAIN_WALLET_ADDRESS <TO_SELFCHAIN_WALLET_ADDRESS> 1000000uself

Voting

seflchaind tx gov vote 1 yes --from $WALLET --chain-id=$SELFCHAIN_CHAIN_ID

Staking, Delegation and Rewards

Delegate stake

seflchaind tx staking delegate $SELFCHAIN_VALOPER_ADDRESS 1000000uself --from=$WALLET --chain-id=$SELFCHAIN_CHAIN_ID --gas=auto

Redelegate stake from validator to another validator

seflchaind tx staking redelegate <srcValidatorAddress> <destValidatorAddress> 1000000uself --from=$WALLET --chain-id=$SELFCHAIN_CHAIN_ID --gas=auto

Withdraw all rewards

seflchaind tx distribution withdraw-all-rewards --from=$WALLET --chain-id=$SELFCHAIN_CHAIN_ID --gas=auto

Withdraw rewards with commision

seflchaind tx distribution withdraw-rewards $SELFCHAIN_VALOPER_ADDRESS --from=$WALLET --commission --chain-id=$SELFCHAIN_CHAIN_ID

Validator management

Edit validator

seflchaind tx staking edit-validator \
  --moniker=$NODENAME \
  --identity=<your_keybase_id> \
  --website="<your_website>" \
  --details="<your_validator_description>" \
  --chain-id=$SELFCHAIN_CHAIN_ID \
  --from=$WALLET

Unjail validator

seflchaind tx slashing unjail \
  --broadcast-mode=block \
  --from=$WALLET \
  --chain-id=$SELFCHAIN_CHAIN_ID \
  --gas=auto

Public Endpoints

RPC

https://mainnet-selfchain-rpc.konsortech.xyz

API

https://mainnet-selfchain-api.konsortech.xyz

gRPC

mainnet-selfchain.konsortech.xyz:12090

Persistence Peers

9eb343010b328fab1f955f5e18f62032a23afa50@mainnet-selfchain.konsortech.xyz:12656

Seeds

0afb5b4e9deddfb6f9143044fb1751d9e5aaff34@mainnet-seed.konsortech.xyz:12165

Mirroring Genesis

https://snap2.konsortech.xyz/selfchain/genesis.json

Address Book

https://snap2.konsortech.xyz/selfchain/addrbook.json

State Sync

sudo systemctl stop selfchaind

cp $HOME/.selfchain/data/priv_validator_state.json $HOME/.selfchain/priv_validator_state.json.backup
selfchaind tendermint unsafe-reset-all --home $HOME/.selfchain --keep-addr-book

SNAP_RPC="https://mainnet-selfchain-rpc.konsortech.xyz:443"

LATEST_HEIGHT=$(curl -s $SNAP_RPC/block | jq -r .result.block.header.height); \
BLOCK_HEIGHT=$((LATEST_HEIGHT - 1000)); \
TRUST_HASH=$(curl -s "$SNAP_RPC/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash)

echo $LATEST_HEIGHT $BLOCK_HEIGHT $TRUST_HASH

peers="9eb343010b328fab1f955f5e18f62032a23afa50@mainnet-selfchain.konsortech.xyz:12656"
sed -i 's|^persistent_peers *=.*|persistent_peers = "'$peers'"|' $HOME/.selfchain/config/config.toml

sed -i -E "s|^(enable[[:space:]]+=[[:space:]]+).*$|\1true| ; \
s|^(rpc_servers[[:space:]]+=[[:space:]]+).*$|\1\"$SNAP_RPC,$SNAP_RPC\"| ; \
s|^(trust_height[[:space:]]+=[[:space:]]+).*$|\1$BLOCK_HEIGHT| ; \
s|^(trust_hash[[:space:]]+=[[:space:]]+).*$|\1\"$TRUST_HASH\"|" $HOME/.selfchain/config/config.toml

mv $HOME/.selfchain/priv_validator_state.json.backup $HOME/.selfchain/data/priv_validator_state.json

sudo systemctl restart selfchaind
sudo journalctl -u selfchaind -f --no-hostname -o cat

Snapshot

sudo systemctl stop selfchaind
cp $HOME/.selfchain/data/priv_validator_state.json $HOME/.selfchain/priv_validator_state.json.backup
rm -rf $HOME/.selfchain/data

SNAP_NAME=$(curl -s https://snap1.konsortech.xyz/selfchain/ | egrep -o ">selfchain-snapshot.*\.tar.lz4" | tr -d ">")
curl https://snap2.konsortech.xyz/selfchain/${SNAP_NAME} | lz4 -dc - | tar -xf - -C $HOME/.selfchain
mv $HOME/.selfchain/priv_validator_state.json.backup $HOME/.selfchain/data/priv_validator_state.json

sudo systemctl restart selfchaind && journalctl -u selfchaind -f --no-hostname -o cat
Embed Iframe

Selfchain Mainnet Decentralization Maps