rust-teos icon indicating copy to clipboard operation
rust-teos copied to clipboard

Merge bitcoin_cli::BitcoindClient and bitcoincore_rpc::Client

Open sr-gi opened this issue 3 years ago • 0 comments

We are currently using two different RPC clients to interact with bitcoind.

On the one hand, we have our local bitcoin_cli::BitcoindClient that is required for our ChainPoller (base for ChainMonitor and the chain::Listen trait implemented by the main tower components). This is a minimal bitcoin-cli implementation that only handles a handful of commands to pull data from bitcoind and it's mainly async.

On the other hand, bitcoincore_rpc::Client is a more extensive bitcoin-cli implementation that we use to, for instance, send and get transaction data from bitcoind. It also has several data structures that parse the json responses sent by bitcoind. This is sync.

In order to replace BitcoindClient by Client, we'd need the latter to implement an async version of the methods that the former is using. There are, currently, some efforts on that regard:

https://github.com/rust-bitcoin/rust-bitcoincore-rpc/pull/201 https://github.com/rust-bitcoin/rust-bitcoincore-rpc/pull/212

The latter is specially interesting.

sr-gi avatar Mar 11 '22 13:03 sr-gi