L2-Technology / sensei

A lightning node implementation for everyone
https://l2.technology/sensei
Other
199 stars 39 forks source link

Add API to subscribe settled invoices #61

Open yzernik opened 2 years ago

yzernik commented 2 years ago

Something like the equivalent of SubscribeInvoices in LND: https://api.lightning.community/#subscribeinvoices

This will probably require gRPC, because it has a streaming response.

johncantrell97 commented 2 years ago

yeah we definitely need to add support for some grpc stream apis but for each one we add it needs to also have a websocket equivalent.

johncantrell97 commented 2 years ago

similar to how there is the generic NodeRequest/NodeResponse and AdminRequest/AdminResponse enums we will probably want generic mpsc::Channel's for sending/receiving this data over.

I think there probably needs to be an issue about setting up streaming apis in general that needs to happen in order to properly implement this and other endpoints.

yzernik commented 2 years ago

An alternative way to implement this is to do what c-lightning does: https://lightning.readthedocs.io/lightning-waitanyinvoice.7.html

The waitanyinvoice RPC command waits until an invoice is paid, then returns a single entry ...