Closed Sjors closed 5 months ago
There is @rustyrussell who it is working on a paginator-like API, but I agree we should fix in some way this problem.
I had also a paginator API with implemented somewhere, so someday we will be able to solve this problem for sure :)
Since this has been requested a number of times before I opened #6348 to track progress, and collect discussions around this feature. Marking this as duplicate so we don't distribute the discussion across many topics.
The output for
listpays
is rather large for me. I'm usually only interested in the last one or two, namely to check:My current workaround is to just do
lightning-cli listpays | tail -n 200
, but I'd rather be able to do something likelistpays -2
(or just2
, assuming most of the time you want the most recent thing).Another workaround is to pass the full result into JQ and get the last element(s).
Same story for
listinvoices
; those 10K+ keysends crash my SSH connection if I forget to pipe tail.I suspect clients like c-lightning-REST would also benefit from the ability to fetch only recent transactions, so mobile apps like Zeus can be more responsive. For that use case you probably want an offset argument too.