Home

Selfchain

Modular Intent-Centric Access Layer 1 Blockchain and Keyless Wallet Infrastructure Service That Uses MPC-TSS/AA for Multi-Chain WEB3 Access

RPC API gRPC RPC-EVM WSS-RPC Addressbook Genesis Seed Peer Explorer

Minimum Hardware

NODE CPU RAM SSD OS
selfchaind 4 8 200 GB Ubuntu 22.04 LTS

Install dependencies

sudo apt update && sudo apt upgrade -y
sudo apt install curl git wget htop tmux build-essential jq make lz4 gcc unzip -y

Install Go

cd $HOME
VER="1.21.6"
sudo rm -rf /usr/local/go
curl -Ls https://go.dev/dl/go$VER.linux-amd64.tar.gz | sudo tar -xzf - -C /usr/local
echo "export PATH=$PATH:/usr/local/go/bin:$HOME/go/bin" >> $HOME/.bash_profile
source $HOME/.bash_profile
go version

Set Var

-

Download Binary

cd $HOME
curl -L https://snapshot.sychonix.com/testnet/selfchain/selfchaind.tar.gz | tar -xvzf - -C $HOME
sudo mv selfchaind /usr/local/bin/

Config and Init App

selfchaind init $MONIKER --chain-id selfchain-testnet
sed -i -e "s|^node *=.*|node = \"tcp://localhost:11557\"|" $HOME/.selfchain/config/client.toml
sed -i -e "s|^keyring-backend *=.*|keyring-backend = \"os\"|" $HOME/.selfchain/config/client.toml
sed -i -e "s|^chain-id *=.*|chain-id = \"selfchain-testnet\"|" $HOME/.selfchain/config/client.toml/

Download Genesis and Addrbook

curl -L https://snapshot.sychonix.com/testnet/selfchain/genesis.json > $HOME/.selfchain/config/genesis.json
curl -L https://snapshot.sychonix.com/testnet/selfchain/addrbook.json > $HOME/.selfchain/config/addrbook.json

Seeds and Peers

PEERS="$(curl -sS https://rpc-selfchain-t.sychonix.com/net_info | jq -r '.result.peers[] | "\(.node_info.id)@\(.remote_ip):\(.node_info.listen_addr)"' | awk -F ':' '{print $1":"$(NF)}' | sed -z 's|\n|,|g;s|.$||')"
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/.selfchain/config/config.toml

Custom Ports

sed -i -e "s%:1317%:11517%; s%:8080%:11580%; s%:9090%:11590%; s%:9091%:11591%; s%:8545%:11545%; s%:8546%:11546%; s%:6065%:11565%" $HOME/.selfchain/config/app.toml
sed -i -e "s%:26658%:11558%; s%:26657%:11557%; s%:6060%:11560%; s%:26656%:11556%; s%:26660%:11561%" $HOME/.selfchain/config/config.toml

Pruning, Gas and Prometheus

sed -i \
-e 's|^pruning *=.*|pruning = "custom"|' \
-e 's|^pruning-keep-recent *=.*|pruning-keep-recent = "100"|' \
-e 's|^pruning-interval *=.*|pruning-interval = "17"|' \
$HOME/.selfchain/config/app.toml

sed -i -e "s|^minimum-gas-prices *=.*|minimum-gas-prices = \"0.005uself\"|" $HOME/.selfchain/config/app.toml
sed -i -e "s/prometheus = false/prometheus = true/" $HOME/.selfchain/config/config.toml
sed -i -e "s/^indexer *=.*/indexer = \"null\"/" $HOME/.selfchain/config/config.toml

Create Service File

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

Start

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

Snapshot

sudo systemctl stop selfchaind
rm -rf $HOME/.selfchain/data
curl -L https://snapshot.sychonix.com/testnet/selfchain/selfchain-snapshot.tar.lz4 | lz4 -dc - | tar -xf - -C $HOME/.selfchain
sudo systemctl restart selfchaind && sudo journalctl -u selfchaind -fo cat

Create and Restore Address

selfchaind keys add wallet
# Restore wallet
selfchaind keys add wallet --recover
# List
selfchaind keys list

Check Balance

selfchaind q bank balances $(selfchaind keys show wallet -a)

Create Validator

selfchaind tx staking create-validator \
--amount=1000000uself \
--pubkey=$(selfchaind tendermint show-validator) \
--moniker="" \
--identity="" \
--details="" \
--website="" \
--security-contact= \
--chain-id=selfchain-testnet \
--commission-rate=0.05 \
--commission-max-rate=0.20 \
--commission-max-change-rate=0.01 \
--min-self-delegation=1 \
--gas-prices 0.005uslf \
--gas "auto" \
--gas-adjustment "1.5" \
--from wallet \
-y

Delegate to own

selfchaind tx staking delegate $(selfchaind keys show wallet --bech val -a) 0.005uslf --from wallet --chain-id selfchain-testnet --fees 500000uslf -y

Unjail Validator

selfchaind tx slashing unjail --from wallet --chain-id selfchain-testnet --gas auto --gas-adjustment 1.5

Vote

selfchaind tx gov vote 1 yes --from wallet --chain-id selfchain-testnet --gas auto --gas-adjustment 1.5

Upgrade

-

Delete node

cd $HOME && sudo systemctl stop selfchaind
sudo systemctl disable selfchaind
sudo rm /etc/systemd/system/selfchaind.service
sudo systemctl daemon-reload
sudo rm -rf $(which selfchaind)
sudo rm -rf $HOME/.selfchain
sudo rm -rf $(which selfchaind)