You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
lnd's package lnrpc contains a function SubscribeInvoices() which allow an RPC client to subscribe to invoice events (creation, settlement). When subscribing to the settlement events, the web service containing the paywalled API could cache the settled invoices, so when the second request arrives with the preimage header, only the cache needs to be checked and then the response could immediately be sent, without having to send an RPC message to lnd to find out whether the corresponding invoice was settled.
This doesn't lead to less traffic between the web service and lnd, and might create some overhead on the web service, because it might cache some invoices that are never going to be "claimed" by any web service client, but the lowered request duration from the perspective of the client might still be worth it.
The text was updated successfully, but these errors were encountered:
philippgille
changed the title
Speed up actual response by subscribing to lnd invoice settlement events
Speed up actual response by subscribing to and caching lnd invoice settlement events
Aug 26, 2018
lnd's package
lnrpc
contains a functionSubscribeInvoices()
which allow an RPC client to subscribe to invoice events (creation, settlement). When subscribing to the settlement events, the web service containing the paywalled API could cache the settled invoices, so when the second request arrives with the preimage header, only the cache needs to be checked and then the response could immediately be sent, without having to send an RPC message to lnd to find out whether the corresponding invoice was settled.This doesn't lead to less traffic between the web service and lnd, and might create some overhead on the web service, because it might cache some invoices that are never going to be "claimed" by any web service client, but the lowered request duration from the perspective of the client might still be worth it.
The text was updated successfully, but these errors were encountered: