- Features
- Project Structure
- Prerequisites
- Hardware Requirements
- Environment Variables
- Scripts
- Notes
- Quick Start
- Advanced Configuration
- Pro Tip: Editing Configs Without Stopping the Node
- π°οΈ RelayMiner Setup Guide
- License
This project provides a streamlined Dockerized setup for running a Pocket Network node using Cosmovisor.
It automates image building, initialization, snapshot restoration, and node startup to simplify deployment and management.
- π Automated Environment Initialization: Prepares the node environment and restores from a blockchain snapshot.
- π Cosmovisor Integration: Handles binary upgrades and runtime management using Cosmovisor.
- π¦ Dockerized Deployment: All node services are containerized for consistent and reproducible setups.
- β‘ Fast Sync: Bootstraps from verified snapshots for rapid node synchronization.
- π₯ Customizable Configurations: Environment variables allow flexible adjustments without modifying scripts.
| File | Description |
|---|---|
Dockerfile |
Builds the Pocket Node container image with required environment variables. |
docker-compose.yml |
Defines and orchestrates the services needed to run the node. |
init-pocket-node.sh |
Initializes the node and restores the latest snapshot for fast sync (automatically called by start-node.sh). |
start-node.sh |
Validates environment and launches the node using Cosmovisor. |
- Docker Engine Installation Guide
- Docker Compose Installation Guide
- Familiarity with Pocket Network Shannon Documentation
Refer to Pocket Network Hardware Requirements.
| Component | Minimum | Recommended |
|---|---|---|
| (v)CPU Cores | 4 | 6 |
| RAM | 16GB | 32GB |
| SSD Storage | 200GB | 420GB |
The following variables are set inside the Dockerfile to configure the node:
| Variable | Purpose | Default |
|---|---|---|
POCKET_USER |
Linux user running the node inside the container | pocket |
DAEMON_NAME |
Daemon executable name | pocketd |
DAEMON_HOME |
Path to the node's home directory | /home/pocket/.pocket |
DAEMON_RESTART_AFTER_UPGRADE |
Auto-restart after upgrade | true |
DAEMON_ALLOW_DOWNLOAD_BINARIES |
Allow Cosmovisor to download binaries | true |
UNSAFE_SKIP_BACKUP |
Skip backup (only for dev/test) | true |
COSMOVISOR_VERSION |
Version of Cosmovisor to install | v1.6.0 |
POCKETD_VERSION |
Version of Pocket Daemon to install | v0.1.6 |
Before starting the node, ensure the following environment variables are set either through your docker-compose.yml
| Variable | Description | Example Values |
|---|---|---|
NETWORK |
Defines the target Pocket Network environment. | testnet-alpha, testnet-beta, mainnet |
EXTERNAL_IP |
The external IP address of the server running the node. | 192.0.2.1 |
NODE_MONIKER |
Human-readable name for your node (for identification in network explorers). | my-pocket-node |
USE_SNAPSHOT |
Enables syncing from a snapshot instead of genesis. | true, false (default: true) |
RESNAPSHOT |
Forces snapshot re-download even if data exists (preserves priv key state). | true, false (default: false) |
SNAPSHOT_TYPE |
Specifies the snapshot type to use. | archival, pruned (default: archival) |
- Use
RESNAPSHOT=trueif your node becomes corrupted or stuck and you want to force a fresh state sync using the latest snapshot. Yourpriv_validator_state.jsonwill be preserved to retain node identity. - Set
SNAPSHOT_TYPE=prunedif you want to reduce storage usage by skipping historical data. This is suitable for nodes that do not require archival state (e.g., most relay nodes).
| Script | Purpose |
|---|---|
init-pocket-node.sh |
Prepares the node and downloads the latest snapshot. Called automatically by start-node.sh. |
start-node.sh |
Validates environment variables and starts the node with Cosmovisor. |
- Ensure that your
EXTERNAL_IPenvironment variable is properly set if operating across public networks. - Snapshot source URLs should be verified for integrity and authenticity.
- For production environments, consider hardening container security and tuning resource limits.
- (Optional but recommended) Open firewall for P2P traffic:
sudo ufw allow 26656/tcp sudo ufw reload
π£ Make sure UFW (or your cloud provider firewall) allows external P2P connections.
-
Clone the repository:
git clone https://github.com/stakenodes-unchained/pocketd.git cd pocketd -
Set the REQUIRED runtime environment variables in the docker-compose.yml file
vi docker-compose.yml
-
Build the Docker Image:
docker compose build
-
Start the Node:
docker compose up -d
-
Monitor Logs:
docker compose logs -f pocketd
The node will automatically initialize (including downloading and restoring the latest snapshot) and start syncing once the container is running.
To further optimize and configure your Pocket Node, update the following settings inside your node's configuration files:
| Setting | Section | Value |
|---|---|---|
pruning |
root | "nothing" |
minimum-gas-prices |
root | "1upokt" |
enable |
[api] |
true |
address |
[api] |
"tcp://0.0.0.0:1317" |
enabled-unsafe-cors |
[api] |
true |
address |
[grpc] |
"0.0.0.0:9090" |
max-recv-msg-size |
[grpc] |
"10485760" |
max-txs |
[mempool] |
10000 |
cardinality-level |
[pocket] |
"high" |
| Setting | Section | Value |
|---|---|---|
keyring-backend |
root | "test" |
| Setting | Section | Value |
|---|---|---|
laddr |
[rpc] |
"tcp://0.0.0.0:26657" |
cors_allowed_origins |
[rpc] |
["*", ] |
After making these changes inside the container or mounted volumes:
-
Stop the running container:
docker compose down
-
Restart the node:
docker compose up -d
This ensures that your new configuration settings are applied properly.
If you need to make quick adjustments to configuration files without bringing the node down, you can connect directly to the running container:
docker exec -it pocket-node bashOnce inside:
-
Navigate to the configuration directory:
cd /home/pocket/.pocket/config -
Edit the necessary files (
app.toml,client.toml,config.toml) using a text editor likeviornano(if installed). -
After making changes, gracefully restart the container:
docker compose restart pocketd
β‘ Note: Some changes (especially network binding changes) may still require a full
docker compose down && up -drestart.
RelayMiner is disabled by default to support node operators who may not need it. If you intend to run RelayMiner, you must explicitly enable it and follow the steps below to ensure a successful launch.
RelayMiner requires an active supplier stake to function.
- A sample
supplier-stake.yamlis available in thetemplates/directory. - Modify the values to suit your setup.
- Copy the file into the Pocket node container using:
docker cp supplier-stake.yaml pocketd-node:/tmp/supplier-stake.yaml
- Modify the sample
relayminer-config.yamlfound in thetemplates/directory. - This file includes important parameters such as service IDs, backend RPC URLs, and signing key names.
π οΈ Itβs highly recommended you prepare this file before enabling RelayMiner, as the container will enter a limited wait loop at startup expecting the file to exist.
To activate the service:
- In your
docker-compose.yml, set:ENABLE_RELAYMINER=true - If the container previously started with
false, remove it and start it again:docker compose rm relayminer docker compose up -d relayminer
Once RelayMiner starts with ENABLE_RELAYMINER=true, the following validations occur:
-
β³ Keyring Check:
The container waits up to 5 minutes (5 attempts, 60s intervals) for keys to exist in thekeyring-filedirectory.
You can enter the container and add keys manually:docker exec -it relayminer sh pocketd keys add <key_name> pocketd keys add <key_name> --recover
-
π Config File Check:
RelayMiner also waits up to 5 minutes (5 attempts, 60s intervals) forrelayminer-config.yamlto appear at:
/home/pocket/.pocket/relayminer-config.yaml
If either of these is missing or empty after their respective countdowns, the container will terminate with an error.
Make sure POCKET_KEYRING_PASSPHRASE is set in the environment for non-interactive unlocking of your key during container startup.
MIT License Β© 2025 Unchained Nodes LLC