Back to Home

SELFCHAIN

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

Official | Discord | Twitter

RPC API

Minimum Hardware

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

Install dependencies

sudo apt update && sudo apt upgrade -y
sudo apt install curl iptables build-essential git wget jq make gcc nano tmux htop nvme-cli pkg-config libssl-dev libleveldb-dev tar clang bsdmainutils ncdu unzip libleveldb-dev aria2 -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

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/

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

Set 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

# set custom ports in app.toml
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

Set Pruning Gas

# Pruning
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

# Set Gas
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

Service

sudo tee /etc/systemd/system/selfchaind.service > /dev/null <

Snapshot

curl "https://snapshot.sychonix.com/testnet/selfchain/selfchain-snapshot.tar.lz4" | lz4 -dc - | tar -xf - -C "$HOME/.selfchain"

Start

sudo systemctl daemon-reload
sudo systemctl enable selfchaind.service
sudo systemctl restart selfchaind.service && sudo journalctl -u selfchaind.service -f --no-hostname -o cat

Create / Restore Address

selfchaind keys add wallet
selfchaind keys add wallet --recover
selfchaind keys list wallete

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.005uself \
--gas "auto" \
--gas-adjustment "1.5" \
--from wallet \
-y

Unjail Validator

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

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)