115 lines
2.8 KiB
YAML
115 lines
2.8 KiB
YAML
|
|
# Lethean Chain Nodes Only — minimal network simulation
|
||
|
|
# 3 nodes + miner, no explorer/trade (for testing consensus, HF activation, reorgs)
|
||
|
|
#
|
||
|
|
# Usage:
|
||
|
|
# docker compose -f docker-compose.nodes.yml up -d
|
||
|
|
# # Start mining on node1:
|
||
|
|
# docker exec lthn-node1 curl -X POST http://127.0.0.1:36941/start_mining \
|
||
|
|
# -H 'Content-Type: application/json' \
|
||
|
|
# -d '{"miner_address":"YOUR_iTHN_ADDRESS","threads_count":2}'
|
||
|
|
# # Check sync status:
|
||
|
|
# for n in 1 2 3; do
|
||
|
|
# echo -n "node$n: "; docker exec lthn-node$n curl -s http://127.0.0.1:36941/json_rpc \
|
||
|
|
# -H 'Content-Type: application/json' \
|
||
|
|
# -d '{"jsonrpc":"2.0","id":"0","method":"getinfo"}' | python3 -c "import sys,json; print(json.load(sys.stdin)['result']['height'])"
|
||
|
|
# done
|
||
|
|
|
||
|
|
services:
|
||
|
|
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"
|
||
|
|
- "46942:36942"
|
||
|
|
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-net:
|
||
|
|
ipv4_address: 172.29.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
|
||
|
|
ports:
|
||
|
|
- "46951:36941"
|
||
|
|
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.29.0.10:36942
|
||
|
|
--allow-local-ip
|
||
|
|
--log-level 1
|
||
|
|
--disable-upnp
|
||
|
|
depends_on:
|
||
|
|
- node1
|
||
|
|
networks:
|
||
|
|
lthn-net:
|
||
|
|
ipv4_address: 172.29.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
|
||
|
|
ports:
|
||
|
|
- "46961:36941"
|
||
|
|
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.29.0.10:36942
|
||
|
|
--allow-local-ip
|
||
|
|
--log-level 1
|
||
|
|
--disable-upnp
|
||
|
|
depends_on:
|
||
|
|
- node1
|
||
|
|
networks:
|
||
|
|
lthn-net:
|
||
|
|
ipv4_address: 172.29.0.12
|
||
|
|
|
||
|
|
networks:
|
||
|
|
lthn-net:
|
||
|
|
driver: bridge
|
||
|
|
ipam:
|
||
|
|
config:
|
||
|
|
- subnet: 172.29.0.0/16
|
||
|
|
|
||
|
|
volumes:
|
||
|
|
node1-data:
|
||
|
|
node2-data:
|
||
|
|
node3-data:
|