Stable Node Setup

Install dependencies

Install all required packages for building and running the node (compilers, utilities, monitoring tools, compression libraries).

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

Configure the setup

Set network parameters.

export CHAIN_ID=stable_988-1

Set your node moniker (name).

export MONIKER=MyNode

Set your node folder name.

export FOLDER=".stabled"

Set current release version.

export VER=

Create folder structure for releases and copy binary

Organize binaries by version, move the built binary, and create a symlink for the active release. ℹ️ During the next upgrade, create a new subfolder for the new binary inside the releases folder and simply update the active-release symlink to point to this new binary’s folder. This approach is convenient for both automatic and manual updates, as well as for quickly rolling back to the previous version. Read more

mkdir -p $HOME/$FOLDER/releases/$VER/bin
ln -sfn $HOME/$FOLDER/releases/$VER $HOME/$FOLDER/active-release

Set PATH environment

Add the active-release binary folder to your PATH so you can run stabled from anywhere.

echo "export PATH=${HOME}/${FOLDER}/active-release/bin:\$PATH" >> $HOME/.bash_profile
source $HOME/.bash_profile
echo "export PATH=${HOME}/${FOLDER}/active-release/bin:\$PATH" >> $HOME/.profile
source $HOME/.profile

Download the binary

Download and unzip the latest binary

AMD64:

wget https://stable-testnet-data.s3.us-east-1.amazonaws.com/stabled-linux-amd64.tar.gz
tar -xvzf stabled-linux-adm64.tar.gz

ARM64:

wget https://stable-testnet-data.s3.us-east-1.amazonaws.com/stabled-linux-arm64.tar.gz
tar -xvzf stabled-linux-arm64.tar.gz

Download and unzip the specific binary.

export VER=

AMD64:

cd $HOME/$FOLDER/releases/$VER/bin
wget https://stable-testnet-data.s3.us-east-1.amazonaws.com/stabled-$VER-linux-amd64.tar.gz
tar -xvzf stabled-$VER-linux-adm64.tar.gz

ARM64:

cd $HOME/$FOLDER/releases/$VER/bin
wget https://stable-testnet-data.s3.us-east-1.amazonaws.com/stabled-$VER-linux-arm64.tar.gz
tar -xvzf stabled-$VER-linux-arm64.tar.gz

Initialize the node

Initialize the node.

stabled init $MONIKER --chain-id $CHAIN_ID

Set Custom ports [optional]

If you run multiple nodes on the same server, set a custom port prefix or leave it default 266.

export CUSTOM_PORT_PREF=266

Update ports in config.toml.

sed -i.bak \
  -e "s|^\([[:space:]]*\)proxy_app *=.*|\1proxy_app = \"tcp://127.0.0.1:${CUSTOM_PORT_PREF}58\"|g" \
  -e "s|^\([[:space:]]*\)laddr *= \"tcp://127.0.0.1:26657\"|\1laddr = \"tcp://127.0.0.1:${CUSTOM_PORT_PREF}57\"|g" \
  -e "s|^\([[:space:]]*\)grpc_laddr *=.*|\1grpc_laddr = \"tcp://127.0.0.1:${CUSTOM_PORT_PREF}98\"|g" \
  -e "s|^\([[:space:]]*\)laddr *= \"tcp://0.0.0.0:26656\"|\1laddr = \"tcp://0.0.0.0:${CUSTOM_PORT_PREF}56\"|g" \
  -e "s|^\([[:space:]]*\)external_address *=.*|\1external_address = \"$(wget -qO- eth0.me):${CUSTOM_PORT_PREF}56\"|g" \
  -e "s|^\([[:space:]]*\)prometheus_listen_addr *=.*|\1prometheus_listen_addr = \"127.0.0.1:${CUSTOM_PORT_PREF}60\"|g" \
  -e "s|^\([[:space:]]*\)pprof_laddr|\1#pprof_laddr|g" \
  -e "s|prometheus = false|prometheus = true|g" \
  $HOME/$FOLDER/config/config.toml

Update ports in app.toml.

sed -i.bak \
  -e "s%^\([[:space:]]*\)address = \"tcp://localhost:1317\"%\1address = \"tcp://127.0.0.1:${CUSTOM_PORT_PREF}17\"%g" \
  -e "s%^\([[:space:]]*\)address = \"localhost:9090\"%\1address = \"127.0.0.1:${CUSTOM_PORT_PREF}90\"%g" \
  -e "s%^\([[:space:]]*\)address = \"0.0.0.0:9091\"%\1address = \"127.0.0.1:${CUSTOM_PORT_PREF}91\"%g" \
  -e "/^\[json-rpc\]/,/^\[/{s/address = \".*/address = \"127.0.0.1:${CUSTOM_PORT_PREF}45\"/}" \
  -e "/^\[json-rpc\]/,/^\[/{s/ws-address = \".*/ws-address = \"127.0.0.1:${CUSTOM_PORT_PREF}46\"/}" \
  "$HOME/$FOLDER/config/app.toml"

Update client RPC address in client.toml.

sed -i.bak \
  -e "s%^\([[:space:]]*\)node = \"tcp://localhost:26657\"%\1node = \"tcp://localhost:${CUSTOM_PORT_PREF}57\"%g" \
  $HOME/$FOLDER/config/client.toml

Set pruning [optional]

Enable pruning to reduce disk usage by deleting old blocks.

sed -i -e "s/^\([[:space:]]*\)pruning *=.*/\1pruning = \"custom\"/" $HOME/$FOLDER/config/app.toml
sed -i -e "s/^\([[:space:]]*\)pruning-keep-recent *=.*/\1pruning-keep-recent = \"100\"/" $HOME/$FOLDER/config/app.toml
sed -i -e "s/^\([[:space:]]*\)pruning-interval *=.*/\1pruning-interval = \"10\"/" $HOME/$FOLDER/config/app.toml

Enable bad peer filtering.

sed -i -e "s/^\([[:space:]]*\)filter_peers *=.*/\1filter_peers = \"true\"/" $HOME/$FOLDER/config/config.toml

Set chain-id

Configure chain-id for the client.

sed -i.bak -e "s/^\([[:space:]]*\)chain-id *=.*/\1chain-id = \"${CHAIN_ID}\"/;" $HOME/$FOLDER/config/client.toml

Set keyring-backend [optional]

Change key storage backend (e.g., use os instead of file).

sed -i.bak -e "s/^\([[:space:]]*\)keyring-backend *=.*/\1keyring-backend = \"os\"/;" $HOME/$FOLDER/config/client.toml

Set minimal gas-price

Define the minimum gas price for transactions.

sed -i.bak -e "s/^\([[:space:]]*\)minimum-gas-prices *=.*/\1minimum-gas-prices = \"0.0025agusdt\"/;" $HOME/$FOLDER/config/app.toml

Turn off RPC indexing [optional]

Disables transaction indexing to save disk space.

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

Add live peers

Add peers to config.toml for network connectivity.

Hightower peer:

3be204a2a8c1f2725a6f95afcdaa78c6bdf4f16b@208.73.202.78:10056

ℹ️ We scan our nodes for live peers and select up to 15 of the best ones.

PEERS="b3f19b0552f148c5e9b79e51b28ce466c5e7a2b8@51.68.54.56:26656,25267c670b0fab26891edfbada317677ed069c22@37.187.147.10:26656,813cf04bfcfc757e97bdb7bc7a75faf18aac65ea@15.204.64.19:26656,b896f6f8ca5a4d1cc40de09407df0c96e76df950@57.129.85.107:26656,60f2af07cc0d6e151964455c53ea53bda59a8c91@185.191.117.19:26656,f8e655a9405ba8e5662d107b9d994b4629ad7d92@162.19.136.107:26656,8d3ccf90c59c2708a978736f2676ef87f7d0e541@135.125.142.159:26656,5f6fcc56e580d8954e9ffe34d1f755b18e794393@57.129.39.57:26656,f7917e0e4a18e4c9f86b7ede58384a514cf8da16@168.119.36.18:32960,0ec7355c53e57027a4db8b767610f2ad2b4d1885@162.19.153.218:26656,6b65ae6986feecdd81b010faae195b8903da8a26@162.55.4.208:32960,462a03c338fd064719e4c599e7fd921a731c6bc2@65.108.74.54:22960,c5497aab02e4412f5a487357e358dbe1e6daf6f1@65.109.69.119:12656,f3dfc1f33a0efc652fd2951b443adcb578fb57a6@65.109.85.159:12656,638f9addfc16eb115784dc33c1516bcf6b8cb6a1@65.109.116.42:12656"
sed -i.bak -e "s/^persistent_peers *=.*/persistent_peers = \"$PEERS\"/" $HOME/$FOLDER/config/config.toml

Turn on snapshot [optional]

Enable automatic state snapshot creation every N blocks.

export INTERVAL=1000
sed -i.bak -e "s/^snapshot-interval *=.*/snapshot-interval = \"$INTERVAL\"/" $HOME/$FOLDER/config/app.toml

Download genesis

Download the network genesis file.

wget -O $HOME/$FOLDER/config/genesis.json https://snapshot01.at.htw.tech/stable/testnet/genesis.json --inet4-only

Download addrbook

Download the network latest addrbook file. [1h age]

wget -O $HOME/$FOLDER/config/addrbook.json https://snapshot01.at.htw.tech/stable/testnet/addrbook.json --inet4-only

Donload Snapshot

Download the latest network snapshot here.

Create systemd service

Create a systemd service file for auto-start and managing the node.

tee /etc/systemd/system/stabled.service > /dev/null <<EOF
[Unit]
Description=Stable Testnet Node
After=network-online.target

[Service]
User=$USER
LimitNOFILE=1000000
ExecStart=$HOME/$FOLDER/active-release/bin/stabled start --chain-id $CHAIN_ID
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target
EOF

Start the node

Reload systemd configs, enable the service at boot, start the node and follow logs.

systemctl daemon-reload
systemctl enable stabled.service
systemctl restart stabled.service && journalctl -o cat -fu stabled.service