Uh oh!
There was an error while loading. Please reload this page.
Add wallet option to select which blockchain client to use - #37
Add wallet option to select which blockchain client to use#37notmandatory wants to merge 4 commits into
Conversation
a0e3d61 to
73707ffCompare73707ff to
3c8b51fComparerajarshimaitra
commented
Aug 4, 2021
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. |
notmandatory
commented
Aug 4, 2021
@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. |
rajarshimaitra
commented
Aug 5, 2021
Yes that makes sense. Better to do it via separate PR. |
Description
Added the
--blockchain_clientor-bwallet 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. Currentlyelectrumis 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_clientoption 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 fmtandcargo clippybefore committingNew Features:
CHANGELOG.mdBugfixes: