This repository contains all the necessary files to run a Stable node using Docker with automatic port management and snapshot synchronization.
- Docker containerized Stable node
- Automatic port availability checking
- Snapshot-based fast synchronization
- Automatic cleanup of temporary files
- All services running in a single directory
- Docker and Docker Compose installed
- Linux system (tested on Ubuntu 22.04)
-
Make the startup script executable:
chmod +x setup.sh
-
Run the startup script:
./setup.sh
The script will automatically:
- Check for available ports
- Download and configure the node
- Download and extract the latest snapshot
- Start the Docker container with proper port mapping
To export your validator private key for backup or wallet import:
# Export the private key (this will display it in JSON format)
cat stabled/config/priv_validator_key.json
# You can also save it to a file for backup
cat stabled/config/priv_validator_key.json > validator-key-backup.jsonImportant: Keep your private key secure and never share it. Anyone with access to this key can control your validator.
The node exposes the following services:
- P2P: 26656 (or first available port)
- RPC: 26657 (or first available port after P2P)
- API: 1317 (or first available port after RPC)
- JSON-RPC: 8545 (or first available port after API)
- WebSocket: 8546 (or first available port after JSON-RPC)
- gRPC: 9090 (or first available port after WebSocket)
Actual ports used will be displayed when the script runs.
To check if the node is fully synchronized:
docker compose exec stable-node curl -s localhost:26657/status | jq '.result.sync_info'This will show:
latest_block_height: Current block height of your nodecatching_up:trueif still syncing,falseif fully synchronized
To see how many peers your node is connected to:
docker compose exec stable-node curl -s localhost:26657/net_info | jq '.result.n_peers'To see the latest block processed by your node:
docker compose exec stable-node curl -s localhost:26657/status | jq '.result.sync_info.latest_block_height'To continuously monitor the synchronization progress, use the monitoring script:
chmod +x monitor-sync.shThis script will display real-time synchronization information every 10 seconds:
- Current block height
- Synchronization status
- Latest block timestamp
Press Ctrl+C to stop the monitoring.
To view the node logs:
docker compose logs -fTo check the node status:
docker compose psThe node configuration files are stored in stabled/:
config.toml: Core Tendermint/CometBFT configurationapp.toml: Application-specific configurationgenesis.json: Genesis file
To stop the node:
docker compose downTo completely remove all node data:
docker compose down -v
rm -rf stabledIf the node fails to start:
- Check the logs:
docker compose logs - Ensure ports are available
- Verify Docker is running properly
- Check disk space availability