-
Notifications
You must be signed in to change notification settings - Fork 95
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
Persist payment info to disk #90
Comments
Sure, if you want to. Because this is ultimately sample code, we should seek to ensure the implementation of everything is super straightforward, simple, and readable, and not care too much about performance or even feature-completeness. So, if we can't do this in a way that meets those goals, we shouldn't bother. With that in mind, we'll probably want to abstract out the |
That makes sense, I'll probably wait for this. I've mainly been looking for ways to build up my confidence contributing before jumping into rust-lightning, but I realize this sample repo probably doesn't need much work done on it, so I'll probably go pick up a good first issue there sometime soon! Anyway, thanks for the feedback! |
I saw this was commented TODO in
main.rs
, but I wanted to open an issue to see if others think this would be valuable to implement before I start working on a PR for it.Motivation
It seems this--keeping track of payment info between times that a node is on/offline--would be helpful to demonstrate to a user. I don't think this adds significant complexity compared to what's already here, but I'm open to what others have to say.
Implementing this
My initial thoughts for what needs to be done to implement this:
On startup, read
inbound_payments
andoutbound_payments
if they have been previously persisted.Whenever
inbound_payments
oroutbound_payments
gets updated, persist payment info to disk.Haven’t totally fleshed out what’s the best way to persist/update payment info, but considering some of the following:
read_payment_info
andpersist_payment_info
functions todisk.rs
.Writeable
trait (and maybeReadable
) onPaymentInfoStorage
so that we can persist usingFilesystemPersister
similar to how other things are persisted.inbound_payments
andoutbound_payments
into 2 different files to not complicate serializing payment infoWhere does payment info get updated?
main.rs
inbound_payments
|Event::PaymentClaimed
outbound_payments
|Event::PaymentSent
outbound_payments
|Event::PaymentFailed
cli.rs
inbound_payments
|get_invoice
outbound_payments
|send_payment
outbound_payments
|keysend
The text was updated successfully, but these errors were encountered: