wallet: createwallet examples for descriptor wallets #21302

pull S3RK wants to merge 3 commits into bitcoin:master from S3RK:create_descriptor_help changing 4 files +104 −0
  1. S3RK commented at 8:02 AM on February 26, 2021: contributor

    Rationale: make descriptor wallets more visible and just a bit easier to setup

    bitcoin-cli help createwallet

    Before:

    Examples:
    > bitcoin-cli createwallet "testwallet"
    > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "createwallet", "params": ["testwallet"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
    

    After

    Examples:
    > bitcoin-cli createwallet "testwallet"
    > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "createwallet", "params": ["testwallet"]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
    > bitcoin-cli createwallet "descriptors" false false "" true true true
    > curl --user myusername --data-binary '{"jsonrpc": "1.0", "id": "curltest", "method": "createwallet", "params": ["descriptors", false, false, "", true, true, true]}' -H 'content-type: text/plain;' http://127.0.0.1:8332/
    
  2. fanquake added the label Wallet on Feb 26, 2021
  3. laanwj added the label Docs on Feb 26, 2021
  4. in src/wallet/rpcwallet.cpp:2742 in 9398176405 outdated
    2737 | @@ -2738,6 +2738,8 @@ static RPCHelpMan createwallet()
    2738 |          RPCExamples{
    2739 |              HelpExampleCli("createwallet", "\"testwallet\"")
    2740 |              + HelpExampleRpc("createwallet", "\"testwallet\"")
    2741 | +            + HelpExampleCli("createwallet", "\"descriptors\" false false \"\" true true true")
    2742 | +            + HelpExampleRpc("createwallet", "\"descriptors\", false, false, \"\", true, true, true")
    


    laanwj commented at 9:13 AM on February 26, 2021:

    It would be nice to have a way to specify examples using bitcoin-cli -named. Passing a list of booleans like this is hard to understand and hard to get right "which one do i need to toggle".

    i guess this would be:

    bitcoin-cli -named createwallet wallet_name=descriptors avoid_reuse=true descriptors=true load_on_startup=true
    

    (edit: here, see, i already made the mistake of confusing load_on_startup with external_signer :blush: )


    S3RK commented at 1:26 PM on February 26, 2021:

    Totally! I'll look into it


    S3RK commented at 9:09 AM on March 3, 2021:

    Done

  5. laanwj commented at 2:06 PM on February 26, 2021: member

    I've implemented HelpExampleCliNamed here and used it for a createwallet example, feel free to take it over: https://github.com/laanwj/bitcoin/tree/2021-02-namedcli-help

    (I guess we can do a similar HelpExampleCliNamed)

  6. rpc: Add HelpExampleRpcNamed 5d5a90e819
  7. rpc: Add HelpExampleCliNamed and use it for `createwallet` doc 591735ef0b
  8. test: HelpExampleCliNamed and HelpExampleRpcNamed 5039e0e55a
  9. S3RK force-pushed on Mar 3, 2021
  10. DrahtBot commented at 6:29 PM on March 3, 2021: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #20546 (wallet: check for non-representable CFeeRates by jonatack)
    • #16365 (Log RPC parameters (arguments) if -debug=rpcparams by LarryRuane)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  11. DrahtBot cross-referenced this on Mar 3, 2021 from issue wallet: check for non-representable CFeeRates by jonatack
  12. DrahtBot cross-referenced this on Mar 4, 2021 from issue Log RPC parameters (arguments) if -debug=rpcparams by LarryRuane
  13. S3RK requested review from laanwj on Apr 2, 2021
  14. laanwj approved
  15. laanwj commented at 1:28 PM on April 5, 2021: member

    Tested ACK 5039e0e55a7c9dd63a38c12fa60d244592de69e0

  16. laanwj merged this on Apr 5, 2021
  17. laanwj closed this on Apr 5, 2021

  18. sidhujag referenced this in commit fe20373b5b on Apr 5, 2021
  19. luke-jr cross-referenced this on Jul 7, 2021 from issue Bugfix: Workaround UniValue push_back(bool) limitation with push_back(UniValue(bool)) by luke-jr
  20. Vilasinee99 cross-referenced this on Feb 5, 2022 from issue . by Vilasinee99
  21. bitcoin locked this on Aug 18, 2022

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-20 06:54 UTC