-
Notifications
You must be signed in to change notification settings - Fork 65
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
Add wallet option to select which blockchain client to use #37
Add wallet option to select which blockchain client to use #37
Conversation
a0e3d61
to
73707ff
Compare
73707ff
to
3c8b51f
Compare
Thanks @notmandatory . This is a possible way to do it, but unfortunately, this also doesn't reduce our option arg namespace. So you will get the same conflicts with I think the blockchain selection flag is kinda redundant because we are selecting blockchain backend at the build time itself with I have tried around a few things and it seems to me that the easiest thing to do to solve all of our problems, is if we drop the default blockchain, and just specify a backend each time we build We can have the Without any blockchain feature To have a full wallet we will specify a backend with This will allow us to have the same arg option names for different blockchins. Because using feature guard removes the codes from the binary, so clap won't complain because for it those options don't exist. And I think we can reasonably explain this in the usage docs too. I have tried this manually, and it produces nice compact
If this is something we wanna do, I can add it to my open PR. It's not a big change set. |
@rajarshimaitra OK if this doesn't solve the conflicting params issue I'll close it and open a new one with your one blockchain client at a time solution. I'll add some docs and a compile error if users try building with two blockchain client features enabled. I'd rather keep this change as a separate PR to keep it simple to review. |
Yes that makes sense. Better to do it via separate PR. |
Description
Added the
--blockchain_client
or-b
wallet option so the user can explicitly select which blockchain client to use if multiple are available in the build. This will make adding new blockchain clients (such as #36) easier. Currentlyelectrum
is the default.I also added a default esplora server url so the user doesn't need to specify one if selecting that client, which is how the electrum and compact_filters clients work.
The new wallet options looks like this (when all optional clients are enabled
--features esplora,compact_filters
):Notes to the reviewers
In the docs for the
blockchain_client
option it displays the default[electrum]
even if that feature is not enabled and all possible blockchain clients are displayed even if only some are enabled. I couldn't find a nice way to fix this, but the cli will throw an error if a blockchain client is selected that wasn't configured as a feature in the build.I also simplified the CHANGELOG to focus on what a user would see as a change while using the bin.
Checklists
All Submissions:
cargo fmt
andcargo clippy
before committingNew Features:
CHANGELOG.md
Bugfixes: