-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
c-lightning backend #6
Conversation
I can run this with a regtest lightningd and see my only channel in the list. I can select it and see more info. Should lntop have more options (I didn't write the invoice generation and payment stuff yet) besides these (I didn't try it with lnd)? However, I tried to run the same binaries with a mainnet lightningd that has about 20 channels and it crashes upon start (actually I don't know if it crashes, it just flashes the screen and returns to the terminal, nothing is printed, but it doesn't exit, just stays there, doing nothing). The logs don't show anything (I don't know what should I write in the logs config, currently it says "production" because I tried other values and that caused errors). I need some help! |
Thank you for your wrok I would be very happy to add this backend ! |
So what are these methods for generating, watching and paying invoices in the backend interface? Do you plan on implementing these things in the future? |
Yes, it was mostly for testing, but they may be needed in the future for rebalancing channels. You can implement these methods with a return nil, nil for the moment. I will add a switch in pubsub to use only some methods according to backend. |
Pardon the digression, but isn't it a good idea to implement that basic functionality and so people could use lntop as their wallet instead of Zap or Spark? Maybe there could be a separate screen for paying, receiving and listing transactions, accessible through F5 and F5 or something like that, I don't know. |
Yes it would be great, I was thinking about a sidebar menu toggled by F2 or another key with different link to different panels, but I am trying to have a stable and minimal version of the software first. |
Last request: can you comment or document somehow where the methods expect satoshis, millisatoshis or bitcoin units? Or is it satoshis everywhere? c-lightning deals with millisatoshis in most places, satoshis in some places. It can be confusing. |
For the moment it is satoshis everywhere. I will add a CONTRIBUTING.md soon 👍 |
As far as I could grasp, I'm setting |
I think this check does not pass |
lntop/network/models/invoice.go Lines 9 to 40 in 2f18d9a
Some of these fields don't make sense in the context of c-lightning. For example, there isn't an "index" that monotonically increases, instead there are unique "labels" that must be manually provided. I don't know if it makes sense for lntop to keep track of these things somehow or if we could just discard this label. lntop/network/backend/mock/mock.go Lines 99 to 106 in 2f18d9a
Seeing this now I think definitely lntop should keep track of the label. c-lightning only allows locating the invoice with its label, not with the payment hash. Maybe this function should be given a pointer to a |
lntop/network/models/channel.go Lines 30 to 53 in 2f18d9a
Here also there are some fields that aren't available on c-lightning, like the information about the on-chain fees for the channel. Maybe we could just ignore them, but I'm saying so you can decide. Does |
I don't know. In some places It can't be. For example, Line 15 in 2f18d9a
int64 there's no way to specify msats there. If you're just getting the data from lnd for this currently I would bet lnd is giving that piece of data as msat instead of sat, right?
|
You are right for the fee and the choice of millisatoshis, I thought milli-satoshis were a premature optimisation by the lnd team, but even lightningd use it. I will change fields type for float64: the basic unit will be satoshis (ex Yes lnd and lightningd does not have same fields for managing channels, I will try to find a easy way to converge to a same interface. Maybe all fields could be pointer and a Invoice and Payreq are different. Invoice include the payreq information for payment and the information of the settlement (settle date and chosen route + fee). Some fields are missing in the current Invoice model. |
Hello @fiatjaf, thank you again for your commitment. I am not a big fan of gjson.Result and I was thinking about using https://github.com/niftynei/glightning for the c-lightning backend, which could help for the creation of a plugin for events subscriptions. I am on my way to try c-lightning and learn about the different fields and methods. |
No description provided.