There is still one audit issue that I can't figure out how to fix, I created #85 to track it.
### 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:
* [ ] I've added tests for the new feature
* [ ] I've added docs for the new feature
* [ ] I've updated `CHANGELOG.md`
#### Bugfixes:
* [ ] This pull request breaks the existing API
* [ ] I've added tests to reproduce the issue which are now passing
* [ ] I'm linking the issue being fixed by this PR
<!-- You can erase any parts of this template not applicable to your Pull Request. -->
### Description
Fixes #40
cc @thunderbiscuit
### 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:
* [ ] I've added tests for the new feature
* [ ] I've added docs for the new feature
* [ ] I've updated `CHANGELOG.md`
<!-- You can erase any parts of this template not applicable to your Pull Request. -->
### Description
Fixes https://github.com/bitcoindevkit/bdk-cli/issues/55. I decided to go for one feature flag for each backends as they made dependency management easier. Because different backend will have different dependency, and we don't wanna have redundant ones. Also it makes the commands a little shorter.
### Notes to the reviewers
Right now its not that useful because the backend APIs are not exposed. So I can't really do much other than sync/send in the command line. (unlike testnet we cannot send coins to bdk from outside of local regtest node). So to make it useful in repl mode as described in the issue, we also have to expose the blockchain apis in bdk-cli command in some way (at least the basic stuffs, address, send, generate). Looking for suggestions on this.
usage looks like this:
```
cargo run --features regtest-rpc -- wallet --descriptor "wpkh(tpubEBr4i6yk5nf5DAaJpsi9N2pPYBeJ7fZ5Z9rmN4977iYLCGco1VyjB9tvvuvYtfZzjD5A8igzgw3HeWeeKFmanHYqksqZXYXGsw5zjnj7KM9/*)" sync
{}
```
Although I am having trouble connecting to the esplora end of electrs. Not sure whats the issue, will have to look more.
### 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:
* [ ] I've added tests for the new feature
* [ ] I've added docs for the new feature
* [x] I've updated `CHANGELOG.md`
rajarshimaitra [Sun, 9 Jan 2022 17:29:46 +0000 (22:59 +0530)]
Add auto backend deployment
This adds bitcoind and electrsd deployment and management for each kind
of feature flags. The wallet then gets connected to the backend. All the
backend related args for bdk-cli can be omitted in regtest-* mode.
Also added `verify` feature flag which enables transaction verification against consensus rules during sync.
I also had to disable the `reserves` tests and that feature will be broken until we can get it updated to use `bdk` `0.17` also. I created an issue https://github.com/weareseba/bdk-reserves/issues/4.
### 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:
* [ ] I've added tests for the new feature
* [ ] I've added docs for the new feature
* [x] I've updated `CHANGELOG.md`
<!-- You can erase any parts of this template not applicable to your Pull Request. -->
### Description
Because we didn't had `maybe_descriptor_wallet_name()` in repl, the following command would fail
```
$ ./target/debug/bdk-cli repl -d "wpkh([b8b575c2/84'/1'/0'/0]tprv8icWtRzy9CWgFxpGMLSdAeE4wWyz39XGc6SwykeTo13tYm14JkVVQAf7jz8WDDarCgNJrG3aEPJEqchDWeJdiaWpS3FwbLB9SzsN57V7qxB/*)"
thread 'main' panicked at 'We should always have a wallet name at this point', src/bdk_cli.rs:116:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
```
### 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
Re-licensing repo to dual MIT and Apache 2.0 and updating project name to "Bitcoin Dev Kit". I want to do this now before we get too many new contributors. Also because this project is being proposed for use in a commercial project so I want to clarify it is broadly licensed as is the rest of BDK.
This issue is based on https://github.com/bitcoindevkit/bdk/issues/301.
### Notes to the reviewers
If you're on the below list and agree with this change please add a comment with "I hereby license my previous contributions to Bitcoin Dev Kit under Apache 2.0 and MIT licenses."
* [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
<!-- You can erase any parts of this template not applicable to your Pull Request. -->
### Description
This PR adds a Resources section with links to resources, currently the docs on the bitcoindevkit.org website and the Tutorial series I made which is on youtube. Once Steve does the show with Conor next week we could add that to the list as well!
Bump version to 0.4.0 and add tag v0.4.0 for release.
### 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
This PR adds an optional `cookie` arg to pass on cookie file if user needs to use that instead of basic user:password based authentication.
bitcoin core will only generate a `.cookie` file if rpc username passwords are not set in `bitcoin.conf`. Thus cookie file doesn't have a default. User should only provide it if they know a cookie file exists, or else "File not found" error is returned.
### 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`
This fixes the help docs for the `repl` and `wallet` subcommands. The `repl` subcommand was showing the proxy options docs instead, and the `wallet` subcommand was showing the description from the `WalletSubCommand` enum.
This is a workaround for `structopt` issue #333, #391, #418; see https://github.com/TeXitoi/structopt/issues/333#issuecomment-712265332
### Notes to the reviewers
Before this PR this was showing:
```shell
$ cargo run --features esplora-ureq,compiler -- --help
...
SUBCOMMANDS:
compile Compile a miniscript policy to an output descriptor
help Prints this message or the help of the given subcommand(s)
key Key management sub-commands
repl Proxy Server options
wallet Wallet sub-commands
```
After this PR we get:
```shell
$ cargo run --features esplora-ureq,compiler -- --help
...
SUBCOMMANDS:
compile Compile a miniscript policy to an output descriptor
help Prints this message or the help of the given subcommand(s)
key Key management sub-commands
repl Enter REPL command loop mode
wallet Wallet options and sub-commands
```
### 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
#### Bugfixes:
* [ ] This pull request breaks the existing API
* [ ] I've added tests to reproduce the issue which are now passing
* [ ] I'm linking the issue being fixed by this PR
Steve Myers [Sun, 9 Jan 2022 21:57:11 +0000 (22:57 +0100)]
Fix repl and wallet help docs
This fixes the help docs for the repl and wallet subcommands. The repl subcommand was showing the proxy options docs instead, and the wallet subcommand was showing the description from the WalletSubCommand enum.
This is a workaround for structopt issue #333, #391, #418.
see https://github.com/TeXitoi/structopt/issues/333#issuecomment-712265332
if no wallet name was provided, use one derived from the descriptor
### Notes to the reviewers
Is there a better place to use wallet_name_from_descriptor so that the generated name shows up in the unit tests instead of the placeholder?
### 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
Steve Myers [Fri, 10 Dec 2021 04:21:30 +0000 (20:21 -0800)]
Limit rustyline version to >=9.0.0, <9.1.0
This is required because rustyline 9.1.0 uses rust edition 2021 which
this project has not yet adopted. See:
https://github.com/kkawakam/rustyline/pull/570
<!-- You can erase any parts of this template not applicable to your Pull Request. -->
### Description
<!-- Describe the purpose of this PR, what's being adding and/or fixed -->
bdk-cli had lots of ugly unwraps through out the code. All the unwraps inside the library (except tests) were removed and errors were propagated with `bdk::Error` type.
<!-- In this section you can include notes directed to the reviewers, like explaining why some parts
of the PR were done in a specific way -->
### 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
There was an inconsistency in `rpc` tests. The `RpcOpts` was missing from the wallet struct. This wasn't caught before because we didn't have `rpc` tests in CI. Fixed that too.
Also removed redundant wallet options from feature gated tests.
### 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
<!-- You can erase any parts of this template not applicable to your Pull Request. -->
### Description
To match with existing codecov of BDK, Tarpaulin based codecov in bdk-cli is changed to grcov.
### Notes to the reviewers
<!-- In this section you can include notes directed to the reviewers, like explaining why some parts
of the PR were done in a specific way -->
### 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
<!-- You can erase any parts of this template not applicable to your Pull Request. -->
### adding the commands for proof-of-reserves using the separate repository
<!-- Describe the purpose of this PR, what's being adding and/or fixed -->
### Notes to the reviewers
<!-- In this section you can include notes directed to the reviewers, like explaining why some parts
of the PR were done in a specific way -->
### 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
* [ ] I've added docs for the new feature
* [x] I've updated `CHANGELOG.md`
#### Bugfixes:
* [ ] This pull request breaks the existing API
* [ ] I've added tests to reproduce the issue which are now passing
* [ ] I'm linking the issue being fixed by this PR
<!-- In this section you can include notes directed to the reviewers, like explaining why some parts
of the PR were done in a specific way -->
### 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
Update MSRV to the current stable, 1.56.1 and update the `cargo.lock` file. Also removed the `rust-toolchain` file.
### Notes to the reviewers
I removed the `rust-toolchain` file because I don't think we need to lock users into a particular version (or force them to override it), and this file seem to primarily be used for projects using a specific nightly release, see: https://rust-lang.github.io/rustup/overrides.html#the-toolchain-file.
I also had to pin the `fd-lock` dependency because of a recent update to that crate to use the [`rustdoc::missing_doc_code_examples` feature which is only supported by `nightly`](https://doc.rust-lang.org/rustdoc/lints.html#missing_doc_code_examples) :disappointed: .
### 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
Steve Myers [Thu, 7 Oct 2021 23:06:59 +0000 (16:06 -0700)]
Add '--shrink' option to wallet bump_fee command
Replace `wallet bump_fee` command `--send_all` with new
`--shrink ADDRESS` option to reduce the output amount for the
specified address to increase RBF transaction fee.