fort-nix / nix-bitcoin

A collection of Nix packages and NixOS modules for easily installing full-featured Bitcoin nodes with an emphasis on security.
https://nixbitcoin.org
MIT License
512 stars 108 forks source link

support CLNRest core-lightning plugin #739

Open tim-tx opened 1 month ago

tim-tx commented 1 month ago

CLNRest is a built-in core-lightning plugin providing some REST endpoints. I know we have clightning-rest, but I saw that in the Zeus wallet, clightning-rest is now deprecated while CLNRest is supported. It might be a nice enhancement to nix-bitcoin to support a built-in plugin with this functionality. As far as I can tell, nix-bitcoin uses the nixpkgs build of core-lightning where CLNRest is omitted because it requires some extra Python dependencies.

plebhash commented 1 month ago

I was trying to point a Zeus wallet to my nix-bitcoin clightning and faced this same blocker.

plebhash commented 1 month ago

As far as I can tell, nix-bitcoin uses the nixpkgs build of core-lightning where CLNRest is omitted because it requires some extra Python dependencies.

that means we should first report/fix this on nixpkgs, right?

tagging nixpkgs maintainers of clightning for awareness @jb55 @prusnak

prusnak commented 1 month ago

tagging nixpkgs maintainers of clightning for awareness @jb55 @prusnak

feel free to send a PR to nixpkgs and I will review it (ping me in the PR)

plebhash commented 1 month ago

digging a bit deeper, found some extra insights:

CLNRest was disabled on nixpkgs via this PR https://github.com/NixOS/nixpkgs/pull/293334 which is correlated to this draft PR here: https://github.com/fort-nix/nix-bitcoin/pull/688

688 seems stale (@erikarvstedt any updates?)

I wonder if it makes sense to start from this commit 73d4692a60227486f09cba28286037b12772f3b6 and create a new PR only for CLNRest (without the RTL stuff)

erikarvstedt commented 1 month ago

I can confirm that in Zeus 0.9.0 QR Code scanning no longer works for clightning-rest. This is a bug in Zeus, because clightning-rest is still supported, but deprecated. We'll fix this in https://github.com/fort-nix/nix-bitcoin/pull/688, which will be merged soon.

chrisguida commented 1 month ago

Have a look at https://github.com/daywalker90/clnrest-rs for the Rust version of clnrest, which should integrate a lot more easily with nix-bitcoin than the python version :)

kaloudis commented 1 month ago

I can confirm that in Zeus 0.9.0 QR Code scanning no longer works for clightning-rest. This is a bug in Zeus, because clightning-rest is still supported, but deprecated. We'll fix this in #688, which will be merged soon.

This shouldn't be the case. Could you please file an issue in the Zeus repo with steps on how to recreate?

erikarvstedt commented 4 weeks ago

@kaloudis, the bug seems to have been fixed in Zeus 0.9.1.

plebhash commented 4 weeks ago

@kaloudis, the bug seems to have been fixed in Zeus 0.9.1.

I ran lndconnect-clightning and scanned the QR code with Zeus 0.9.1

Zeus automatically chooses the following Node interface: [DEPRECATED] Core Lightning (c-lightning-REST)

When I try to connect, I consistently get Error: SOCKS server general failure


edit: after clicking RESTART a few times, now the error message is Error: Malformed reply from SOCKS server

erikarvstedt commented 4 weeks ago

The error I got with 0.9.0 was that after scanning a QR code encoding a c-lightning-rest:// URL, Zeus showed lnd as the node type and failed to add the node after manually switching the node type to clightning-rest.