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: member

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

    bitcoin-cli help createwallet

    Before:

    0Examples:
    1> bitcoin-cli createwallet "testwallet"
    2> 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

    0Examples:
    1> bitcoin-cli createwallet "testwallet"
    2> 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/
    3> bitcoin-cli createwallet "descriptors" false false "" true true true
    4> 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:

    0bitcoin-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: member

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

    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. S3RK requested review from laanwj on Apr 2, 2021
  12. laanwj approved
  13. laanwj commented at 1:28 pm on April 5, 2021: member
    Tested ACK 5039e0e55a7c9dd63a38c12fa60d244592de69e0
  14. laanwj merged this on Apr 5, 2021
  15. laanwj closed this on Apr 5, 2021

  16. sidhujag referenced this in commit fe20373b5b on Apr 5, 2021
  17. DrahtBot 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: 2024-07-03 10:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me