233 lines
6.4 KiB
YAML
233 lines
6.4 KiB
YAML
# Lethean Testnet Ecosystem
|
|
# Full node + wallet + explorer + trade + pool + LNS
|
|
#
|
|
# Quick start:
|
|
# cp .env.example .env # edit passwords/hostname
|
|
# docker compose -f docker-compose.pull.yml up -d
|
|
# docker compose -f docker-compose.pull.yml logs -f daemon
|
|
#
|
|
# Services:
|
|
# Explorer: http://${PUBLIC_HOST:-localhost}:3335
|
|
# Trade: http://${PUBLIC_HOST:-localhost}:3338
|
|
# Trade API: http://${PUBLIC_HOST:-localhost}:3336
|
|
# Pool API: http://${PUBLIC_HOST:-localhost}:2117
|
|
# LNS HTTP: http://${PUBLIC_HOST:-localhost}:5553
|
|
# Docs: http://${PUBLIC_HOST:-localhost}:8099
|
|
# Daemon RPC: http://${PUBLIC_HOST:-localhost}:46941
|
|
# Wallet RPC: http://${PUBLIC_HOST:-localhost}:46944
|
|
|
|
services:
|
|
# --- Chain ---
|
|
daemon:
|
|
image: lthn/chain:testnet
|
|
container_name: lthn-daemon
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${DAEMON_RPC_PORT:-46941}:36941"
|
|
- "${DAEMON_P2P_PORT:-46942}:36942"
|
|
volumes:
|
|
- chain-data:/data
|
|
entrypoint:
|
|
- lethean-chain-node
|
|
command:
|
|
- --data-dir
|
|
- /data
|
|
- --rpc-bind-ip
|
|
- "0.0.0.0"
|
|
- --rpc-bind-port
|
|
- "36941"
|
|
- --p2p-bind-port
|
|
- "36942"
|
|
- --rpc-enable-admin-api
|
|
- --allow-local-ip
|
|
- --log-level
|
|
- "${DAEMON_LOG_LEVEL:-1}"
|
|
- --disable-upnp
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "curl -sf http://localhost:36941/json_rpc -d '{\"jsonrpc\":\"2.0\",\"id\":\"0\",\"method\":\"getinfo\"}' -H 'Content-Type: application/json' | grep -q OK"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 5
|
|
start_period: 30s
|
|
|
|
wallet:
|
|
image: lthn/chain:testnet
|
|
container_name: lthn-wallet
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${WALLET_RPC_PORT:-46944}:36944"
|
|
volumes:
|
|
- wallet-data:/wallet
|
|
entrypoint:
|
|
- sh
|
|
- -c
|
|
command:
|
|
- |
|
|
if [ ! -f /wallet/main.wallet ]; then
|
|
echo '${WALLET_PASSWORD:-}' | lethean-wallet-cli --generate-new-wallet /wallet/main.wallet --password '${WALLET_PASSWORD:-}' --daemon-address daemon:36941 --command exit;
|
|
fi;
|
|
lethean-wallet-cli \
|
|
--wallet-file /wallet/main.wallet \
|
|
--password '${WALLET_PASSWORD:-}' \
|
|
--daemon-address daemon:36941 \
|
|
--rpc-bind-port 36944 \
|
|
--rpc-bind-ip 0.0.0.0 \
|
|
--do-pos-mining
|
|
depends_on:
|
|
daemon:
|
|
condition: service_healthy
|
|
|
|
# --- Explorer ---
|
|
explorer-db:
|
|
image: postgres:16-alpine
|
|
container_name: lthn-explorer-db
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_USER: ${EXPLORER_DB_USER:-explorer}
|
|
POSTGRES_PASSWORD: ${EXPLORER_DB_PASS:-explorer}
|
|
POSTGRES_DB: ${EXPLORER_DB_NAME:-lethean_explorer}
|
|
volumes:
|
|
- explorer-db:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${EXPLORER_DB_USER:-explorer}"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
explorer:
|
|
image: lthn/explorer:testnet
|
|
container_name: lthn-explorer
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${EXPLORER_PORT:-3335}:3335"
|
|
environment:
|
|
API: http://daemon:36941
|
|
FRONTEND_API: http://${PUBLIC_HOST:-localhost}:${EXPLORER_PORT:-3335}
|
|
SERVER_PORT: "3335"
|
|
AUDITABLE_WALLET_API: http://daemon:36941
|
|
PGUSER: ${EXPLORER_DB_USER:-explorer}
|
|
PGPASSWORD: ${EXPLORER_DB_PASS:-explorer}
|
|
PGDATABASE: ${EXPLORER_DB_NAME:-lethean_explorer}
|
|
PGHOST: explorer-db
|
|
PGPORT: "5432"
|
|
MEXC_API_URL: ""
|
|
depends_on:
|
|
daemon:
|
|
condition: service_healthy
|
|
explorer-db:
|
|
condition: service_healthy
|
|
|
|
# --- Trade ---
|
|
trade-db:
|
|
image: postgres:16-alpine
|
|
container_name: lthn-trade-db
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_USER: ${TRADE_DB_USER:-trade}
|
|
POSTGRES_PASSWORD: ${TRADE_DB_PASS:-trade}
|
|
POSTGRES_DB: ${TRADE_DB_NAME:-lethean_trade}
|
|
volumes:
|
|
- trade-db:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U ${TRADE_DB_USER:-trade}"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
trade-api:
|
|
image: lthn/trade-api:testnet
|
|
container_name: lthn-trade-api
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${TRADE_API_PORT:-3336}:3336"
|
|
environment:
|
|
PORT: "3336"
|
|
PGUSER: ${TRADE_DB_USER:-trade}
|
|
PGPASSWORD: ${TRADE_DB_PASS:-trade}
|
|
PGDATABASE: ${TRADE_DB_NAME:-lethean_trade}
|
|
PGHOST: trade-db
|
|
PGPORT: "5432"
|
|
JWT_SECRET: ${JWT_SECRET:-change-me-before-production}
|
|
DAEMON_RPC_URL: http://daemon:36941/json_rpc
|
|
depends_on:
|
|
daemon:
|
|
condition: service_healthy
|
|
trade-db:
|
|
condition: service_healthy
|
|
|
|
trade-frontend:
|
|
image: lthn/trade-frontend:testnet
|
|
container_name: lthn-trade-frontend
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${TRADE_FRONTEND_PORT:-3338}:30289"
|
|
environment:
|
|
NEXT_PUBLIC_API_URL: http://${PUBLIC_HOST:-localhost}:${TRADE_API_PORT:-3336}
|
|
API_URL: http://trade-api:3336
|
|
depends_on:
|
|
- trade-api
|
|
|
|
# --- Mining Pool ---
|
|
pool-redis:
|
|
image: redis:7-alpine
|
|
container_name: lthn-pool-redis
|
|
restart: unless-stopped
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
pool:
|
|
image: lthn/pool:testnet
|
|
container_name: lthn-pool
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${POOL_STRATUM_PORT:-5555}:5555"
|
|
- "${POOL_API_PORT:-2117}:2117"
|
|
- "7777:7777"
|
|
- "8888:8888"
|
|
volumes:
|
|
- ./pool-config.json:/pool/config.json:ro
|
|
depends_on:
|
|
daemon:
|
|
condition: service_healthy
|
|
wallet:
|
|
condition: service_started
|
|
pool-redis:
|
|
condition: service_healthy
|
|
|
|
# --- LNS (Lethean Name Service) ---
|
|
lns:
|
|
image: lthn/lns:testnet
|
|
container_name: lthn-lns
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${LNS_HTTP_PORT:-5553}:5553"
|
|
- "${LNS_DNS_PORT:-5354}:5354/udp"
|
|
- "${LNS_DNS_PORT:-5354}:5354/tcp"
|
|
environment:
|
|
DAEMON_URL: http://daemon:36941
|
|
HSD_URL: http://host.docker.internal:14037
|
|
LNS_MODE: light
|
|
LNS_HTTP_PORT: "5553"
|
|
LNS_DNS_PORT: "5354"
|
|
extra_hosts:
|
|
- "host.docker.internal:host-gateway"
|
|
depends_on:
|
|
daemon:
|
|
condition: service_healthy
|
|
|
|
# --- Docs ---
|
|
docs:
|
|
image: lthn/docs:testnet
|
|
container_name: lthn-docs
|
|
restart: unless-stopped
|
|
ports:
|
|
- "${DOCS_PORT:-8099}:80"
|
|
|
|
volumes:
|
|
chain-data:
|
|
wallet-data:
|
|
explorer-db:
|
|
trade-db:
|