Skip to content

Commit

Permalink
Setup docker env. for CLN integration checks
Browse files Browse the repository at this point in the history
  • Loading branch information
tnull committed Dec 8, 2023
1 parent a6b6d8d commit 20d9d76
Show file tree
Hide file tree
Showing 2 changed files with 101 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/cln.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Continuous Integration Checks - CLN

on: [push, pull_request]

jobs:
check-cln:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install dependencies
run: |
sudo apt-get update -y
sudo apt-get install -y socat
- name: Start bitcoind, electrs, and lightningd
run: docker compose -f docker-compose-cln.yml up -d

- name: Forward lightningd RPC socket
run: |
docker exec ldk-node-cln-1 sh -c "socat -d -d TCP-LISTEN:9937,fork,reuseaddr UNIX-CONNECT:/root/.lightning/regtest/lightning-rpc&"
socat -d -d UNIX-LISTEN:/tmp/lightning-rpc,reuseaddr,fork TCP:127.0.0.1:9937&
- name: Run CLN integration tests
run: RUSTFLAGS="--cfg cln_test" cargo test --test integration_tests_cln
75 changes: 75 additions & 0 deletions docker-compose-cln.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
version: '3'

services:
bitcoin:
image: blockstream/bitcoind:24.1
platform: linux/amd64
command:
[
"bitcoind",
"-printtoconsole",
"-regtest=1",
"-rpcallowip=0.0.0.0/0",
"-rpcbind=0.0.0.0",
"-rpcuser=user",
"-rpcpassword=pass",
"-fallbackfee=0.00001"
]
ports:
- "18443:18443" # Regtest RPC port
- "18444:18444" # Regtest P2P port
networks:
- bitcoin-electrs
healthcheck:
test: ["CMD", "bitcoin-cli", "-regtest", "-rpcuser=user", "-rpcpassword=pass", "getblockchaininfo"]
interval: 5s
timeout: 10s
retries: 5

electrs:
image: blockstream/esplora:electrs-cd9f90c115751eb9d2bca9a4da89d10d048ae931
platform: linux/amd64
depends_on:
bitcoin:
condition: service_healthy
command:
[
"/app/electrs_bitcoin/bin/electrs",
"-vvvv",
"--timestamp",
"--jsonrpc-import",
"--cookie=user:pass",
"--network=regtest",
"--daemon-rpc-addr=bitcoin:18443",
"--http-addr=0.0.0.0:3002",
"--electrum-rpc-addr=0.0.0.0:50001"
]
ports:
- "3002:3002"
- "50001:50001"
networks:
- bitcoin-electrs

cln:
image: blockstream/lightningd:v23.08
platform: linux/amd64
depends_on:
bitcoin:
condition: service_healthy
command:
[
"--bitcoin-rpcconnect=bitcoin",
"--bitcoin-rpcport=18443",
"--bitcoin-rpcuser=user",
"--bitcoin-rpcpassword=pass",
"--regtest",
]
ports:
- "19846:19846"
- "9937:9937"
networks:
- bitcoin-electrs

networks:
bitcoin-electrs:
driver: bridge

0 comments on commit 20d9d76

Please sign in to comment.