From 86ab6cdd21e0ce67ade3fb97d14471ff3d1fb5b7 Mon Sep 17 00:00:00 2001 From: pm47 Date: Tue, 27 May 2025 15:41:41 +0200 Subject: [PATCH] Add Phoenixd support (#987) * add phoenixd fragment * define phoenixd as lightning implementation * add btcpayserver section and hardcoded api password * set correct phoenix datadir * remove phoenixd->btcpayserver dependency * use phoenixd 0.6.0 * added phoenix-cli scripts --- .../crypto-definitions.json | 36 ++++++++++++------- .../docker-fragments/phoenixd.yml | 31 ++++++++++++++++ .../src/CryptoDefinition.cs | 1 + docker-compose-generator/src/Program.cs | 4 +++ phoenix-cli.ps1 | 1 + phoenix-cli.sh | 3 ++ 6 files changed, 64 insertions(+), 12 deletions(-) create mode 100644 docker-compose-generator/docker-fragments/phoenixd.yml create mode 100755 phoenix-cli.ps1 create mode 100755 phoenix-cli.sh diff --git a/docker-compose-generator/crypto-definitions.json b/docker-compose-generator/crypto-definitions.json index 40a9475..d299288 100644 --- a/docker-compose-generator/crypto-definitions.json +++ b/docker-compose-generator/crypto-definitions.json @@ -4,83 +4,95 @@ "CryptoFragment": "litecoin", "CLightningFragment": null, "LNDFragment": null, - "EclairFragment": null + "EclairFragment": null, + "PhoenixdFragment": null }, { "Crypto": "btc", "CryptoFragment": "bitcoin", "CLightningFragment": "bitcoin-clightning", "LNDFragment": "bitcoin-lnd", - "EclairFragment": "bitcoin-eclair" + "EclairFragment": "bitcoin-eclair", + "PhoenixdFragment": "phoenixd" }, { "Crypto": "btx", "CryptoFragment": "bitcore", "CLightningFragment": null, "LNDFragment": null, - "EclairFragment": null + "EclairFragment": null, + "PhoenixdFragment": null }, { "Crypto": "btg", "CryptoFragment": "bgold", "CLightningFragment": null, "LNDFragment": "bgold-lnd", - "EclairFragment": null + "EclairFragment": null, + "PhoenixdFragment": null }, { "Crypto": "ftc", "CryptoFragment": "feathercoin", "CLightningFragment": null, "LNDFragment": null, - "EclairFragment": null + "EclairFragment": null, + "PhoenixdFragment": null }, { "Crypto": "grs", "CryptoFragment": "groestlcoin", "CLightningFragment": "groestlcoin-clightning", "LNDFragment": "groestlcoin-lnd", - "EclairFragment": "groestlcoin-eclair" + "EclairFragment": "groestlcoin-eclair", + "PhoenixdFragment": null }, { "Crypto": "via", "CryptoFragment": "viacoin", "CLightningFragment": null, "LNDFragment": null, - "EclairFragment": null + "EclairFragment": null, + "PhoenixdFragment": null }, { "Crypto": "dash", "CryptoFragment": "dash", "CLightningFragment": null, "LNDFragment": null, - "EclairFragment": null + "EclairFragment": null, + "PhoenixdFragment": null }, { "Crypto": "doge", "CryptoFragment": "dogecoin", "CLightningFragment": null, "LNDFragment": null, - "EclairFragment": null + "EclairFragment": null, + "PhoenixdFragment": null }, { "Crypto": "mona", "CryptoFragment": "monacoin", "CLightningFragment": null, "LNDFragment": null, - "EclairFragment": null + "EclairFragment": null, + "PhoenixdFragment": null }, { "Crypto": "xmr", "CryptoFragment": "monero", "CLightningFragment": null, "LNDFragment": null, - "EclairFragment": null + "EclairFragment": null, + "PhoenixdFragment": null }, { "Crypto": "lbtc", "CryptoFragment": "liquid", "CLightningFragment": null, "LNDFragment": null, - "EclairFragment": null + "EclairFragment": null, + "PhoenixdFragment": null } ] diff --git a/docker-compose-generator/docker-fragments/phoenixd.yml b/docker-compose-generator/docker-fragments/phoenixd.yml new file mode 100644 index 0000000..425209e --- /dev/null +++ b/docker-compose-generator/docker-fragments/phoenixd.yml @@ -0,0 +1,31 @@ +version: "3" + +services: + phoenixd: + image: acinq/phoenixd:0.6.0 + container_name: phoenixd + restart: unless-stopped + networks: + - default + command: [ + "--chain=${NBITCOIN_NETWORK:-regtest}", + "--http-password=ca2e61de4dbab98a0c0ed9a8713ec95b" + ] + expose: + - "9740" + volumes: + - "phoenixd_datadir:/phoenix/.phoenix" + + btcpayserver: + environment: + BTCPAY_BTCLIGHTNING: "type=phoenixd;server=http://phoenixd:9740;password=ca2e61de4dbab98a0c0ed9a8713ec95b" + volumes: + - "phoenixd_datadir:/etc/phoenix" + links: + - phoenixd + +volumes: + phoenixd_datadir: + +exclusive: + - lightning \ No newline at end of file diff --git a/docker-compose-generator/src/CryptoDefinition.cs b/docker-compose-generator/src/CryptoDefinition.cs index f4d1ae4..d117db4 100644 --- a/docker-compose-generator/src/CryptoDefinition.cs +++ b/docker-compose-generator/src/CryptoDefinition.cs @@ -7,5 +7,6 @@ public string CLightningFragment { get; set; } public string LNDFragment { get; set; } public string EclairFragment { get; set; } + public string PhoenixdFragment { get; set; } } } \ No newline at end of file diff --git a/docker-compose-generator/src/Program.cs b/docker-compose-generator/src/Program.cs index 661a970..aba2264 100644 --- a/docker-compose-generator/src/Program.cs +++ b/docker-compose-generator/src/Program.cs @@ -81,6 +81,10 @@ namespace DockerGenerator { fragments.Add(crypto.EclairFragment); } + if (composition.SelectedLN == "phoenixd" && crypto.PhoenixdFragment != null) + { + fragments.Add(crypto.PhoenixdFragment); + } } foreach (var fragment in composition.AdditionalFragments) diff --git a/phoenix-cli.ps1 b/phoenix-cli.ps1 new file mode 100755 index 0000000..445f039 --- /dev/null +++ b/phoenix-cli.ps1 @@ -0,0 +1 @@ +docker exec phoenixd /phoenix/phoenix-cli --http-password ca2e61de4dbab98a0c0ed9a8713ec95b "$@" $args diff --git a/phoenix-cli.sh b/phoenix-cli.sh new file mode 100755 index 0000000..302221b --- /dev/null +++ b/phoenix-cli.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +docker exec phoenixd /phoenix/phoenix-cli --http-password ca2e61de4dbab98a0c0ed9a8713ec95b "$@"