diff --git a/lamassu-next/docker/docker-compose.dev.yml b/lamassu-next/docker/docker-compose.dev.yml index 212595d..099e4a0 100644 --- a/lamassu-next/docker/docker-compose.dev.yml +++ b/lamassu-next/docker/docker-compose.dev.yml @@ -1,4 +1,5 @@ -version: '3.8' +# Lamassu Next Development Infrastructure +# Usage: docker compose -f docker-compose.dev.yml up -d services: # Private Nostr relay for ATM communication @@ -6,58 +7,191 @@ services: image: ghcr.io/hoytech/strfry:latest container_name: lamassu-relay ports: - - "7777:7777" + - '7777:7777' volumes: - ./strfry.conf:/etc/strfry.conf:ro - strfry-data:/app/strfry-db + ulimits: + nofile: + soft: 524288 + hard: 524288 + healthcheck: + test: ['CMD', 'nc', '-z', 'localhost', '7777'] + interval: 10s + timeout: 5s + retries: 5 + restart: unless-stopped + + # Bitcoin Core in regtest mode + bitcoind: + image: lncm/bitcoind:v27.0 + container_name: lamassu-bitcoind + volumes: + - bitcoind-data:/data/.bitcoin + environment: + BITCOIN_NETWORK: regtest + command: + - -regtest + - -server + - -rpcuser=lamassu + - -rpcpassword=lamassu + - -rpcallowip=0.0.0.0/0 + - -rpcbind=0.0.0.0 + - -zmqpubrawblock=tcp://0.0.0.0:28332 + - -zmqpubrawtx=tcp://0.0.0.0:28333 + - -fallbackfee=0.00001 + - -txindex=1 + ports: + - '18443:18443' # RPC + - '28332:28332' # ZMQ blocks + - '28333:28333' # ZMQ tx + healthcheck: + test: + [ + 'CMD', + 'bitcoin-cli', + '-regtest', + '-rpcuser=lamassu', + '-rpcpassword=lamassu', + 'getblockchaininfo', + ] + interval: 10s + timeout: 5s + retries: 10 + restart: unless-stopped + + # LND Lightning node + lnd: + image: lightninglabs/lnd:v0.18.0-beta + container_name: lamassu-lnd + depends_on: + bitcoind: + condition: service_healthy + volumes: + - lnd-data:/root/.lnd + environment: + - NETWORK=regtest + command: + - --bitcoin.active + - --bitcoin.regtest + - --bitcoin.node=bitcoind + - --bitcoind.rpchost=bitcoind:18443 + - --bitcoind.rpcuser=lamassu + - --bitcoind.rpcpass=lamassu + - --bitcoind.zmqpubrawblock=tcp://bitcoind:28332 + - --bitcoind.zmqpubrawtx=tcp://bitcoind:28333 + - --rpclisten=0.0.0.0:10009 + - --restlisten=0.0.0.0:8080 + - --tlsextradomain=lnd + - --tlsextraip=0.0.0.0 + - --noseedbackup + - --accept-keysend + - --accept-amp + ports: + - '10009:10009' # gRPC + - '8080:8080' # REST + - '9735:9735' # P2P + healthcheck: + test: ['CMD', 'lncli', '--network=regtest', 'getinfo'] + interval: 10s + timeout: 10s + retries: 30 + start_period: 30s restart: unless-stopped # Lightning.Pub - Nostr-native Lightning account system + # Note: Lightning.Pub connects to LND for actual Lightning operations lightning-pub: image: ghcr.io/shocknet/lightning-pub:latest container_name: lamassu-lightning-pub + depends_on: + lnd: + condition: service_healthy + extra_hosts: + - 'host.docker.internal:host-gateway' # Enable host.docker.internal on Linux ports: - - "3000:3000" - - "9735:9735" + - '1776:1776' volumes: - lightning-pub-data:/root/lightning_pub + - lnd-data:/root/.lnd:ro # Read-only access to LND data for macaroons/certs environment: - - NETWORK=regtest # Use regtest for development + - NETWORK=regtest + - LND_ADDRESS=lnd:10009 + - LND_CERT_PATH=/root/.lnd/tls.cert + - LND_MACAROON_PATH=/root/.lnd/data/chain/bitcoin/regtest/admin.macaroon + # Use local strfry relay - external URL first for nprofile generation + # Lightning.Pub uses relays[0] for nprofiles, so put external URL first + - NOSTR_RELAYS=ws://host.docker.internal:7777 ws://strfry:7777 + # Disable external liquidity provider for regtest + - DISABLE_LIQUIDITY_PROVIDER=true + # Admin token for HTTP API access (development only) + - ADMIN_TOKEN=lamassu-dev-admin-token restart: unless-stopped - # Polar LND node for regtest (optional - for testing without Lightning.Pub) - # Uncomment if you want a separate LND instance - # lnd: - # image: lightninglabs/lnd:v0.18.0-beta - # container_name: lamassu-lnd - # ports: - # - "10009:10009" - # - "9736:9735" - # volumes: - # - lnd-data:/root/.lnd - # command: > - # --bitcoin.active - # --bitcoin.regtest - # --bitcoin.node=neutrino - # --neutrino.connect=faucet.lightning.community - # restart: unless-stopped + # Second LND node (Alice) for payment testing + # This node can pay invoices to Lightning.Pub's LND + lnd-alice: + image: lightninglabs/lnd:v0.18.0-beta + container_name: lamassu-lnd-alice + depends_on: + bitcoind: + condition: service_healthy + volumes: + - lnd-alice-data:/root/.lnd + environment: + - NETWORK=regtest + command: + - --bitcoin.active + - --bitcoin.regtest + - --bitcoin.node=bitcoind + - --bitcoind.rpchost=bitcoind:18443 + - --bitcoind.rpcuser=lamassu + - --bitcoind.rpcpass=lamassu + - --bitcoind.zmqpubrawblock=tcp://bitcoind:28332 + - --bitcoind.zmqpubrawtx=tcp://bitcoind:28333 + - --rpclisten=0.0.0.0:10009 + - --restlisten=0.0.0.0:8080 + - --tlsextradomain=lnd-alice + - --tlsextraip=0.0.0.0 + - --noseedbackup + - --accept-keysend + - --accept-amp + - --alias=alice + ports: + - '10010:10009' # gRPC (different host port) + - '8081:8080' # REST (different host port) + - '9736:9735' # P2P (different host port) + healthcheck: + test: ['CMD', 'lncli', '--network=regtest', 'getinfo'] + interval: 10s + timeout: 10s + retries: 30 + start_period: 30s + restart: unless-stopped - # PostgreSQL for any server-side state (optional) + # PostgreSQL for optional server-side state postgres: image: postgres:16-alpine container_name: lamassu-postgres ports: - - "5432:5432" + - '5432:5432' environment: POSTGRES_DB: lamassu_dev POSTGRES_USER: lamassu POSTGRES_PASSWORD: lamassu_dev_password volumes: - postgres-data:/var/lib/postgresql/data + healthcheck: + test: ['CMD-SHELL', 'pg_isready -U lamassu -d lamassu_dev'] + interval: 10s + timeout: 5s + retries: 5 restart: unless-stopped volumes: strfry-data: + bitcoind-data: + lnd-data: + lnd-alice-data: lightning-pub-data: postgres-data: - # lnd-data: diff --git a/lamassu-next/docker/strfry.conf b/lamassu-next/docker/strfry.conf index 6527b9e..686f68d 100644 --- a/lamassu-next/docker/strfry.conf +++ b/lamassu-next/docker/strfry.conf @@ -6,6 +6,9 @@ relay { bind = "0.0.0.0" port = 7777 + # Set to 0 to skip configuring nofiles limit (avoids container ulimit issues) + nofiles = 0 + info { name = "Lamassu Dev Relay" description = "Private Nostr relay for ATM development and testing" @@ -32,9 +35,10 @@ events { # Event kinds we care about # 14: Private DMs (NIP-17) - # 21001-21003: CLINK events + # 21000: Lightning.Pub RPC (generic request/response) + # 21001-21003: CLINK events (Offer, Debit, Manage) # 22242: NIP-42 auth - # 30078: Machine status (replaceable) + # 30078: Service Beacon (replaceable, service discovery) # 30079: Transaction records (replaceable) }