Skip to main content

regtest devnet (bitcoind + 2x lnd) manual runbook

Use this doc to run a local regtest devnet (Bitcoin Core + two lnd nodes). It exercises go-lcpd Lightning integration (custom messages, invoice binding, payments). This devnet is managed by ./scripts/devnet. It stores all state/logs under ./.data/devnet/ (gitignored). If a step fails, check logs/state under ./.data/devnet/. Re-run with LCPD_LOG_LEVEL=debug. This doc runs a minimal Quote → Pay → Stream flow with two roles:
  • Alice: Provider. Configure Provider mode only on Alice. Use LCPD_BACKEND=deterministic to avoid external APIs.
  • Bob: Requester.

Prerequisites

  • Go 1.24.4+
  • bitcoind / bitcoin-cli on PATH
  • lnd / lncli on PATH
  • jq on PATH (used in the commands below)

Build go-lcpd CLI tools (one-time)

Install binaries into go-lcpd/bin/:

Start / stop

Start:
Status:
Stop:

Wallet init / unlock (first time)

lnd can start without an initialized wallet, but you must create a wallet before using RPCs (payments/channels/invoices). First time (interactive):
If unlock is required after restart (interactive):
Smoke check:

Fund on-chain (make Alice the miner)

  1. Create a receive address for Alice:
  1. Mine blocks on regtest to fund Alice (mine 101 blocks to satisfy coinbase maturity):

Connect nodes / open channel / pay (make Bob able to pay Alice)

1) Connect to Bob

2) Open a channel from Alice → Bob (push funds so Bob can pay)

3) Bob pays an invoice from Alice (connectivity/route check)

Try go-lcpd (custom messages / Quote → Pay → Stream)

Once the two lnd nodes are connected as peers, start go-lcpd on both sides. This triggers lcp_manifest exchange over BOLT #1 custom messages. You can observe it via ListLCPPeers. In this walkthrough, Alice runs as a Provider, streams the result, and sends lcp_result without external dependencies. It uses LCPD_BACKEND=deterministic. Provider configuration is YAML-first (LCPD_PROVIDER_CONFIG_PATH).

0) Create a Provider YAML config

Example: go-lcpd/provider.devnet.yaml

1) Start go-lcpd on Alice (Provider / separate terminal)

2) Start go-lcpd on Bob (Requester-only / separate terminal)

3) Call ListLCPPeers (confirm manifest exchange)

If you can see gpt-5.2 under peers[0].remoteManifest.supportedTasks[].openaiChatCompletionsV1.model, it means the Provider successfully advertised the model.

4) Send one job from Bob to Alice (Quote → Pay → Stream)

Logs / data locations

  • state/log: ./.data/devnet/
  • bitcoind log: ./.data/devnet/logs/bitcoind.log
  • lnd log: ./.data/devnet/logs/lnd-alice.log / ./.data/devnet/logs/lnd-bob.log
To rebuild from scratch (destructive):