From a99ef09bb9a452b0345263d391b6fb0b2ee82528 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?dni=20=E2=9A=A1?= Date: Fri, 12 Sep 2025 09:54:39 +0200 Subject: [PATCH] feat: reintroduce boltz (#19) * feat: reintroduce boltz * use latest boltz * fixup lnd version * enable legacy api --- .github/workflows/ci.yml | 6 +-- data/boltz/boltz.conf | 111 +++++++++++++++++++++++++++++++++++++++ docker-compose.yml | 38 +++++++++++++- docker-scripts.sh | 1 + tests | 1 + 5 files changed, 153 insertions(+), 4 deletions(-) create mode 100644 data/boltz/boltz.conf diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9bfb838..2f8be2e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,10 +4,10 @@ jobs: regtest: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Run tests run: | - git clone https://github.com/lnbits/lnbits-legend.git - docker build -t lnbitsdocker/lnbits-legend lnbits-legend + git clone https://github.com/lnbits/lnbits.git + docker build -t lnbits/lnbits lnbits chmod +x ./tests ./tests diff --git a/data/boltz/boltz.conf b/data/boltz/boltz.conf new file mode 100644 index 0000000..8293862 --- /dev/null +++ b/data/boltz/boltz.conf @@ -0,0 +1,111 @@ +[api] +host = "boltz" +port = 9_001 + +[grpc] +host = "0.0.0.0" +port = 9_000 + +[postgres] +host = "boltz-postgres" +port = 5432 +database = "boltz" +username = "boltz" +password = "boltz" + +[sidecar] + [sidecar.grpc] + host = "127.0.0.1" + port = 9003 + + [sidecar.ws] + host = "0.0.0.0" + port = 9004 + + [sidecar.api] + host = "0.0.0.0" + port = 9005 + +[[pairs]] +isLegacy = true +base = "BTC" +quote = "BTC" +rate = 1 +fee = 0.5 +swapInFee = 0.1 +maxSwapAmount = 40_294_967 +minSwapAmount = 50_000 + + [pairs.timeoutDelta] + chain = 1440 + reverse = 1440 + swapMinimal = 1440 + swapMaximal = 2880 + swapTaproot = 10080 + +[[pairs]] +isLegacy = true +base = "L-BTC" +quote = "BTC" +fee = 0.25 +swapInFee = 0.1 +rate = 1 +maxSwapAmount = 40_294_967 +minSwapAmount = 100 + + [pairs.submarineSwap] + minSwapAmount = 1_000 + minBatchedAmount = 21 + + [pairs.chainSwap] + minSwapAmount = 25_000 + + [pairs.timeoutDelta] + chain = 1440 + reverse = 1440 + swapMinimal = 1440 + swapMaximal = 2880 + swapTaproot = 10080 + +[[currencies]] +symbol = "BTC" +network = "bitcoinRegtest" +minWalletBalance = 10_000_000 +minChannelBalance = 10_000_000 +maxSwapAmount = 40_294_967 +minSwapAmount = 10_000 +maxZeroConfAmount = 0 + + [currencies.chain] + # mempoolSpace = "http://mempool-web:8090/api" + host = "bitcoind" + zmqpubrawtx = "tcp://bitcoind:29000" + zmqpubrawblock = "tcp://bitcoind:29001" + port = 18_443 + cookie = "/root/.bitcoin/regtest/.cookie" + + wallet = "lnbits" + + [currencies.lnd] + host = "lnd-2" + port = 10_009 + certpath = "/data/lnd/tls.cert" + macaroonpath = "/data/lnd/data/chain/bitcoin/regtest/admin.macaroon" + + +[liquid] +symbol = "L-BTC" +network = "liquidRegtest" + +maxSwapAmount = 40_294_967 +minSwapAmount = 10_000 +maxZeroConfAmount = 40_294_967 + + [liquid.chain] + host = "elementsd" + port = 18884 + cookie = "/root/.elements/liquidregtest/.cookie" + zmqpubrawtx = "tcp://elementsd:31000" + zmqpubhashblock = "tcp://elementsd:31002" + + wallet = "lnbits" diff --git a/docker-compose.yml b/docker-compose.yml index a01a384..a8b1864 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -22,6 +22,42 @@ services: - lnbits-data:/app/data - ./data/lnd-3:/app/lnd:uid=1000,gid=1000 + boltz: + hostname: boltz + depends_on: + - lnd-2 + - boltz-postgres + restart: always + image: boltz/boltz:latest + ports: + - 9000:9000 + - 9001:9001 + entrypoint: "sh -c 'sleep 30; /boltz-backend/bin/boltzd'" + volumes: + - ./data/lnd-2:/data/lnd/ + - ./data/boltz/:/root/.boltz/ + - elements-data:/root/.elements + - bitcoin-data:/root/.bitcoin + + boltz-postgres: + hostname: boltz-postgres + restart: always + image: postgres:14-alpine + healthcheck: + test: ["CMD-SHELL", "pg_isready --dbname boltz --username boltz"] + interval: 5s + timeout: 30s + retries: 10 + start_period: 5s + environment: + - POSTGRES_DB=boltz + - POSTGRES_USER=boltz + - POSTGRES_PASSWORD=boltz + ports: + - 5432:5432 + expose: + - 5432 + bitcoind: hostname: bitcoind image: boltz/bitcoin-core:25.0 @@ -169,7 +205,7 @@ services: hostname: lnd-2 depends_on: - bitcoind - image: boltz/lnd:0.18.4-beta + image: boltz/lnd:0.19.3-beta restart: on-failure command: - --listen=lnd-2:9735 diff --git a/docker-scripts.sh b/docker-scripts.sh index 7e64274..c70f0bf 100644 --- a/docker-scripts.sh +++ b/docker-scripts.sh @@ -120,6 +120,7 @@ lnbits-elements-init(){ elements-cli-sim createwallet lnbits || elements-cli-sim loadwallet lnbits echo "mining 150 blocks..." elements-cli-sim -generate 150 > /dev/null + elements-cli-sim rescanblockchain } lnbits-init(){ diff --git a/tests b/tests index b547666..82a5ad6 100755 --- a/tests +++ b/tests @@ -57,6 +57,7 @@ done run "eclair-1 openchannels" 2 $(docker exec lnbits-eclair-1 curl -s http://localhost:8080/channels -X POST -u :lnbits| jq '. | length') run "eclair-1 blockHeight" $blockheight $(docker exec lnbits-eclair-1 curl -s http://localhost:8080/getinfo -X POST -u :lnbits| jq '.blockHeight') run "lnbits service status" "200" $(curl -s -o /dev/null -w "%{http_code}" "http://localhost:5001/") +run "boltz service status" "200" $(curl -s -o /dev/null --head -w "%{http_code}" "http://localhost:9001/version") # return non-zero exit code if a test fails if [[ "$failed" == "true" ]]; then