synor/docker-compose.testnet.yml
Gulshan Yadav 4d7171f4bf a
2026-01-08 09:24:26 +05:30

206 lines
5.5 KiB
YAML

# Synor Testnet Docker Compose Configuration
# Deploys 3 seed nodes for initial testnet bootstrap
services:
# ==========================================================================
# Seed Node 1 (Primary Bootstrap)
# ==========================================================================
seed1:
build:
context: .
dockerfile: Dockerfile
container_name: synor-seed1
hostname: seed1
restart: unless-stopped
command:
- "run"
- "--p2p-host=0.0.0.0"
- "--p2p-port=17511"
- "--rpc-host=0.0.0.0"
- "--rpc-port=17110"
- "--ws-port=17111"
- "--mine"
ports:
- "17511:17511" # P2P
- "17110:17110" # HTTP RPC
- "17111:17111" # WebSocket RPC
volumes:
- seed1-data:/data/synor
networks:
synor-testnet:
ipv4_address: 172.20.0.10
environment:
- RUST_LOG=info
- SYNOR_DATA_DIR=/data/synor
- SYNOR_NETWORK=testnet
healthcheck:
test: ["CMD", "synord", "version"]
interval: 30s
timeout: 10s
retries: 3
start_period: 60s
# ==========================================================================
# Seed Node 2
# ==========================================================================
seed2:
build:
context: .
dockerfile: Dockerfile
container_name: synor-seed2
hostname: seed2
restart: unless-stopped
command:
- "run"
- "--p2p-host=0.0.0.0"
- "--p2p-port=17511"
- "--rpc-host=0.0.0.0"
- "--rpc-port=17110"
- "--ws-port=17111"
- "--seeds=172.20.0.10:17511"
- "--mine"
ports:
- "17521:17511" # P2P (offset port)
- "17120:17110" # HTTP RPC
- "17121:17111" # WebSocket RPC
volumes:
- seed2-data:/data/synor
networks:
synor-testnet:
ipv4_address: 172.20.0.11
environment:
- RUST_LOG=info
- SYNOR_DATA_DIR=/data/synor
- SYNOR_NETWORK=testnet
depends_on:
seed1:
condition: service_healthy
# ==========================================================================
# Seed Node 3
# ==========================================================================
seed3:
build:
context: .
dockerfile: Dockerfile
container_name: synor-seed3
hostname: seed3
restart: unless-stopped
command:
- "run"
- "--p2p-host=0.0.0.0"
- "--p2p-port=17511"
- "--rpc-host=0.0.0.0"
- "--rpc-port=17110"
- "--ws-port=17111"
- "--seeds=172.20.0.10:17511,172.20.0.11:17511"
- "--mine"
ports:
- "17531:17511" # P2P (offset port)
- "17130:17110" # HTTP RPC
- "17131:17111" # WebSocket RPC
volumes:
- seed3-data:/data/synor
networks:
synor-testnet:
ipv4_address: 172.20.0.12
environment:
- RUST_LOG=info
- SYNOR_DATA_DIR=/data/synor
- SYNOR_NETWORK=testnet
depends_on:
seed1:
condition: service_healthy
# ==========================================================================
# Testnet Faucet Service
# ==========================================================================
faucet:
build:
context: .
dockerfile: Dockerfile.faucet
container_name: synor-faucet
hostname: faucet
restart: unless-stopped
ports:
- "8080:8080"
environment:
- SYNOR_RPC_URL=http://seed1:17110
- FAUCET_AMOUNT=1000000000 # 10 SYNOR in sompi
- FAUCET_COOLDOWN=3600 # 1 hour between requests per address
- RUST_LOG=info
networks:
- synor-testnet
depends_on:
seed1:
condition: service_healthy
# ==========================================================================
# Block Explorer Backend (optional)
# ==========================================================================
explorer-api:
build:
context: .
dockerfile: Dockerfile.explorer
container_name: synor-explorer-api
hostname: explorer-api
restart: unless-stopped
ports:
- "3000:3000"
environment:
- SYNOR_RPC_URL=http://seed1:17110
- SYNOR_WS_URL=ws://seed1:17111
- DATABASE_URL=postgres://synor:synor@postgres:5432/explorer
- RUST_LOG=info
networks:
- synor-testnet
depends_on:
seed1:
condition: service_healthy
postgres:
condition: service_healthy
profiles:
- explorer
# ==========================================================================
# PostgreSQL for Explorer
# ==========================================================================
postgres:
image: postgres:16-alpine
container_name: synor-postgres
restart: unless-stopped
environment:
- POSTGRES_USER=synor
- POSTGRES_PASSWORD=synor
- POSTGRES_DB=explorer
volumes:
- postgres-data:/var/lib/postgresql/data
networks:
- synor-testnet
healthcheck:
test: ["CMD-SHELL", "pg_isready -U synor -d explorer"]
interval: 10s
timeout: 5s
retries: 5
profiles:
- explorer
# =============================================================================
# Networks
# =============================================================================
networks:
synor-testnet:
driver: bridge
ipam:
driver: default
config:
- subnet: 172.20.0.0/16
# =============================================================================
# Volumes
# =============================================================================
volumes:
seed1-data:
seed2-data:
seed3-data:
postgres-data: