nix-bitcoin icon indicating copy to clipboard operation
nix-bitcoin copied to clipboard

support CLNRest core-lightning plugin

Open tim-tx opened this issue 1 year ago • 6 comments

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.

tim-tx avatar Sep 28 '24 18:09 tim-tx

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

plebhash avatar Oct 07 '24 19:10 plebhash

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

plebhash avatar Oct 07 '24 20:10 plebhash

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)

prusnak avatar Oct 07 '24 20:10 prusnak

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)

plebhash avatar Oct 07 '24 22:10 plebhash

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.

erikarvstedt avatar Oct 09 '24 19:10 erikarvstedt

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 :)

chrisguida avatar Oct 17 '24 23:10 chrisguida

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?

kaloudis avatar Oct 24 '24 14:10 kaloudis

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

erikarvstedt avatar Oct 24 '24 19:10 erikarvstedt

@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

plebhash avatar Oct 24 '24 21:10 plebhash

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.

erikarvstedt avatar Oct 24 '24 22:10 erikarvstedt

clnrest has been merged in #688

jonasnick avatar Nov 27 '24 21:11 jonasnick