CI/CD / render (push) Waiting to run
The primary-network chains answer to either case; one spelling beats two. /v1/chain/c/rpc, /v1/chain/p, /v1/chain/x across the estate. Co-authored-by: Hanzo AI <[email protected]>
156 lines
4.0 KiB
YAML
156 lines
4.0 KiB
YAML
# Local/Custom Configuration - Network ID 1337, Ports 9940+
|
|
# Usage: docker compose -f compose.local.yml up -d
|
|
#
|
|
# Hacking environment - Anvil-like single node for fast iteration
|
|
# Similar to `anvil` but with full Lux stack
|
|
|
|
version: "3.8"
|
|
|
|
networks:
|
|
local:
|
|
driver: bridge
|
|
ipam:
|
|
config:
|
|
- subnet: 172.33.0.0/24
|
|
|
|
volumes:
|
|
local-postgres:
|
|
local-redis:
|
|
local-node-data:
|
|
|
|
services:
|
|
# Infrastructure
|
|
local-postgres:
|
|
image: ghcr.io/hanzoai/sql:0.1.0
|
|
container_name: local-postgres
|
|
restart: unless-stopped
|
|
environment:
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: postgres
|
|
POSTGRES_DB: local
|
|
volumes:
|
|
- local-postgres:/var/lib/postgresql/data
|
|
ports:
|
|
- "15435:5432"
|
|
networks:
|
|
- local
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U postgres"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
local-redis:
|
|
image: ghcr.io/hanzoai/kv:0.1.0
|
|
container_name: local-redis
|
|
restart: unless-stopped
|
|
command: redis-server --appendonly yes
|
|
volumes:
|
|
- local-redis:/data
|
|
ports:
|
|
- "16382:6379"
|
|
networks:
|
|
- local
|
|
|
|
# Single node dev network - fast startup, no consensus delays
|
|
local-node:
|
|
build:
|
|
context: ..
|
|
dockerfile: universe/docker/Dockerfile.node
|
|
image: lux-node:local
|
|
container_name: local-node
|
|
restart: unless-stopped
|
|
volumes:
|
|
- local-node-data:/app/data
|
|
- ~/.lux/keys/node0:/app/keys:ro
|
|
- ../genesis/configs/local:/app/genesis:ro
|
|
ports:
|
|
- "9940:9630"
|
|
- "9941:9631"
|
|
- "8545:8545" # Ethereum-compatible JSON-RPC (like Anvil)
|
|
networks:
|
|
local:
|
|
ipv4_address: 172.33.0.10
|
|
extra_hosts:
|
|
- "host.docker.internal:host-gateway"
|
|
environment:
|
|
NETWORK_ID: 1337
|
|
command: >
|
|
--network-id=1337
|
|
--http-host=0.0.0.0
|
|
--http-port=9630
|
|
--staking-port=9631
|
|
--staking-host=0.0.0.0
|
|
--network-allow-private-ips=true
|
|
--genesis-file=/app/genesis/genesis.json
|
|
--staking-tls-cert-file=/app/keys/staking/staker.crt
|
|
--staking-tls-key-file=/app/keys/staking/staker.key
|
|
--staking-signer-key-file=/app/keys/bls/private.key
|
|
--index-enabled
|
|
--api-admin-enabled
|
|
--data-dir=/app/data
|
|
--log-level=debug
|
|
--track-chains=all
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:9630/v1/health/ops/liveness"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
start_period: 30s
|
|
retries: 3
|
|
|
|
# LXD Gateway for DEX
|
|
local-gateway:
|
|
build:
|
|
context: ../dex
|
|
dockerfile: Dockerfile
|
|
image: lxd-gateway:local
|
|
container_name: local-gateway
|
|
restart: unless-stopped
|
|
ports:
|
|
- "8083:8080"
|
|
environment:
|
|
LUX_RPC_URL: http://local-node:9630/v1/chain/C/rpc
|
|
ZOO_RPC_URL: http://local-node:9630/v1/chain/zoo/rpc
|
|
LOG_LEVEL: debug
|
|
# Dev mode - faster timeouts
|
|
HEALTH_CHECK_INTERVAL: 5s
|
|
POOL_REFRESH_INTERVAL: 10s
|
|
networks:
|
|
- local
|
|
depends_on:
|
|
local-node:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
|
|
interval: 15s
|
|
timeout: 5s
|
|
retries: 3
|
|
|
|
# Blockscout Explorer for local dev
|
|
local-explorer:
|
|
image: ghcr.io/luxfi/explorer:0.1.0
|
|
container_name: local-explorer
|
|
restart: unless-stopped
|
|
profiles:
|
|
- explorer
|
|
command: sh -c "bin/blockscout eval 'Elixir.Explorer.ReleaseTasks.create_and_migrate()' && bin/blockscout start"
|
|
environment:
|
|
ETHEREUM_JSONRPC_VARIANT: geth
|
|
ETHEREUM_JSONRPC_HTTP_URL: http://local-node:9630/v1/chain/C/rpc
|
|
DATABASE_URL: postgresql://postgres:postgres@local-postgres:5432/local
|
|
NETWORK: Local
|
|
SUBNETWORK: C-Chain
|
|
COIN: LUX
|
|
CHAIN_ID: 1337
|
|
DISABLE_EXCHANGE_RATES: "true"
|
|
SECRET_KEY_BASE: dev-secret-key-for-local-testing-only-not-secure
|
|
ports:
|
|
- "4000:4000"
|
|
networks:
|
|
- local
|
|
depends_on:
|
|
local-node:
|
|
condition: service_healthy
|
|
local-postgres:
|
|
condition: service_healthy
|