Deprecate wallet `generate` RPC method #14299

issue jnewbery opened this issue on September 23, 2018
  1. jnewbery commented at 1:42 PM on September 23, 2018: member

    The generate RPC method:

    • was introduced in 2010
    • is now only used for testing
    • reaches across multiple components (wallet, mining)

    I propose we remove the wallet generate RPC method and update all tests to use the generatetoaddress RPC method. We can do this non-invasively in the test framework by adding a generate method to TestNode so that the individual tests do not need to be updated. We could also add a generate alias to the generatetoaddress RPC method.

    Doing this removes a wallet->server dependency and simplifies the wallet->server interface (#10973).

    I'm opening this issue before implementing in case anyone has objections.

  2. fanquake added the label Tests on Sep 23, 2018
  3. fanquake added the label RPC/REST/ZMQ on Sep 23, 2018
  4. sipa commented at 4:12 PM on September 23, 2018: member

    Sounds great to me.

  5. promag commented at 5:30 PM on September 23, 2018: member

    ACK. Deprecate in 0.18, remove in 0.19?

  6. MarcoFalke commented at 8:54 PM on September 24, 2018: member

    We can do this non-invasively in the test framework by adding a generate method to TestNode so that the individual tests do not need to be updated.

    I have no objections when done this way.

  7. jnewbery commented at 9:56 PM on September 24, 2018: member

    Thanks for the input! @laanwj - any thoughts on this? I suppose some people use generate for manual testing, but that can easily be replaced by something like bitcoin-cli generatetoaddress 1 $(bitcoin-cli getnewaddress)

  8. jnewbery cross-referenced this on Oct 12, 2018 from issue [wallet] Deprecate generate RPC method by jnewbery
  9. fanquake added this to the milestone 0.18.0 on Oct 13, 2018
  10. laanwj commented at 10:16 AM on October 16, 2018: member

    if the existence of the method is a problem architecturally I'm not opposed to removing it, it's "only" a testing method so it should affect less users than the other deprecations

  11. promag commented at 10:24 AM on October 16, 2018: member

    We could also add a generate alias to the generatetoaddress RPC method. @jnewbery you mean an alias on the server? that would make it depend on the wallet?

  12. laanwj commented at 10:45 AM on October 16, 2018: member

    nah, if you're going to change the API anyway, might as well really deprecate it, adding an alias to a different command probably just adds confusion

    the workaround is good enough:

    bitcoin-cli generatetoaddress 1 $(bitcoin-cli getnewaddress)
    
  13. laanwj commented at 11:15 AM on October 16, 2018: member

    was introduced in 2010

    FYI (not a comment on this issue), generate was introduced in 2015 in #5957, not in 2010. Before that time there were setgenerate and friends

  14. MarcoFalke closed this on Oct 23, 2018

  15. MarcoFalke referenced this in commit 3668bb335c on Oct 23, 2018
  16. nopara73 cross-referenced this on Oct 24, 2018 from issue Add alias to generate RPC with generatetoaddress RPC by nopara73
  17. sanket1729 cross-referenced this on Oct 25, 2018 from issue [tests] Test that nodes respond to getdata with notfound by MarcoFalke
  18. kristapsk cross-referenced this on May 13, 2019 from issue Tests fail with Bitcoin Core v0.18 by kristapsk
  19. Tibo-lg referenced this in commit dc78269ba7 on Aug 20, 2019
  20. Tibo-lg cross-referenced this on Aug 20, 2019 from issue Update regtest block generation command by Tibo-lg
  21. Tibo-lg referenced this in commit 87f696bf50 on Aug 28, 2019
  22. jonatack cross-referenced this on Jun 23, 2020 from issue Newsletters: add 103 (2020-06-24) by harding
  23. bitcoin locked this on Sep 8, 2021
  24. vijaydasmp referenced this in commit a0a946a221 on Sep 22, 2021
  25. vijaydasmp referenced this in commit 54c6fe8731 on Sep 24, 2021
  26. vijaydasmp referenced this in commit 4ac25a1ba3 on Sep 24, 2021
  27. vijaydasmp referenced this in commit 64277389d6 on Sep 25, 2021
  28. vijaydasmp referenced this in commit eda797313e on Sep 25, 2021
  29. vijaydasmp referenced this in commit f4c1030c51 on Sep 27, 2021
  30. UdjinM6 referenced this in commit e4f621fd57 on May 1, 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