Guide
Here is a node installation guide (Simplified and manual)
Preparing the server for installation
sudo apt update && sudo apt upgrade -y
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 -y
Installing Go
ver="1.20.3" && \
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
Build
cd $HOME
wget https://share.utsa.tech/selfchain/selfchaind
chmod +x selfchaind
mv selfchaind $HOME/go/bin
Init your node
selfchaind init <YOUR_MONIKER> --chain-id self-dev-1
selfchaind config chain-id self-dev-1
Create or recover your wallet
#NEW WALLET
selfchaind keys add <WALLET_NAME>
#RECOVER OLD WALLET
selfchaind keys add <WALLET_NAME> --recover
Download Genesis
wget -O $HOME/.selfchain/config/genesis.json "https://raw.githubusercontent.com/hotcrosscom/selfchain-genesis/main/networks/devnet/genesis.json"
Set up the minimum gas price and Peers/Seeds/Filter peers/MaxPeers
sed -i.bak -e "s/^minimum-gas-prices *=.*/minimum-gas-prices = \"0.0uself\"/;" ~/.selfchain/config/app.toml
external_address=$(wget -qO- eth0.me)
sed -i.bak -e "s/^external_address *=.*/external_address = \"$external_address:26656\"/" $HOME/.selfchain/config/config.toml
PEERS="$(curl -sS http://157.230.119.165:26657/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
seeds=""
sed -i.bak -e "s/^seeds =.*/seeds = \"$seeds\"/" $HOME/.selfchain/config/config.toml
sed -i 's/max_num_inbound_peers =.*/max_num_inbound_peers = 50/g' $HOME/.selfchain/config/config.toml
sed -i 's/max_num_outbound_peers =.*/max_num_outbound_peers = 50/g' $HOME/.selfchain/config/config.toml
Download addrbook
wget -O $HOME/.selfchain/config/addrbook.json "https://raw.githubusercontent.com/nodersteam/cosmos-adrbook/main/selfchain/addrbook.json"
Create a service file
sudo tee /etc/systemd/system/selfchaind.service > /dev/null <<EOF
[Unit]
Description=selfchaind
After=network-online.target
[Service]
User=$USER
ExecStart=$(which selfchaind) start
Restart=on-failure
RestartSec=3
LimitNOFILE=65535
[Install]
WantedBy=multi-user.target
EOF
Use our StateSync
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$peers\"/" ~/.selfchain/config/config.toml
SNAP_RPC=http://selfchain.rpc.nodersteam.com:26657
LATEST_HEIGHT=$(curl -s $SNAP_RPC/block | jq -r .result.block.header.height); \
BLOCK_HEIGHT=$((LATEST_HEIGHT - 500)); \
TRUST_HASH=$(curl -s "$SNAP_RPC/block?height=$BLOCK_HEIGHT" | jq -r .result.block_id.hash)
echo $LATEST_HEIGHT $BLOCK_HEIGHT $TRUST_HASH
sed -i.bak -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\"| ; \
s|^(seeds[[:space:]]+=[[:space:]]+).*$|\1\"\"|" $HOME/.selfchain/config/config.toml
Start your node
systemctl daemon-reload
systemctl enable selfchaind
systemctl restart selfchaind && journalctl -u selfchaind -f -o cat
Wait for full synchronization and create a validator
selfchaind tx staking create-validator \
--amount=1000000uself \
--pubkey=$(selfchaind tendermint show-validator) \
--moniker=<YOUR_MONIKER> \
--details="<YOUR_DETAILS>" \
--identity="<YOUR_KEYBASE_ID>" \
--website="<YOUR_WEBSITE>" \
--chain-id="self-dev-1" \
--commission-rate="0.10" \
--commission-max-rate="0.50" \
--commission-max-change-rate="0.2" \
--min-self-delegation="1" \
--from=<WALLET_NAME> -y
If you want to delete a node
systemctl stop selfchaind
systemctl disable selfchaind
rm /etc/systemd/system/selfchaind.service
systemctl daemon-reload
cd $HOME
rm -rf .selfchain
rm -rf $(which selfchaind)
Last updated