gun icon indicating copy to clipboard operation
gun copied to clipboard

Firing the gun in regtest

Open rajarshimaitra opened this issue 4 years ago • 1 comments

I am wondering what would it require to add regtest RPC backend support in gun. I want to be able to create regtest betting transaction and test out various betting scenarios. Can be useful for automated integration testing too.

Is it possible right now? If not what needs to be done to bet on local regtest?

rajarshimaitra avatar Nov 19 '21 17:11 rajarshimaitra

I don't think it's possible without some re-architecting. In mu gun branch on bdk I rely on the following functionality: https://github.com/LLFourn/bdk/blob/5108b75b44032f0461bf737cdc78b76023d7433e/src/blockchain/esplora/ureq.rs#L505

This tells gun if a tx has been confirmed, or if it is has been double spent and if so by what tx. We use this to tell if a bet has been cancelled or not. I don't think bitcoin rpc keeps track of this information.

It's possible this could be relaxed though. Bitcoin rpc can tell you if an output exists or not. It can't tell you why an output no longer exists but this is not as crucial.

Before including other blockchains other than esplora I'd focus on upstreaming the rest of the stuff from that branch to bdk before figuring out what to do from there. I think I want to make the main focus on improving the esplora support with partial sync and then after that branching out into other blockchain backends.

LLFourn avatar Nov 22 '21 02:11 LLFourn