joule-labs / joule-extension

Lightning payments extension for Chrome
MIT License
353 stars 62 forks source link

C-Lightning node compatibility #14

Open wbobeirne opened 5 years ago

wbobeirne commented 5 years ago

C-Lightning has an HTTP RPC interface as well, but it's different from LND, so we'll need to support that. Documentation is here: https://github.com/ElementsProject/lightning#further-information

renepickhardt commented 5 years ago

Great to see that you continue your work on it. I might be able to help out with c Lightning. I guess there would have to be quite some code changes as there are no macaroons and ssl certificates.

stevenroose commented 5 years ago

I'd say a standard interface for different node types would make sense. Then you can have 2 or more different impls.

johneakin commented 5 years ago

This would be great!

j-asefa commented 5 years ago

Very interested in seeing this added to Joule. C-lightning doesn't seem to have any way to do remote authentication, although there is lightning-charge (https://github.com/ElementsProject/lightning-charge) which seems to provide a REST API with authentication

wbobeirne commented 5 years ago

Yep, that's the blocker for me right now. I'm going to wait for a little more consensus around the most common c-lightning client / auth plugin before I build out an integration.

Lightning-charge looks interesting, but it also looks like it's much more geared towards developers accepting payments via applications. Joule's really more focused on the user / consumer side, so I'm not inclined to build an integration on top of it at this point.

fiatjaf commented 5 years ago

Probably all c-lightning users that use it for personal ends have the Spark wallet installed. It provides its own authentication mechanism and exposes the lightningd RPC over HTTP. It goes like curl 'https://<domain>/rpc' -H 'content-type: application/json' -H 'x-requested-with: spark-rpc' -H 'x-access: <token>' -d '{"method":"getinfo","params":[]}'.

We just have to find a way to grab that token in a reliable manner (besides inspecting the browser network logs).

grubles commented 5 years ago

I wanted to circle back to this as Joule seems really cool. As @fiatjaf mentioned, Spark seems to be the most commonly used client with c-lightning. I haven't dived too much into it but it seems what fiatjaf is referring to (Spark server + Joule) is doable. Some info here: https://github.com/shesek/spark-wallet#server-installation

fiatjaf commented 5 years ago

While this is not resolved, I'll point you to my https://github.com/fiatjaf/kwh/, a webln-enabled extension that talks to a Spark server.

wbobeirne commented 5 years ago

Nice work @fiatjaf! Hopefully I'll be hot on your heels.

Kukks commented 4 years ago

There is also http://github.com/saubyk/c-lightning-rest out now which is a REST api for clightning that uses macaroons for auth. It's used for both RTL and Zeus which both both support LND and C-lightning now.