Skip to content

Commit ac8fb2f

Browse files
committed
Unify Docker Compose files with profiles for CLN, LND, and Eclair
Update CI workflows to use unified Docker Compose with profiles
1 parent 3e8cfad commit ac8fb2f

7 files changed

Lines changed: 149 additions & 167 deletions

File tree

.github/workflows/cln-integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
sudo apt-get install -y socat
2020
2121
- name: Start bitcoind, electrs, and lightningd
22-
run: docker compose -f docker-compose-cln.yml up -d
22+
run: docker compose --profile cln up -d
2323

2424
- name: Forward lightningd RPC socket
2525
run: |
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
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 and electrs
17+
run: docker compose up -d
18+
19+
- name: Wait for bitcoind to be healthy
20+
run: |
21+
for i in $(seq 1 30); do
22+
if docker exec ldk-node-bitcoin-1 bitcoin-cli -regtest -rpcuser=user -rpcpassword=pass getblockchaininfo > /dev/null 2>&1; then
23+
echo "bitcoind is ready"
24+
break
25+
fi
26+
echo "Waiting for bitcoind... ($i/30)"
27+
sleep 2
28+
done
29+
30+
- name: Create Eclair wallet on bitcoind
31+
run: |
32+
docker exec ldk-node-bitcoin-1 bitcoin-cli -regtest -rpcuser=user -rpcpassword=pass createwallet eclair || true
33+
34+
- name: Start Eclair
35+
run: docker compose --profile eclair up -d
36+
37+
- name: Wait for Eclair to be ready
38+
run: |
39+
for i in $(seq 1 60); do
40+
if curl -s -u :eclairpassword http://127.0.0.1:8080/getinfo > /dev/null 2>&1; then
41+
echo "Eclair is ready"
42+
break
43+
fi
44+
echo "Waiting for Eclair... ($i/60)"
45+
sleep 5
46+
done
47+
curl -s -u :eclairpassword http://127.0.0.1:8080/getinfo || { echo "Eclair failed to start"; docker logs ldk-node-eclair-1; exit 1; }
48+
49+
- name: Run Eclair integration tests
50+
run: RUSTFLAGS="--cfg eclair_test" cargo test --test integration_tests_eclair -- --test-threads=1

.github/workflows/lnd-integration.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,20 @@ jobs:
3737
run: echo "LND_DATA_DIR=$(mktemp -d)" >> $GITHUB_ENV
3838

3939
- name: Start bitcoind, electrs, and LND
40-
run: docker compose -f docker-compose-lnd.yml up -d
40+
run: docker compose --profile lnd up -d
41+
env:
42+
LND_DATA_DIR: ${{ env.LND_DATA_DIR }}
43+
44+
- name: Wait for LND to create macaroon
45+
run: |
46+
for i in $(seq 1 30); do
47+
if [ -f "$LND_DATA_DIR/data/chain/bitcoin/regtest/admin.macaroon" ]; then
48+
echo "LND macaroon found"
49+
break
50+
fi
51+
echo "Waiting for LND macaroon... ($i/30)"
52+
sleep 2
53+
done
4154
env:
4255
LND_DATA_DIR: ${{ env.LND_DATA_DIR }}
4356

@@ -51,6 +64,6 @@ jobs:
5164

5265
- name: Run LND integration tests
5366
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
67+
RUSTFLAGS="--cfg lnd_test" cargo test --test integration_tests_lnd -- --show-output --test-threads=1
5568
env:
5669
LND_DATA_DIR: ${{ env.LND_DATA_DIR }}

docker-compose-cln.yml

Lines changed: 0 additions & 73 deletions
This file was deleted.

docker-compose-lnd.yml

Lines changed: 0 additions & 86 deletions
This file was deleted.

docker-compose.yml

Lines changed: 77 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: '3'
2-
31
services:
42
bitcoin:
53
image: blockstream/bitcoind:27.2
@@ -14,11 +12,15 @@ services:
1412
"-rpcuser=user",
1513
"-rpcpassword=pass",
1614
"-fallbackfee=0.00001",
17-
"-rest"
15+
"-rest",
16+
"-zmqpubrawblock=tcp://0.0.0.0:28332",
17+
"-zmqpubrawtx=tcp://0.0.0.0:28333"
1818
]
1919
ports:
2020
- "18443:18443" # Regtest REST and RPC port
2121
- "18444:18444" # Regtest P2P port
22+
- "28332:28332" # ZMQ block port
23+
- "28333:28333" # ZMQ tx port
2224
networks:
2325
- bitcoin-electrs
2426
healthcheck:
@@ -41,10 +43,81 @@ services:
4143
"--cookie=user:pass",
4244
"--network=regtest",
4345
"--daemon-rpc-addr=bitcoin:18443",
44-
"--http-addr=0.0.0.0:3002"
46+
"--http-addr=0.0.0.0:3002",
47+
"--electrum-rpc-addr=0.0.0.0:50001"
4548
]
4649
ports:
4750
- "3002:3002"
51+
- "50001:50001"
52+
networks:
53+
- bitcoin-electrs
54+
55+
cln:
56+
image: blockstream/lightningd:v23.08
57+
platform: linux/amd64
58+
profiles: ["cln"]
59+
depends_on:
60+
bitcoin:
61+
condition: service_healthy
62+
command:
63+
[
64+
"--bitcoin-rpcconnect=bitcoin",
65+
"--bitcoin-rpcport=18443",
66+
"--bitcoin-rpcuser=user",
67+
"--bitcoin-rpcpassword=pass",
68+
"--regtest",
69+
"--experimental-anchors",
70+
]
71+
ports:
72+
- "19846:19846"
73+
- "9937:9937"
74+
networks:
75+
- bitcoin-electrs
76+
77+
lnd:
78+
image: lightninglabs/lnd:v0.18.5-beta
79+
container_name: ldk-node-lnd
80+
profiles: ["lnd"]
81+
depends_on:
82+
bitcoin:
83+
condition: service_healthy
84+
volumes:
85+
- ${LND_DATA_DIR:-/tmp/lnd-data}:/root/.lnd
86+
ports:
87+
- "8081:8081"
88+
- "9735:9735"
89+
command:
90+
- "--noseedbackup"
91+
- "--trickledelay=5000"
92+
- "--alias=ldk-node-lnd-test"
93+
- "--externalip=lnd:9735"
94+
- "--bitcoin.active"
95+
- "--bitcoin.regtest"
96+
- "--bitcoin.node=bitcoind"
97+
- "--bitcoind.rpchost=bitcoin:18443"
98+
- "--bitcoind.rpcuser=user"
99+
- "--bitcoind.rpcpass=pass"
100+
- "--bitcoind.zmqpubrawblock=tcp://bitcoin:28332"
101+
- "--bitcoind.zmqpubrawtx=tcp://bitcoin:28333"
102+
- "--accept-keysend"
103+
- "--rpclisten=0.0.0.0:8081"
104+
- "--tlsextradomain=lnd"
105+
- "--tlsextraip=0.0.0.0"
106+
networks:
107+
- bitcoin-electrs
108+
109+
eclair:
110+
image: acinq/eclair:release-0.8.0
111+
platform: linux/amd64
112+
profiles: ["eclair"]
113+
depends_on:
114+
bitcoin:
115+
condition: service_healthy
116+
ports:
117+
- "8080:8080"
118+
- "9736:9736"
119+
environment:
120+
- JAVA_OPTS=-Declair.chain=regtest -Declair.server.port=9736 -Declair.api.enabled=true -Declair.api.binding-ip=0.0.0.0 -Declair.api.port=8080 -Declair.api.password=eclairpassword -Declair.bitcoind.host=bitcoin -Declair.bitcoind.rpcuser=user -Declair.bitcoind.rpcpassword=pass -Declair.bitcoind.rpcport=18443 -Declair.bitcoind.wallet=eclair -Declair.bitcoind.zmqblock=tcp://bitcoin:28332 -Declair.bitcoind.zmqtx=tcp://bitcoin:28333
48121
networks:
49122
- bitcoin-electrs
50123

tests/integration_tests_eclair.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,13 @@ use common::external_node::ExternalNode;
2323
use common::scenarios::*;
2424

2525
fn setup_clients() -> (BitcoindClient, ElectrumClient, TestEclairNode) {
26+
// Use wallet-specific RPC URL to avoid multi-wallet conflicts.
27+
// Eclair loads its own "eclair" wallet on bitcoind, and our tests
28+
// create "ldk_node_test". With two wallets loaded, plain RPC calls
29+
// fail with "Wallet file not specified". Using the wallet URL
30+
// ensures our calls go to the right wallet.
2631
let bitcoind = BitcoindClient::new_with_auth(
27-
"http://127.0.0.1:18443",
32+
"http://127.0.0.1:18443/wallet/ldk_node_test",
2833
Auth::UserPass("user".to_string(), "pass".to_string()),
2934
)
3035
.unwrap();

0 commit comments

Comments
 (0)