Additional Bitcoin-Qt capability to mine regtest blocks #28387

issue miketwenty1 openend this issue on September 1, 2023
  1. miketwenty1 commented at 10:33 pm on September 1, 2023: contributor

    Please describe the feature you’d like to see added.

    Able to mine blocks through the Bitcoin-Qt while in Regtest mode.

    Feature addresses none ideal uX with Bitcoin-Qt and mining regtest blocks. Currently if you want to use the console of Bitcoin-Qt you would need to close this out and then use bitcoin-cli separately to mine blocks.

    When running Bitcoin-Qt in regtest mode it’s clear by seeing a blue Bitcoin logo instead of the orange one. However, there is no way to thoroughly test some capabilities without having the ability to mine blocks.

    Describe the solution you’d like

    Bitcoin-Qt is able to use generate or -generate flag similar to what bitcoin-cli can do.

    Currently if you run generate the response is:

    0has been replaced by the -generate cli option. Refer to -help for more information.
    1 (code -1)
    

    Describe any alternatives you’ve considered

    Having bitcoin-cli shipped with all binaries on bitcoincore.org.

    Please leave any additional context

    low priority

  2. miketwenty1 added the label Feature on Sep 1, 2023
  3. sipa commented at 10:35 pm on September 1, 2023: member
    See my updated answer on stackexchange; you can just use getnewaddress + generatetoaddress from the RPC console.
  4. miketwenty1 commented at 10:47 pm on September 1, 2023: contributor

    this works like a charm:

    0# generates a new address
    1getnewaddress
    2bcrt1qw6s75nqguln9xzjk7y75thfjpc7ylkq8y5yvnr
    3
    4# generates 100 blocks and sends to address.
    5generatetoaddress 100 bcrt1qw6s75nqguln9xzjk7y75thfjpc7ylkq8y5yvnr
    
  5. miketwenty1 closed this on Sep 1, 2023

  6. hebasto commented at 12:02 pm on November 21, 2023: member
  7. bitcoin locked this on Nov 20, 2024

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-12-30 15:12 UTC

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