-
Notifications
You must be signed in to change notification settings - Fork 79
Add initializing wallet configuration with bdk-cli wallet init
#203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
9e56084
to
b3966e3
Compare
Pull Request Test Coverage Report for Build 17438777973Details
💛 - Coveralls |
b3966e3
to
bf14df8
Compare
I like the approach for loading the config file parameters if the file exists, but is there a reason you didn't add a CLI Creating the config file in rust should be easier to maintain/keep in sync than your |
Alright, I will update. |
bf14df8
to
36ee973
Compare
bdk-cli wallet init
5125cf8
to
fcf7ce8
Compare
@notmandatory I have updated the PR |
f77b1da
to
70a5390
Compare
70a5390
to
9461e85
Compare
- add config.rs to store and retrieve values - add toml and serde crates for desearilizing and reading values - update utils, commands and handlers files to use values from config.toml -refactor prepare_wallet_db fn - fix clippy issues [Issue: bitcoindevkit#192]
- update wallet initialization to use `bdk-cli wallet init` command directly and read walletopts - update README for how to use the bdk-cli wallet init command - fix clippy warnings - update CHANGELOG [Issue: bitcoindevkit#192]
9461e85
to
5d9feb0
Compare
I need to start keeping track of all these awesome new features I honestly see the PRs come in and can't keep up. This is super cool. |
Thank you @thunderbiscuit |
c902975
to
9549e09
Compare
- move init subcommand to use existing walletopts - add --use-config to use saved config - add fetching required params before clap parsing
9549e09
to
0f6b320
Compare
I spent some time today reviewing and even though this looks like a workable way to do it and is based on my suggestion I'm afraid it's going to be a hassle to maintain. I've been experimenting with somehow using the different clap parsing functions (https://docs.rs/clap/latest/clap/trait.Parser.html) but so far haven't figured out a better way. I'd like to keep thinking about it. We might have to simplify the problem somehow such as by not trying to merge loaded and CLI args. |
Thank you @notmandatory. Also, for the Parser trait, I read that it does not allow interacting with an external resource such as reading a file as I would want it. I will also be trying out other approaches in case there is a cleaner way to handle it. |
How about something like:
|
Description
This PR adds
bdk-cli wallet init
command to save wallet configuration information toconfig.toml
file in the data directory.Fixes #192
Notes to the reviewers
serde
crate frombdk_wallet
did not offer thederive
featureChangelog notice
init
to save wallet configs--use-config
to use saved configs for a walletChecklists
All Submissions:
cargo fmt
andcargo clippy
before committingNew Features:
CHANGELOG.md