batcher icon indicating copy to clipboard operation
batcher copied to clipboard

Add `deleteBatch` method

Open xsats opened this issue 5 years ago • 4 comments

I'm sure you must have discussed this, and there is likely a good reason for not including a 'deleteBatch' method at this point, but I think it may be useful in certain scenarios, likely mostly related to testing and error resolution (e.g. when I broke something in #3 ).

xsats avatar Sep 18 '20 09:09 xsats

Hi @xsats! Thanks for testing, it's very appreciated. Yes, more endpoints are going to be added to the Batcher, particularly functionalities to better "manage" batches and getting some stats. This version is quite minimal, but it's nevertheless used in production at Bull Bitcoin.

When you talk about deleteBatch, do you mean "cancelling" an ongoing batch? Or delete a past batch? Or just removing all the queued requests from the ongoing batch?

Kexkey avatar Sep 18 '20 14:09 Kexkey

Hi @Kexkey, thanks for your response. That all sounds great! I'd love to help in any way I can

Sorry - I should have been more clear. What I had in mind here was option 3 - a deleteBatch method that effectively empties the ongoing batch for a particular batcher or as you said - removes all queued requests from the ongoing batch.

xsats avatar Sep 18 '20 14:09 xsats

Are you a developer? If you want to contribute, you are very welcome!

Yes, removing current requests from a queue totally makes sense. In the branch "dequeueandpay" I added the dequeueAndPay endpoint that just removes a batchRequest from the queue and directly pay to the corresponding address via a standard spend (e.g a client wants to opt out from the next batch and is willing to pay the fees to be paid right away).

Kexkey avatar Sep 18 '20 14:09 Kexkey

Yep, we'd like to integrate the batcher in our upcoming platform and I'd love to contribute once I'm a bit more familiar with the project.

dequeuandpay sounds like another fantastic functionality!

xsats avatar Sep 18 '20 14:09 xsats