PoS mining requires this flag when the daemon has no peers. Without it, the daemon's get_pos_mining_details RPC returns DISCONNECTED status and the wallet refuses to mint. First PoS blocks minted on testnet at height 12,382. Co-Authored-By: Charon <charon@lethean.io>
221 lines
5.1 KiB
YAML
221 lines
5.1 KiB
YAML
# Lethean Testnet Network Simulation
|
|
# Spins up a 3-node testnet with explorer, wallet RPC, and trade services
|
|
#
|
|
# Usage:
|
|
# docker compose -f docker-compose.testnet.yml up -d
|
|
# docker compose -f docker-compose.testnet.yml logs -f node1
|
|
# docker compose -f docker-compose.testnet.yml down -v
|
|
#
|
|
# Nodes discover each other via exclusive-node flags.
|
|
# Node1 is the seed node, Node2 and Node3 connect to it.
|
|
|
|
services:
|
|
# === Blockchain Nodes ===
|
|
|
|
node1:
|
|
build:
|
|
context: ..
|
|
dockerfile: utils/docker/lthn-chain/Dockerfile
|
|
target: chain-service
|
|
args:
|
|
BUILD_TESTNET: 1
|
|
BUILD_THREADS: 4
|
|
container_name: lthn-node1
|
|
ports:
|
|
- "46941:36941" # RPC
|
|
- "46942:36942" # P2P
|
|
volumes:
|
|
- node1-data:/data
|
|
command: >
|
|
lethean-chain-node
|
|
--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 1
|
|
--disable-upnp
|
|
networks:
|
|
lthn-testnet:
|
|
ipv4_address: 172.28.0.10
|
|
|
|
node2:
|
|
build:
|
|
context: ..
|
|
dockerfile: utils/docker/lthn-chain/Dockerfile
|
|
target: chain-service
|
|
args:
|
|
BUILD_TESTNET: 1
|
|
BUILD_THREADS: 4
|
|
container_name: lthn-node2
|
|
volumes:
|
|
- node2-data:/data
|
|
command: >
|
|
lethean-chain-node
|
|
--data-dir /data
|
|
--rpc-bind-ip 0.0.0.0
|
|
--rpc-bind-port 36941
|
|
--p2p-bind-port 36942
|
|
--add-exclusive-node 172.28.0.10:36942
|
|
--allow-local-ip
|
|
--log-level 1
|
|
--disable-upnp
|
|
depends_on:
|
|
- node1
|
|
networks:
|
|
lthn-testnet:
|
|
ipv4_address: 172.28.0.11
|
|
|
|
node3:
|
|
build:
|
|
context: ..
|
|
dockerfile: utils/docker/lthn-chain/Dockerfile
|
|
target: chain-service
|
|
args:
|
|
BUILD_TESTNET: 1
|
|
BUILD_THREADS: 4
|
|
container_name: lthn-node3
|
|
volumes:
|
|
- node3-data:/data
|
|
command: >
|
|
lethean-chain-node
|
|
--data-dir /data
|
|
--rpc-bind-ip 0.0.0.0
|
|
--rpc-bind-port 36941
|
|
--p2p-bind-port 36942
|
|
--add-exclusive-node 172.28.0.10:36942
|
|
--allow-local-ip
|
|
--log-level 1
|
|
--disable-upnp
|
|
depends_on:
|
|
- node1
|
|
networks:
|
|
lthn-testnet:
|
|
ipv4_address: 172.28.0.12
|
|
|
|
# === Wallet RPC ===
|
|
|
|
wallet:
|
|
build:
|
|
context: ..
|
|
dockerfile: utils/docker/lthn-chain/Dockerfile
|
|
target: chain-service
|
|
args:
|
|
BUILD_TESTNET: 1
|
|
BUILD_THREADS: 4
|
|
container_name: lthn-wallet
|
|
ports:
|
|
- "46944:36944" # Wallet RPC
|
|
volumes:
|
|
- wallet-data:/wallet
|
|
entrypoint: >
|
|
sh -c "
|
|
if [ ! -f /wallet/testnet.wallet ]; then
|
|
echo '' | lethean-wallet-cli --generate-new-wallet /wallet/testnet.wallet --password '' --daemon-address node1:36941 --command exit;
|
|
fi;
|
|
lethean-wallet-cli
|
|
--wallet-file /wallet/testnet.wallet
|
|
--password ''
|
|
--daemon-address node1:36941
|
|
--rpc-bind-port 36944
|
|
--rpc-bind-ip 0.0.0.0
|
|
--do-pos-mining
|
|
"
|
|
depends_on:
|
|
- node1
|
|
networks:
|
|
lthn-testnet:
|
|
ipv4_address: 172.28.0.20
|
|
|
|
# === Explorer ===
|
|
|
|
explorer-db:
|
|
image: postgres:16-alpine
|
|
container_name: lthn-explorer-db
|
|
environment:
|
|
POSTGRES_USER: explorer
|
|
POSTGRES_PASSWORD: explorer
|
|
POSTGRES_DB: lethean_explorer
|
|
volumes:
|
|
- explorer-db-data:/var/lib/postgresql/data
|
|
networks:
|
|
lthn-testnet:
|
|
ipv4_address: 172.28.0.30
|
|
|
|
explorer:
|
|
build:
|
|
context: ../../lthn/zano-upstream/zano-explorer-zarcanum
|
|
dockerfile: Dockerfile
|
|
container_name: lthn-explorer
|
|
ports:
|
|
- "3335:3335"
|
|
environment:
|
|
API: http://node1:36941
|
|
FRONTEND_API: http://127.0.0.1:3335
|
|
SERVER_PORT: "3335"
|
|
AUDITABLE_WALLET_API: http://node1:36941
|
|
PGUSER: explorer
|
|
PGPASSWORD: explorer
|
|
PGDATABASE: lethean_explorer
|
|
PGHOST: explorer-db
|
|
PGPORT: "5432"
|
|
MEXC_API_URL: ""
|
|
depends_on:
|
|
- node1
|
|
- explorer-db
|
|
networks:
|
|
lthn-testnet:
|
|
ipv4_address: 172.28.0.31
|
|
|
|
# === Trade Backend ===
|
|
|
|
trade-db:
|
|
image: postgres:16-alpine
|
|
container_name: lthn-trade-db
|
|
environment:
|
|
POSTGRES_USER: trade
|
|
POSTGRES_PASSWORD: trade
|
|
POSTGRES_DB: lethean_trade
|
|
volumes:
|
|
- trade-db-data:/var/lib/postgresql/data
|
|
networks:
|
|
lthn-testnet:
|
|
ipv4_address: 172.28.0.40
|
|
|
|
trade-api:
|
|
build:
|
|
context: ../../lthn/zano-upstream/zano_trade_backend
|
|
container_name: lthn-trade-api
|
|
ports:
|
|
- "3336:3336"
|
|
environment:
|
|
PORT: "3336"
|
|
PGUSER: trade
|
|
PGPASSWORD: trade
|
|
PGDATABASE: lethean_trade
|
|
PGHOST: trade-db
|
|
PGPORT: "5432"
|
|
JWT_SECRET: testnet-dev-secret
|
|
DAEMON_RPC_URL: http://node1:36941/json_rpc
|
|
depends_on:
|
|
- node1
|
|
- trade-db
|
|
networks:
|
|
lthn-testnet:
|
|
ipv4_address: 172.28.0.41
|
|
|
|
networks:
|
|
lthn-testnet:
|
|
driver: bridge
|
|
ipam:
|
|
config:
|
|
- subnet: 172.28.0.0/16
|
|
|
|
volumes:
|
|
node1-data:
|
|
node2-data:
|
|
node3-data:
|
|
wallet-data:
|
|
explorer-db-data:
|
|
trade-db-data:
|