feat(docker): streamline regtest dev environment

- Fix EXTENSION_SERVICE_URL default to localhost (was hardcoded LAN IP)
- Fix strfry healthcheck (BusyBox nc lacks -z, use /proc/net/tcp)
- Add LP healthcheck + depends_on strfry
- Add regtest-bootstrap.sh: funds LND, opens channels, creates LP app
- Add regtest.sh: single management script (up/down/reset/status/logs/lncli/bitcoin)
- Minimal start uses only 3 containers (bitcoind, lnd-1, lnd-4) instead of 17

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Patrick Mulligan 2026-03-10 01:31:51 -04:00
commit 0395aab3d1
3 changed files with 440 additions and 9 deletions

View file

@ -4,16 +4,22 @@
# environment at ~/dev/local/docker/regtest
#
# Usage:
# 1. Start the regtest environment:
# cd ~/dev/local/docker/regtest && ./start-regtest
# 1. Start regtest (minimal — only what LP needs):
# cd ~/dev/local/docker/regtest && docker compose up -d bitcoind lnd-1 lnd-4
#
# 2. Start lamassu services:
# cd lamassu-next/docker && docker compose -f docker-compose.regtest.yml up -d
# cd docker && docker compose -f docker-compose.regtest.yml up -d
#
# 3. Configure apps/machine/.env:
# 3. Bootstrap (funds LND, opens channels, creates LP app):
# cd docker && ./regtest-bootstrap.sh
#
# 4. Configure apps/machine/.env:
# VITE_RELAY_URL=ws://localhost:7777
# VITE_EXTENSION_API_URL=http://localhost:1777
#
# Phone wallet testing (LNURL callbacks need LAN IP):
# HOST_IP=192.168.1.100 docker compose -f docker-compose.regtest.yml up -d
#
# Services:
# - strfry: Private Nostr relay (port 7777)
# - lightning-pub: Nostr-native Lightning account system (port 1776)
@ -37,10 +43,11 @@ services:
soft: 524288
hard: 524288
healthcheck:
test: ['CMD', 'nc', '-z', 'localhost', '7777']
interval: 10s
timeout: 5s
retries: 5
# Check port 7777 (0x1E61) is listening via procfs — BusyBox nc lacks -z flag
test: ['CMD-SHELL', 'grep -q ":1E61 " /proc/net/tcp']
interval: 5s
timeout: 3s
retries: 10
restart: unless-stopped
networks:
- regtest
@ -76,7 +83,16 @@ services:
- ADMIN_TOKEN=lamassu-dev-admin-token
# Extension HTTP API URL (for LNURL callbacks from external wallets)
# Use HOST_IP env var for your machine's LAN IP (required for phone wallets)
- EXTENSION_SERVICE_URL=http://${HOST_IP:-192.168.1.190}:1777
- EXTENSION_SERVICE_URL=http://${HOST_IP:-localhost}:1777
depends_on:
strfry:
condition: service_healthy
healthcheck:
test: ['CMD-SHELL', 'curl -so /dev/null -w "%{http_code}" http://localhost:1776 | grep -q .']
interval: 10s
timeout: 5s
retries: 30
start_period: 30s
restart: unless-stopped
networks:
- regtest