Additional Bitcoin-Qt capability to mine regtest blocks #28387

issue miketwenty1 opened 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.

    Is your feature related to a problem, if so please describe it.

    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. <img width="75" alt="Screenshot 2023-09-01 at 6 23 34 PM" src="https://github.com/bitcoin/bitcoin/assets/7761473/d792ef8c-9078-4132-ab19-71af9ac6bf18"> 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:

    has been replaced by the -generate cli option. Refer to -help for more information.
     (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:

    # generates a new address
    getnewaddress
    bcrt1qw6s75nqguln9xzjk7y75thfjpc7ylkq8y5yvnr
    
    # generates 100 blocks and sends to address.
    generatetoaddress 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
Labels

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-04-28 03:13 UTC

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