[claude] Connect API to real Lightning node (#12) #64
Reference in New Issue
Block a user
Delete Branch "claude/issue-12"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #12
What this does
The infrastructure scripts (
setup.sh,lnd-init.sh,sweep.sh,ops.sh,docker-compose.yml) already cover the full node provisioning flow. This PR closes the API-side configuration gap:Changes
.env.example— New file documenting every required environment variable, with focus onLNBITS_URLandLNBITS_API_KEY. Operators runinfrastructure/lnd-init.shwhich prints these two values at the end; they then set them in Replit/their deployment env.GET /api/healthz— Now includeslnbits_stub: booleanandlnbits_url: string | null. Operators can hit this endpoint to immediately verify whether the API is connected to a real Lightning node or still running in simulated stub mode.Production startup log — When
NODE_ENV=productionandLNBITS_URL/LNBITS_API_KEYare absent, the server emits aWARNlog at startup pointing toinfrastructure/lnd-init.sh.Operator runbook (unchanged — infrastructure already existed)
bash infrastructure/setup.shon a 4GB+ DO droplet (starts Bitcoin IBD)verificationprogress → 1.0, ~2-3 days)bash /opt/timmy-node/lnd-init.sh— creates LND wallet, starts LNbits, printsLNBITS_URL+LNBITS_API_KEYcurl https://<your-domain>/api/healthz→lnbits_stub: falselnd-init.sh