3 Docker Deployment
Claude edited this page 2026-04-03 13:12:22 +01:00

Docker Deployment

Ecosystem Tour

Run the full Lethean ecosystem in Docker. No compilation needed.

Quick Start

# 1. Configure
cp .env.example .env
# Edit .env — at minimum change JWT_SECRET and WALLET_PASSWORD

# 2. Start
docker compose -f docker-compose.pull.yml up -d

# 3. Check
bash health.sh

The daemon takes ~30 seconds to initialise. Other services wait for the daemon health check before starting.

Services

Service URL Description
Block Explorer http://localhost:3335 Browse blocks, transactions, aliases
Trade DEX http://localhost:3338 Decentralised exchange frontend
Trade API http://localhost:3336 REST API for trade operations
Mining Pool http://localhost:2117 Pool stats API
Pool Stratum localhost:5555 Connect miners here
LNS HTTP http://localhost:5553 Lethean Name Service API
LNS DNS localhost:5354 DNS resolver for .lthn names
Daemon RPC http://localhost:46941 Chain node JSON-RPC
Wallet RPC http://localhost:46944 Wallet JSON-RPC
Docs http://localhost:8099 Documentation site

Configuration

All settings are in .env. Copy from .env.example:

cp .env.example .env

Key settings:

Variable Default Description
PUBLIC_HOST localhost Hostname for external access
WALLET_PASSWORD (empty) Wallet encryption password
JWT_SECRET change-me... Trade API authentication secret
DAEMON_LOG_LEVEL 1 0=minimal, 1=normal, 2=detailed

All ports can be overridden — see .env.example for the full list.

Remote Deployment

Use the deploy script to transfer images and config to a remote server:

bash deploy.sh user@server
bash deploy.sh user@server /opt/lethean/docker

This will:

  1. Build the image bundle if not already built
  2. Transfer config files and images via SCP
  3. Load images on the remote server
  4. Start the stack

Auto-start on Boot

Install the systemd service:

sudo cp lethean-testnet.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable lethean-testnet

Volumes and Backup

Volume Contains Backup Priority
chain-data Blockchain database Low — can resync from network
wallet-data Wallet file + keys Critical
explorer-db Explorer PostgreSQL Low — rebuilds from chain
trade-db Trade PostgreSQL Medium — trade history

Backup Wallet

docker compose -f docker-compose.pull.yml stop wallet
docker cp lthn-wallet:/wallet ./wallet-backup-$(date +%Y%m%d)
docker compose -f docker-compose.pull.yml start wallet

Building from Source

docker compose -f docker-compose.ecosystem.yml build
docker compose -f docker-compose.ecosystem.yml up -d

Requires the full source tree with all submodules.

Architecture

┌─────────────────────────────────────────────────────┐
│                    Docker Network                     │
│                                                       │
│  ┌──────────┐    ┌──────────┐    ┌──────────┐       │
│  │  daemon   │◄──│  wallet   │    │   lns    │       │
│  │  :36941   │    │  :36944   │    │ :5553/54 │       │
│  └────┬──┬──┘    └──────────┘    └──────────┘       │
│       │  │                                            │
│  ┌────┴──┴───────────────┐                           │
│  │                       │                            │
│  ▼                       ▼                            │
│ ┌──────────┐  ┌──────────────┐  ┌──────────┐        │
│ │ explorer │  │  trade-api   │  │   pool   │        │
│ │  :3335   │  │    :3336     │  │  :5555   │        │
│ └────┬─────┘  └──────┬──────┘  └────┬─────┘        │
│      │               │              │                │
│ ┌────┴─────┐  ┌──────┴──────┐  ┌───┴──────┐        │
│ │explorer-db│  │  trade-db   │  │pool-redis│        │
│ │ postgres  │  │  postgres   │  │  redis   │        │
│ └──────────┘  └─────────────┘  └──────────┘        │
│                                                       │
│  ┌──────────────┐  ┌──────────┐                      │
│  │trade-frontend│  │   docs   │                      │
│  │    :30289    │  │   :80    │                      │
│  └──────────────┘  └──────────┘                      │
└─────────────────────────────────────────────────────┘