Skip to content

thuanvnnet/Stable-node-operations

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

Stable Testnet Node Installation Guide

This README provides a comprehensive guide to installing and running a node on the Stable testnet (chain ID: stabletestnet_2201-1). It is based on the official documentation from Stable Docs. This guide is intended for developers and node operators with basic Linux knowledge.

Note: This is for the testnet only. Always refer to the official docs for the latest updates, as testnet parameters may change.

Prerequisites

  • A Linux server (AMD64 or ARM64 architecture) meeting the system requirements (e.g., sufficient CPU, RAM, storage).
  • Root or sudo access.
  • Basic familiarity with Linux command line.
  • Tools like wget, tar, unzip, jq (for JSON parsing), and sha256sum installed.
  • Go installed (for Cosmovisor, if using the recommended setup).

Installation

Use pre-compiled binaries. Building from source is not supported.

For Linux AMD64

# Download the latest binary
wget https://stable-testnet-data.s3.us-east-1.amazonaws.com/stabled-latest-linux-amd64-testnet.tar.gz

# Extract the archive
tar -xvzf stabled-0.8.1-testnet-linux-amd64.tar.gz

# Move binary to system path
sudo mv stabled /usr/bin/

# Verify installation
stabled version

For Linux ARM64

# Download the binary
wget https://stable-testnet-data.s3.us-east-1.amazonaws.com/stabled-latest-linux-arm64-testnet.tar.gz

# Extract and install
tar -xvzf stabled-0.8.1-testnet-linux-arm64.tar.gz
sudo mv stabled /usr/bin/

# Verify installation
stabled version

Node Initialization

1. Set Node Name

export MONIKER="your-node-name"  # Replace with a unique name

2. Initialize the Node

stabled init $MONIKER --chain-id stabletestnet_2201-1

This creates the configuration directory at ~/.stabled/.

3. Download Genesis File

# Backup default genesis
mv ~/.stabled/config/genesis.json ~/.stabled/config/genesis.json.backup

# Download testnet genesis
wget https://stable-testnet-data.s3.us-east-1.amazonaws.com/stable_testnet_genesis.zip
unzip stable_testnet_genesis.zip

# Move to config directory
cp genesis.json ~/.stabled/config/genesis.json

# Verify checksum
sha256sum ~/.stabled/config/genesis.json
# Expected: 66afbb6e57e6faf019b3021de299125cddab61d433f28894db751252f5b8eaf2

4. Configure Node

Download Configuration Files

wget https://stable-testnet-data.s3.us-east-1.amazonaws.com/rpc_node_config.zip
unzip rpcnode_config.zip

# Backup original config
cp ~/.stabled/config/config.toml ~/.stabled/config/config.toml.backup

# Apply new configuration
cp config.toml ~/.stabled/config/config.toml

# Update moniker
sed -i "s/^moniker = \".*\"/moniker = \"$MONIKER\"/" ~/.stabled/config/config.toml

Essential Updates

Edit ~/.stabled/config/app.toml:

[json-rpc]
enable = true
address = "0.0.0.0:8545"
ws-address = "0.0.0.0:8546"
allow-unprotected-txs = true

Edit ~/.stabled/config/config.toml:

[p2p]
max_num_inbound_peers = 50
max_num_outbound_peers = 30
persistent_peers = "5ed0f977a26ccf290e184e364fb04e268ef16430@37.187.147.27:26656,128accd3e8ee379bfdf54560c21345451c7048c7@37.187.147.22:26656"
pex = true

[rpc]
laddr = "tcp://0.0.0.0:26657"
max_open_connections = 900
cors_allowed_origins = ["*"]

Setting Up as a Service

We recommend using Cosmovisor for automatic upgrades. Alternatively, use a standard systemd service.

Cosmovisor Setup (Recommended)

1. Install Cosmovisor

go install cosmossdk.io/tools/cosmovisor/cmd/cosmovisor@latest
# Or download pre-built: wget https://github.com/cosmos/cosmos-sdk/releases/download/cosmovisor%2Fv1.7.0/cosmovisor-v1.7.0-linux-amd64.tar.gz
# tar -xvzf cosmovisor-v1.7.0-linux-amd64.tar.gz
# sudo mv cosmovisor /usr/bin/

cosmovisor version

2. Set Environment Variables

Add to ~/.bashrc or ~/.profile:

echo "# Cosmovisor Configuration" >> ~/.bashrc
echo "export DAEMON_NAME=stabled" >> ~/.bashrc
echo "export DAEMON_HOME=$HOME/.stabled" >> ~/.bashrc
echo "export DAEMON_ALLOW_DOWNLOAD_BINARIES=true" >> ~/.bashrc
echo "export DAEMON_RESTART_AFTER_UPGRADE=true" >> ~/.bashrc
echo "export DAEMON_LOG_BUFFER_SIZE=512" >> ~/.bashrc
echo "export UNSAFE_SKIP_BACKUP=true" >> ~/.bashrc

source ~/.bashrc

3. Setup Directory Structure

mkdir -p ~/.stabled/cosmovisor/genesis/bin
mkdir -p ~/.stabled/cosmovisor/upgrades

cp /usr/bin/stabled ~/.stabled/cosmovisor/genesis/bin/
ln -s ~/.stabled/cosmovisor/genesis ~/.stabled/cosmovisor/current

4. Create Systemd Service

export SERVICE_NAME=stable  # Or your preferred name

sudo tee /etc/systemd/system/${SERVICE_NAME}.service > /dev/null <<EOF
[Unit]
Description=Cosmovisor daemon
After=network-online.target

[Service]
Environment="DAEMON_NAME=stabled"
Environment="DAEMON_HOME=$HOME/.stabled"
Environment="DAEMON_RESTART_AFTER_UPGRADE=true"
Environment="DAEMON_ALLOW_DOWNLOAD_BINARIES=true"
Environment="DAEMON_LOG_BUFFER_SIZE=512"
Environment="UNSAFE_SKIP_BACKUP=true"
User=$USER
ExecStart=$(which cosmovisor) run start --chain-id stabletestnet_2201-1
Restart=always
RestartSec=3
LimitNOFILE=65535
StandardOutput=journal
StandardError=journal
SyslogIdentifier=${SERVICE_NAME}

[Install]
WantedBy=multi-user.target
EOF

5. Start Service

sudo systemctl daemon-reload
sudo systemctl enable ${SERVICE_NAME}
sudo systemctl start ${SERVICE_NAME}
sudo systemctl status ${SERVICE_NAME}
sudo journalctl -u ${SERVICE_NAME} -f

Standard Systemd Service (Alternative)

export SERVICE_NAME=stable

sudo tee /etc/systemd/system/${SERVICE_NAME}.service > /dev/null <<EOF
[Unit]
Description=Stable Daemon Service
After=network-online.target

[Service]
User=$USER
ExecStart=/usr/bin/stabled start --chain-id stabletestnet_2201-1
Restart=always
RestartSec=3
LimitNOFILE=65535
StandardOutput=journal
StandardError=journal
SyslogIdentifier=${SERVICE_NAME}

[Install]
WantedBy=multi-user.target
EOF

sudo systemctl daemon-reload
sudo systemctl enable ${SERVICE_NAME}
sudo systemctl start ${SERVICE_NAME}
sudo systemctl status ${SERVICE_NAME}
sudo journalctl -u ${SERVICE_NAME} -f

Preparing for Upgrades (with Cosmovisor)

When an upgrade is announced (e.g., v0.8.0):

UPGRADE_NAME="v0.8.0"
mkdir -p ~/.stabled/cosmovisor/upgrades/$UPGRADE_NAME/bin

# Download and extract new binary
wget https://stable-testnet-data.s3.us-east-1.amazonaws.com/v8/stabled-0.8.0-testnet-linux-amd64.tar.gz
tar -xvzf stabled-0.8.0-testnet-linux-amd64.tar.gz
mv stabled ~/.stabled/cosmovisor/upgrades/$UPGRADE_NAME/bin/

Verification and Monitoring

Check Node Status

curl -s localhost:26657/status | jq '.result.sync_info'
curl -s localhost:26657/net_info | jq '.result.n_peers'
curl -s localhost:26657/status | jq '.result.sync_info.latest_block_height'

Monitor Logs

sudo journalctl -u ${SERVICE_NAME} -f
sudo journalctl -u ${SERVICE_NAME} --since "1 hour ago" | grep -i error

Security

Firewall

sudo ufw allow 22/tcp   # SSH
sudo ufw allow 26656/tcp  # P2P
sudo ufw allow 26657/tcp  # RPC (if external)
sudo ufw enable

Quick Sync

For faster sync, use snapshots from the Snapshots Guide.

Troubleshooting

  • Check logs for errors.
  • Ensure ports are open and disk space is available.
  • Refer to Troubleshooting Guide.

Next Steps

If you encounter issues, open an issue in this repo or check the official docs.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors