Skip to content

Commit 20d9d76

Browse files
committed
Setup docker env. for CLN integration checks
1 parent a6b6d8d commit 20d9d76

File tree

2 files changed

+101
-0
lines changed

2 files changed

+101
-0
lines changed

.github/workflows/cln.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Continuous Integration Checks - CLN
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
check-cln:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout repository
10+
uses: actions/checkout@v4
11+
12+
- name: Install dependencies
13+
run: |
14+
sudo apt-get update -y
15+
sudo apt-get install -y socat
16+
17+
- name: Start bitcoind, electrs, and lightningd
18+
run: docker compose -f docker-compose-cln.yml up -d
19+
20+
- name: Forward lightningd RPC socket
21+
run: |
22+
docker exec ldk-node-cln-1 sh -c "socat -d -d TCP-LISTEN:9937,fork,reuseaddr UNIX-CONNECT:/root/.lightning/regtest/lightning-rpc&"
23+
socat -d -d UNIX-LISTEN:/tmp/lightning-rpc,reuseaddr,fork TCP:127.0.0.1:9937&
24+
25+
- name: Run CLN integration tests
26+
run: RUSTFLAGS="--cfg cln_test" cargo test --test integration_tests_cln

docker-compose-cln.yml

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
version: '3'
2+
3+
services:
4+
bitcoin:
5+
image: blockstream/bitcoind:24.1
6+
platform: linux/amd64
7+
command:
8+
[
9+
"bitcoind",
10+
"-printtoconsole",
11+
"-regtest=1",
12+
"-rpcallowip=0.0.0.0/0",
13+
"-rpcbind=0.0.0.0",
14+
"-rpcuser=user",
15+
"-rpcpassword=pass",
16+
"-fallbackfee=0.00001"
17+
]
18+
ports:
19+
- "18443:18443" # Regtest RPC port
20+
- "18444:18444" # Regtest P2P port
21+
networks:
22+
- bitcoin-electrs
23+
healthcheck:
24+
test: ["CMD", "bitcoin-cli", "-regtest", "-rpcuser=user", "-rpcpassword=pass", "getblockchaininfo"]
25+
interval: 5s
26+
timeout: 10s
27+
retries: 5
28+
29+
electrs:
30+
image: blockstream/esplora:electrs-cd9f90c115751eb9d2bca9a4da89d10d048ae931
31+
platform: linux/amd64
32+
depends_on:
33+
bitcoin:
34+
condition: service_healthy
35+
command:
36+
[
37+
"/app/electrs_bitcoin/bin/electrs",
38+
"-vvvv",
39+
"--timestamp",
40+
"--jsonrpc-import",
41+
"--cookie=user:pass",
42+
"--network=regtest",
43+
"--daemon-rpc-addr=bitcoin:18443",
44+
"--http-addr=0.0.0.0:3002",
45+
"--electrum-rpc-addr=0.0.0.0:50001"
46+
]
47+
ports:
48+
- "3002:3002"
49+
- "50001:50001"
50+
networks:
51+
- bitcoin-electrs
52+
53+
cln:
54+
image: blockstream/lightningd:v23.08
55+
platform: linux/amd64
56+
depends_on:
57+
bitcoin:
58+
condition: service_healthy
59+
command:
60+
[
61+
"--bitcoin-rpcconnect=bitcoin",
62+
"--bitcoin-rpcport=18443",
63+
"--bitcoin-rpcuser=user",
64+
"--bitcoin-rpcpassword=pass",
65+
"--regtest",
66+
]
67+
ports:
68+
- "19846:19846"
69+
- "9937:9937"
70+
networks:
71+
- bitcoin-electrs
72+
73+
networks:
74+
bitcoin-electrs:
75+
driver: bridge

0 commit comments

Comments
 (0)