Skip to content

Commit 93fbbbe

Browse files
committed
Add separate Docker Compose files for CLN, LND, and Eclair integration tests
Split into docker-compose-cln.yml, docker-compose-lnd.yml (bridge network), and docker-compose-eclair.yml (host network for reliable ZMQ). Base docker-compose.yml retains only bitcoind + electrs for Rust tests.
1 parent 08c4bac commit 93fbbbe

11 files changed

Lines changed: 233 additions & 44 deletions

.github/workflows/benchmarks.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
uses: actions/cache@v4
2424
with:
2525
path: bin/bitcoind-${{ runner.os }}-${{ runner.arch }}
26-
key: bitcoind-${{ runner.os }}-${{ runner.arch }}
26+
key: bitcoind-29.0-${{ runner.os }}-${{ runner.arch }}
2727
- name: Enable caching for electrs
2828
id: cache-electrs
2929
uses: actions/cache@v4
@@ -34,7 +34,7 @@ jobs:
3434
if: "(steps.cache-bitcoind.outputs.cache-hit != 'true' || steps.cache-electrs.outputs.cache-hit != 'true')"
3535
run: |
3636
source ./scripts/download_bitcoind_electrs.sh
37-
mkdir bin
37+
mkdir -p bin
3838
mv "$BITCOIND_EXE" bin/bitcoind-${{ runner.os }}-${{ runner.arch }}
3939
mv "$ELECTRS_EXE" bin/electrs-${{ runner.os }}-${{ runner.arch }}
4040
- name: Set bitcoind/electrs environment variables

.github/workflows/cln-integration.yml

Lines changed: 55 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,64 @@ jobs:
1313
- name: Checkout repository
1414
uses: actions/checkout@v4
1515

16-
- name: Install dependencies
16+
- name: Create temporary directory for CLN data
17+
run: echo "CLN_DATA_DIR=$(mktemp -d)" >> $GITHUB_ENV
18+
19+
- name: Start bitcoind and electrs
20+
run: docker compose -f docker-compose-cln.yml up -d bitcoin electrs
21+
env:
22+
CLN_DATA_DIR: ${{ env.CLN_DATA_DIR }}
23+
24+
- name: Wait for bitcoind to be healthy
25+
run: |
26+
for i in $(seq 1 30); do
27+
if docker compose -f docker-compose-cln.yml exec bitcoin bitcoin-cli -regtest -rpcuser=user -rpcpassword=pass getblockchaininfo > /dev/null 2>&1; then
28+
echo "bitcoind is ready"
29+
exit 0
30+
fi
31+
echo "Waiting for bitcoind... ($i/30)"
32+
sleep 2
33+
done
34+
echo "ERROR: bitcoind not ready"
35+
exit 1
36+
37+
- name: Mine initial block for CLN
1738
run: |
18-
sudo apt-get update -y
19-
sudo apt-get install -y socat
39+
docker compose -f docker-compose-cln.yml exec bitcoin bitcoin-cli -regtest -rpcuser=user -rpcpassword=pass createwallet miner
40+
ADDR=$(docker compose -f docker-compose-cln.yml exec bitcoin bitcoin-cli -regtest -rpcuser=user -rpcpassword=pass -rpcwallet=miner getnewaddress)
41+
docker compose -f docker-compose-cln.yml exec bitcoin bitcoin-cli -regtest -rpcuser=user -rpcpassword=pass generatetoaddress 1 "$ADDR"
42+
docker compose -f docker-compose-cln.yml exec bitcoin bitcoin-cli -regtest -rpcuser=user -rpcpassword=pass unloadwallet miner
43+
44+
- name: Start lightningd
45+
run: docker compose -f docker-compose-cln.yml up -d cln
46+
env:
47+
CLN_DATA_DIR: ${{ env.CLN_DATA_DIR }}
2048

21-
- name: Start bitcoind, electrs, and lightningd
22-
run: docker compose -f docker-compose-cln.yml up -d
49+
- name: Wait for CLN to be ready
50+
run: |
51+
for i in $(seq 1 30); do
52+
if docker compose -f docker-compose-cln.yml exec cln test -S /root/.lightning/regtest/lightning-rpc 2>/dev/null; then
53+
echo "CLN RPC socket found"
54+
break
55+
fi
56+
echo "Waiting for CLN RPC socket... ($i/30)"
57+
sleep 2
58+
done
59+
docker compose -f docker-compose-cln.yml exec cln test -S /root/.lightning/regtest/lightning-rpc || {
60+
echo "ERROR: CLN RPC socket not found after 60 seconds"
61+
docker compose -f docker-compose-cln.yml logs cln
62+
exit 1
63+
}
2364
24-
- name: Forward lightningd RPC socket
65+
- name: Set permissions for CLN data directory
2566
run: |
26-
docker exec ldk-node-cln-1 sh -c "socat -d -d TCP-LISTEN:9937,fork,reuseaddr UNIX-CONNECT:/root/.lightning/regtest/lightning-rpc&"
27-
socat -d -d UNIX-LISTEN:/tmp/lightning-rpc,reuseaddr,fork TCP:127.0.0.1:9937&
67+
sudo chown -R $(id -u):$(id -g) $CLN_DATA_DIR
68+
sudo chmod -R 755 $CLN_DATA_DIR
69+
env:
70+
CLN_DATA_DIR: ${{ env.CLN_DATA_DIR }}
2871

2972
- name: Run CLN integration tests
30-
run: RUSTFLAGS="--cfg cln_test" cargo test --test integration_tests_cln
73+
run: CLN_SOCKET_PATH=$CLN_DATA_DIR/regtest/lightning-rpc
74+
RUSTFLAGS="--cfg cln_test" cargo test --test integration_tests_cln -- --show-output --test-threads=1
75+
env:
76+
CLN_DATA_DIR: ${{ env.CLN_DATA_DIR }}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: CI Checks - Eclair Integration Tests
2+
3+
on: [push, pull_request]
4+
5+
concurrency:
6+
group: ${{ github.workflow }}-${{ github.ref }}
7+
cancel-in-progress: true
8+
9+
jobs:
10+
check-eclair:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
16+
- name: Start bitcoind, electrs, and Eclair
17+
run: docker compose --profile eclair up -d
18+
19+
- name: Wait for Eclair to be ready
20+
run: |
21+
for i in $(seq 1 60); do
22+
if curl -s -u :eclairpassword -X POST http://127.0.0.1:8080/getinfo > /dev/null 2>&1; then
23+
echo "Eclair is ready"
24+
exit 0
25+
fi
26+
echo "Waiting for Eclair... ($i/60)"
27+
sleep 5
28+
done
29+
echo "Eclair failed to start"
30+
docker logs ldk-node-eclair-1
31+
exit 1
32+
33+
- name: Run Eclair integration tests
34+
run: RUSTFLAGS="--cfg eclair_test" cargo test --test integration_tests_eclair -- --show-output --test-threads=1

.github/workflows/lnd-integration.yml

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ jobs:
1414
uses: actions/checkout@v4
1515

1616
- name: Check and install CMake if needed
17-
# lnd_grpc_rust (via prost-build v0.10.4) requires CMake >= 3.5 but is incompatible with CMake >= 4.0.
18-
# This step checks if CMake is missing, below 3.5, or 4.0 or higher, and installs CMake 3.31.6 if needed,
19-
# ensuring compatibility with prost-build in ubuntu-latest.
2017
run: |
2118
if ! command -v cmake &> /dev/null ||
2219
[ "$(cmake --version | head -n1 | cut -d' ' -f3)" \< "3.5" ] ||
@@ -33,24 +30,54 @@ jobs:
3330
fi
3431
3532
- name: Create temporary directory for LND data
36-
id: create-temp-dir
3733
run: echo "LND_DATA_DIR=$(mktemp -d)" >> $GITHUB_ENV
3834

3935
- name: Start bitcoind, electrs, and LND
4036
run: docker compose -f docker-compose-lnd.yml up -d
4137
env:
4238
LND_DATA_DIR: ${{ env.LND_DATA_DIR }}
4339

40+
- name: Wait for LND to be ready
41+
run: |
42+
for i in $(seq 1 30); do
43+
if docker exec ldk-node-lnd test -f /root/.lnd/data/chain/bitcoin/regtest/admin.macaroon 2>/dev/null; then
44+
echo "LND macaroon found"
45+
break
46+
fi
47+
echo "Waiting for LND macaroon... ($i/30)"
48+
sleep 2
49+
done
50+
docker exec ldk-node-lnd test -f /root/.lnd/data/chain/bitcoin/regtest/admin.macaroon || {
51+
echo "ERROR: LND macaroon not found after 60 seconds"
52+
docker compose -f docker-compose-lnd.yml logs lnd
53+
exit 1
54+
}
55+
4456
- name: Set permissions for LND data directory
45-
# In PR 4622 (https://github.com/lightningnetwork/lnd/pull/4622),
46-
# LND sets file permissions to 0700, preventing test code from accessing them.
47-
# This step ensures the test suite has the necessary permissions.
4857
run: sudo chmod -R 755 $LND_DATA_DIR
4958
env:
5059
LND_DATA_DIR: ${{ env.LND_DATA_DIR }}
5160

61+
- name: Wait for LND gRPC to be ready
62+
run: |
63+
for i in $(seq 1 15); do
64+
if docker exec ldk-node-lnd lncli \
65+
--rpcserver=localhost:8081 \
66+
--tlscertpath=/root/.lnd/tls.cert \
67+
--macaroonpath=/root/.lnd/data/chain/bitcoin/regtest/admin.macaroon \
68+
--network=regtest getinfo 2>/dev/null; then
69+
echo "LND gRPC is ready"
70+
exit 0
71+
fi
72+
echo "Waiting for LND gRPC... ($i/15)"
73+
sleep 2
74+
done
75+
echo "ERROR: LND gRPC not ready after 30 seconds"
76+
docker compose -f docker-compose-lnd.yml logs lnd
77+
exit 1
78+
5279
- name: Run LND integration tests
5380
run: LND_CERT_PATH=$LND_DATA_DIR/tls.cert LND_MACAROON_PATH=$LND_DATA_DIR/data/chain/bitcoin/regtest/admin.macaroon
54-
RUSTFLAGS="--cfg lnd_test" cargo test --test integration_tests_lnd -- --exact --show-output
81+
RUSTFLAGS="--cfg lnd_test" cargo test --test integration_tests_lnd -- --show-output --test-threads=1
5582
env:
5683
LND_DATA_DIR: ${{ env.LND_DATA_DIR }}

.github/workflows/rust.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
uses: actions/cache@v4
5050
with:
5151
path: bin/bitcoind-${{ runner.os }}-${{ runner.arch }}
52-
key: bitcoind-${{ runner.os }}-${{ runner.arch }}
52+
key: bitcoind-29.0-${{ runner.os }}-${{ runner.arch }}
5353
- name: Enable caching for electrs
5454
id: cache-electrs
5555
uses: actions/cache@v4
@@ -60,7 +60,7 @@ jobs:
6060
if: "matrix.platform != 'windows-latest' && (steps.cache-bitcoind.outputs.cache-hit != 'true' || steps.cache-electrs.outputs.cache-hit != 'true')"
6161
run: |
6262
source ./scripts/download_bitcoind_electrs.sh
63-
mkdir bin
63+
mkdir -p bin
6464
mv "$BITCOIND_EXE" bin/bitcoind-${{ runner.os }}-${{ runner.arch }}
6565
mv "$ELECTRS_EXE" bin/electrs-${{ runner.os }}-${{ runner.arch }}
6666
- name: Set bitcoind/electrs environment variables

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,11 @@ criterion = { version = "0.7.0", features = ["async_tokio"] }
9393
ldk-node-062 = { package = "ldk-node", version = "=0.6.2" }
9494

9595
[target.'cfg(not(no_download))'.dev-dependencies]
96-
electrsd = { version = "0.36.1", default-features = false, features = ["legacy", "esplora_a33e97e1", "corepc-node_27_2"] }
96+
electrsd = { version = "0.36.1", default-features = false, features = ["legacy", "esplora_a33e97e1", "corepc-node_29_0"] }
9797

9898
[target.'cfg(no_download)'.dev-dependencies]
9999
electrsd = { version = "0.36.1", default-features = false, features = ["legacy"] }
100-
corepc-node = { version = "0.10.0", default-features = false, features = ["27_2"] }
100+
corepc-node = { version = "0.10.0", default-features = false, features = ["29_0"] }
101101

102102
[target.'cfg(cln_test)'.dev-dependencies]
103103
clightningrpc = { version = "0.3.0-beta.8", default-features = false }

docker-compose-cln.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
bitcoin:
3-
image: blockstream/bitcoind:27.2
3+
image: blockstream/bitcoind:29.1
44
platform: linux/amd64
55
command:
66
[
@@ -11,11 +11,16 @@ services:
1111
"-rpcbind=0.0.0.0",
1212
"-rpcuser=user",
1313
"-rpcpassword=pass",
14-
"-fallbackfee=0.00001"
14+
"-fallbackfee=0.00001",
15+
"-rest",
16+
"-zmqpubrawblock=tcp://0.0.0.0:28332",
17+
"-zmqpubrawtx=tcp://0.0.0.0:28333"
1518
]
1619
ports:
17-
- "18443:18443" # Regtest RPC port
18-
- "18444:18444" # Regtest P2P port
20+
- "18443:18443"
21+
- "18444:18444"
22+
- "28332:28332"
23+
- "28333:28333"
1924
networks:
2025
- bitcoin-electrs
2126
healthcheck:
@@ -48,19 +53,21 @@ services:
4853
- bitcoin-electrs
4954

5055
cln:
51-
image: blockstream/lightningd:v23.08
56+
image: blockstream/lightningd:v25.09.3
5257
platform: linux/amd64
5358
depends_on:
5459
bitcoin:
5560
condition: service_healthy
61+
volumes:
62+
- ${CLN_DATA_DIR:-/tmp/cln-data}:/root/.lightning
5663
command:
5764
[
5865
"--bitcoin-rpcconnect=bitcoin",
5966
"--bitcoin-rpcport=18443",
6067
"--bitcoin-rpcuser=user",
6168
"--bitcoin-rpcpassword=pass",
6269
"--regtest",
63-
"--experimental-anchors",
70+
"--experimental-splicing",
6471
]
6572
ports:
6673
- "19846:19846"

docker-compose-eclair.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
services:
2+
bitcoin:
3+
image: blockstream/bitcoind:29.1
4+
platform: linux/amd64
5+
network_mode: host
6+
command:
7+
[
8+
"bitcoind",
9+
"-printtoconsole",
10+
"-regtest=1",
11+
"-rpcallowip=0.0.0.0/0",
12+
"-rpcbind=0.0.0.0",
13+
"-rpcuser=user",
14+
"-rpcpassword=pass",
15+
"-fallbackfee=0.00001",
16+
"-rest",
17+
"-zmqpubrawblock=tcp://0.0.0.0:28332",
18+
"-zmqpubrawtx=tcp://0.0.0.0:28333"
19+
]
20+
healthcheck:
21+
test: ["CMD", "bitcoin-cli", "-regtest", "-rpcuser=user", "-rpcpassword=pass", "getblockchaininfo"]
22+
interval: 5s
23+
timeout: 10s
24+
retries: 5
25+
26+
electrs:
27+
image: mempool/electrs:v3.2.0
28+
platform: linux/amd64
29+
network_mode: host
30+
depends_on:
31+
bitcoin:
32+
condition: service_healthy
33+
command:
34+
[
35+
"-vvvv",
36+
"--timestamp",
37+
"--jsonrpc-import",
38+
"--cookie=user:pass",
39+
"--network=regtest",
40+
"--daemon-rpc-addr=127.0.0.1:18443",
41+
"--http-addr=0.0.0.0:3002",
42+
"--electrum-rpc-addr=0.0.0.0:50001"
43+
]
44+
45+
eclair:
46+
image: acinq/eclair:latest
47+
platform: linux/amd64
48+
network_mode: host
49+
depends_on:
50+
bitcoin:
51+
condition: service_healthy
52+
environment:
53+
- |
54+
JAVA_OPTS=
55+
-Xmx512m
56+
-Declair.allow-unsafe-startup=true
57+
-Declair.chain=regtest
58+
-Declair.server.port=9736
59+
-Declair.api.enabled=true
60+
-Declair.api.binding-ip=0.0.0.0
61+
-Declair.api.port=8080
62+
-Declair.api.password=eclairpassword
63+
-Declair.bitcoind.host=127.0.0.1
64+
-Declair.bitcoind.rpcport=18443
65+
-Declair.bitcoind.rpcuser=user
66+
-Declair.bitcoind.rpcpassword=pass
67+
-Declair.bitcoind.zmqblock=tcp://127.0.0.1:28332
68+
-Declair.bitcoind.zmqtx=tcp://127.0.0.1:28333
69+
-Declair.printToConsole

docker-compose-lnd.yml

100755100644
Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
services:
22
bitcoin:
3-
image: blockstream/bitcoind:27.2
3+
image: blockstream/bitcoind:29.1
44
platform: linux/amd64
55
command:
66
[
@@ -12,14 +12,15 @@ services:
1212
"-rpcuser=user",
1313
"-rpcpassword=pass",
1414
"-fallbackfee=0.00001",
15+
"-rest",
1516
"-zmqpubrawblock=tcp://0.0.0.0:28332",
1617
"-zmqpubrawtx=tcp://0.0.0.0:28333"
1718
]
1819
ports:
19-
- "18443:18443" # Regtest RPC port
20-
- "18444:18444" # Regtest P2P port
21-
- "28332:28332" # ZMQ block port
22-
- "28333:28333" # ZMQ tx port
20+
- "18443:18443"
21+
- "18444:18444"
22+
- "28332:28332"
23+
- "28333:28333"
2324
networks:
2425
- bitcoin-electrs
2526
healthcheck:
@@ -55,9 +56,10 @@ services:
5556
image: lightninglabs/lnd:v0.18.5-beta
5657
container_name: ldk-node-lnd
5758
depends_on:
58-
- bitcoin
59+
bitcoin:
60+
condition: service_healthy
5961
volumes:
60-
- ${LND_DATA_DIR}:/root/.lnd
62+
- ${LND_DATA_DIR:-/tmp/lnd-data}:/root/.lnd
6163
ports:
6264
- "8081:8081"
6365
- "9735:9735"

0 commit comments

Comments
 (0)