From: Riccardo Casatta Date: Wed, 10 Mar 2021 13:43:46 +0000 (+0100) Subject: Make repl and electrum default features X-Git-Tag: v0.3.0~66 X-Git-Url: http://internal-gitweb-vhost/script/%22https:/database/struct.CommandStringError.html?a=commitdiff_plain;h=568d34969872ed40858a0c1b980a7885c5f1296c;p=bdk-cli Make repl and electrum default features --- diff --git a/CHANGELOG.md b/CHANGELOG.md index 6645b0f..48f6d69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 #### Added - `CliSubCommand::Compile` enum variant and `handle_compile_subcommand()` function +- Make repl and electrum default features ### `bdk-cli` bin diff --git a/Cargo.toml b/Cargo.toml index c18da81..cff03dc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,7 +27,7 @@ clap = { version = "2.33", optional = true } regex = {version = "1", optional = true } [features] -default = [] +default = ["repl", "electrum"] repl = ["bdk/key-value-db", "clap", "dirs-next", "env_logger", "regex", "rustyline"] electrum = ["bdk/electrum"] esplora = ["bdk/esplora"] diff --git a/README.md b/README.md index e5d4886..ae506bb 100644 --- a/README.md +++ b/README.md @@ -14,32 +14,38 @@ To get usage information for the `bdk-cli` bin use the below command which retur available wallet options and commands: ```shell -cargo run --features repl,electrum +cargo run ``` To sync a wallet to the default electrum server: ```shell -cargo run --features repl,electrum,esplora -- wallet --descriptor "wpkh(tpubEBr4i6yk5nf5DAaJpsi9N2pPYBeJ7fZ5Z9rmN4977iYLCGco1VyjB9tvvuvYtfZzjD5A8igzgw3HeWeeKFmanHYqksqZXYXGsw5zjnj7KM9/*)" sync +cargo run -- wallet --descriptor "wpkh(tpubEBr4i6yk5nf5DAaJpsi9N2pPYBeJ7fZ5Z9rmN4977iYLCGco1VyjB9tvvuvYtfZzjD5A8igzgw3HeWeeKFmanHYqksqZXYXGsw5zjnj7KM9/*)" sync ``` To get a wallet balance with customized logging: ```shell -RUST_LOG=debug,sled=info,rustls=info cargo run --features repl,electrum,esplora -- wallet --descriptor "wpkh(tpubEBr4i6yk5nf5DAaJpsi9N2pPYBeJ7fZ5Z9rmN4977iYLCGco1VyjB9tvvuvYtfZzjD5A8igzgw3HeWeeKFmanHYqksqZXYXGsw5zjnj7KM9/*)" get_balance +RUST_LOG=debug,sled=info,rustls=info cargo run -- wallet --descriptor "wpkh(tpubEBr4i6yk5nf5DAaJpsi9N2pPYBeJ7fZ5Z9rmN4977iYLCGco1VyjB9tvvuvYtfZzjD5A8igzgw3HeWeeKFmanHYqksqZXYXGsw5zjnj7KM9/*)" get_balance ``` To generate a new extended master key, suitable for using in a descriptor: ```shell -cargo run --features repl,electrum -- key generate +cargo run -- key generate ``` To install dev version of `bdk-cli` from local git repo: ```shell cd -cargo install --path . --features repl,electrum,esplora +cargo install --path . bdk-cli help # to verify it worked -``` \ No newline at end of file +``` + +By default an electrum backend is used, to use esplora instead the relative feature must be enabled and the esplora address must be specified. Note we are enabling logs to see the calls to esplora. + +```shell +RUST_LOG=debug cargo run --features esplora -- wallet -e https://blockstream.info/api/ --descriptor "wpkh(tpubEBr4i6yk5nf5DAaJpsi9N2pPYBeJ7fZ5Z9rmN4977iYLCGco1VyjB9tvvuvYtfZzjD5A8igzgw3HeWeeKFmanHYqksqZXYXGsw5zjnj7KM9/*)" sync +```