[Infra] Lightning-Gated Node Bootstrap — pay once, get a Bitcoin full node #50
Reference in New Issue
Block a user
Delete Branch "%!s()"
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?
What & Why
A user pays a single Lightning invoice (the "startup fee") and Timmy automatically provisions a Bitcoin full node for them on Digital Ocean — Ubuntu droplet + block volume + Bitcoin Knots + LND + LNbits via cloud-init — then returns the credentials. This is a proof-of-concept for "node-as-a-service bootstrapped by Lightning."
Done looks like
POST /api/bootstrapreturns a Lightning invoice (BOOTSTRAP_FEE_SATSenv var, default 10 000 sats)GET /api/bootstrap/:idpolls state:awaiting_payment→provisioning→ready|failedDO_API_TOKEN), provisioning simulated in ~2 s with fake credentialsOut of scope
Tasks
bootstrap_jobstable: state, invoice details, provisioning results (droplet ID, node IP, Tailscale hostname, SSH private key, error message), timestamps.provisioner.tsinapi-server/src/lib/: SSH keypair generation, Tailscale auth-key creation, DO droplet creation with cloud-init. Stub mode whenDO_API_TOKENabsent.bootstrap.tsinapi-server/src/routes/:POST /api/bootstrap(creates job + invoice) andGET /api/bootstrap/:id(poll state machine). Mount inapp.ts.calculateBootstrapFeeSats()inPricingService. Document env vars inreplit.md:DO_API_TOKEN,DO_REGION,DO_SIZE,DO_VOLUME_SIZE_GB,TAILSCALE_API_KEY,TAILSCALE_TAILNET,BOOTSTRAP_FEE_SATS.Relevant files
lib/db/src/schema/index.tsartifacts/api-server/src/routes/jobs.tsartifacts/api-server/src/lib/lnbits.tsartifacts/api-server/src/lib/pricing.tsinfrastructure/setup.shPR #98 created. This PR implements the Lightning-Gated Node Bootstrap feature, including DB schema, provisioner service, API routes, and documentation updates.