regtest integration test (bitcoind + lnd)
This document explains how to runTestIntegration_Regtest_LNDPayment locally (a regtest integration test for Lightning payments).
Prerequisites
- Go 1.24.4+
bitcoind/bitcoin-clionPATHlnd/lnclionPATH
Run
devnet (manual)
If you want to run a manual regtest devnet (bitcoind + 2x lnd) instead of integration tests, use./scripts/devnet.
Steps: devnet.md
custom messages (lcp_manifest exchange)
TestIntegration_Regtest_LNDCustomMessages_LCPManifest is an integration test showing that two lnd nodes can exchange lcp_manifest over BOLT #1 custom messages, and that ListLCPPeers can observe one peer (no channel required).
Run it using the “optional coverage” commands above.
Generated data/logs
The tests storebitcoind and lnd state/logs under a temp directory created with os.MkdirTemp.
Normally it is removed at the end of the test, except when:
LCP_ITEST_KEEP_DATA=1is set- the test fails
keeping regtest data dir: ....
Implementation notes (stability knobs)
bitcoindstarts with-listen=0(no P2P listen; RPC only).lndenables--bitcoind.rpcpollingto avoid ZMQ port conflicts.
About the lnd gRPC stubs
This project does not importgithub.com/lightningnetwork/lnd/lnrpc directly.
Instead it uses vendored Go stubs under go-lcpd/internal/lnd/lnrpc and go-lcpd/internal/lnd/routerrpc.
This avoids dependency conflicts caused by protobuf replacement/forks, and keeps go test straightforward.
To update, copy/replace the stubs from the target lnd module version: