fa0454e9728ceea5bdbffb9ed0e51a32db7c74ab Create node backend once in repl mode (Steve Myers)
322f6f1a5506cb81809615ae98c82b2065b2c30f Update changelog (rajarshimaitra)
0ce84260d742e3fd28b47a6f00cccc16fdc7dfc3 Simplify main (rajarshimaitra)
4906764bb25973c95706d795097df55f60be0afd Add the integration test framework (rajarshimaitra)
b596c9f154224eed494db2162178ec14a2149937 Update utility (rajarshimaitra)
aa6a687c904eac52202e4d3fbdd1fe4e6954bacd Update nodes.rs (rajarshimaitra)
0eb2dc8a1dc31b3d0f2758ad64fd131f53ba1571 Update handlers (rajarshimaitra)
0212b48ed1c8432a7af1224840de974d2917790b Update commands (rajarshimaitra)
992915b6cab7e62eca80b42c1e374f3fbaa0e4af update cargo.toml (rajarshimaitra)
Pull request description:
### Description
fixes #62
fixes #76
On the name :
If Bitcoin wallet devs had to have a "calculator", this is what it might look like. One single interface to do all wallet and node operations.
This PR does the following
- Update electrsd to latest version. We need this to use it for out auto deployed backends.
- Add the remaining codes to `nodes.rs` module to define basic node operation apis on the `Nodes` enum.
- Add a new `node` command in ` CliSubCommand` which has its own subcommand `NodeSubCommand`, These subcommands are essentially `bitcoin-cli` calls. And only the basic ones are included so far. We can also compose multiple `bitcoin-cli` calls to create our own commands in future.
- Update the `handlers` to handle newly added `NodeSubCommands`.
- Update in `utils` :
- This includes handling auto blockchain client creation for `regtest-*` features.
- update on the directory creation workflow. We are creating many directories for many stuffs, and I was trying to figure out the easiest way to keep the whole datadir struct intact, no matter where the user points its `datadir` to. Note that now `datadir` is a global app option, not just available for `regtest` nodes. Default `datadir` is the previous `~/.bdk-bitcoin`.
- Finally add an integration test in `tests/integration.rs` that runs a basic wallet operation with a bdk-cli wallet connected to auto deployed regtest-bitcoin/electrum.
### Notes to the reviewers
@sandipndev @krtk6160. I feel this PR is now ready to try out #87 .
Also looking for more integration test ideas too add into.
basic `node` usage looks like this
```
$ ./target/debug/bdk-cli node --help
bdk-cli-node 0.5.0
Regtest Node mode
USAGE:
bdk-cli node <SUBCOMMAND>
FLAGS:
-h, --help
Prints help information
-V, --version
Prints version information
SUBCOMMANDS:
generate Generate blocks
getbalance Get Wallet balance
getinfo Get info
getnewaddress Get new address from node's test wallet
help Prints this message or the help of the given subcommand(s)
sendtoaddress Send to an external wallet address
```
The biggest benefit is I think in the `repl` mode. That now kinda becomes an integrated tool the like python interpreter to operate a bdk-cli and a bitcoin backend from one single interface.
I am excited to see what kind of demonstrations with bdk-cli we can create with this..
### Checklists
#### All Submissions:
* [x] I've signed all my commits
* [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk-cli/blob/master/CONTRIBUTING.md)
* [x] I ran `cargo fmt` and `cargo clippy` before committing
#### New Features:
* [x] I've added tests for the new feature
* [x] I've added docs for the new feature
* [x] I've updated `CHANGELOG.md`
ACKs for top commit:
notmandatory:
tACK
fa0454e9728ceea5bdbffb9ed0e51a32db7c74ab
Tree-SHA512: 919abcee8291d5181c77cc1e53c630d013504861a5325ddf1d9fc8269db45afa91298852902dffafd576c19eae74e62f675ccba625055b6464c6d73a76a29913