There should be a way to check whether ZeroMQ is enabled #13526

issue domob1812 openend this issue on June 23, 2018
  1. domob1812 commented at 4:56 pm on June 23, 2018: contributor

    Bitcoin’s ZeroMQ interface is handy for software layered on top of the core daemon, like wallet frontends (or other similar things). It would be useful to have an easy way to query the daemon whether ZeroMQ publications are enabled and if so which address is configured for them. That way, such a frontend application can show a helpful message to the user if the daemon is not configured correctly.

    We could add a new RPC method for this, like getzmqinfo. In the simplest case, it would be called without arguments and just return a JSON object that contains whether each of the possible ZeroMQ endpoints (hashtx, hashblock, rawtx and rawblock) is configured and if so at which address.

  2. domob1812 commented at 4:56 pm on June 23, 2018: contributor
    With this issue, I want to get feedback on what everyone thinks about this idea. If it seems useful, I’m happy to implement it and provide a pull request.
  3. fanquake added the label RPC/REST/ZMQ on Jun 23, 2018
  4. ianwaldrop commented at 7:45 pm on June 25, 2018: none
    Such a method would also enable self-configuration of zmq ports by front-end applications given the simplest case outlined above.
  5. sipa commented at 1:06 am on June 26, 2018: member
    It seems reasonable to add a getzmqinfo RPC. Alternatively, we could also have an RPC to inspect the config/cmdline arguments generically.
  6. promag commented at 1:25 am on June 26, 2018: member

    we could also have an RPC to inspect the config/cmdline arguments generically

    It wouldn’t work with runtime configuration if implemented.

  7. domob1812 commented at 9:01 am on June 26, 2018: contributor

    While I think that an RPC to query for all command-line arguments might be useful as well (and if desired, I’m happy to implement that also), I agree with @promag that having a ZMQ-specific variant solves a somewhat different need and is useful in its own right.

    Is the interface proposed in the OP good? I. e., something like this:

    $ bitcoin-cli getzmqinfo
    {
      "hashtx": "tcp:/tcp://127.0.0.1:28332",
      "hashblock": "ipc:///tmp/bitcoind.tx.raw"
    }
    

    Meaning that hashtx and hashblock are published at the given addresses, while others (rawtx and rawblock) are not enabled at all. Or should the interface be different?

  8. promag commented at 12:53 pm on June 26, 2018: member

    I would suggest getzmqnotifications and return:

    0{
    1    "publish": {
    2        "hashtx": "...",
    3    },
    4}
    

    Other examples getzmqconfig, setzmqconfig, addzmqnotification

  9. domob1812 commented at 12:46 pm on June 27, 2018: contributor
    Yes, that makes sense. I’ll create a patch implementing @promag’s getzmqnotifications format as a first step. (I may be interested in adding more things, like addzmqnotification, later on as well.)
  10. domob1812 referenced this in commit caac39b0ac on Jun 29, 2018
  11. domob1812 referenced this in commit aa22290cfa on Jun 29, 2018
  12. domob1812 referenced this in commit e922c546d7 on Jun 29, 2018
  13. domob1812 referenced this in commit dd140e345a on Jun 29, 2018
  14. domob1812 referenced this in commit 25e27531cc on Jun 30, 2018
  15. domob1812 referenced this in commit fcc652960c on Jun 30, 2018
  16. domob1812 referenced this in commit 161e8d40a4 on Jul 5, 2018
  17. laanwj referenced this in commit a247594e75 on Jul 9, 2018
  18. domob1812 commented at 8:53 am on July 10, 2018: contributor

    Change merged, this is now implemented.

    I may take a look at addzmqnotification (i.e. making the configuration of notifications dynamic / configurable after start up) later, but that is separate and I’ll open a new issue to discuss the proposal for it when I do.

  19. domob1812 closed this on Jul 10, 2018

  20. marcinja referenced this in commit defe2733bd on Jul 10, 2018
  21. marcinja referenced this in commit 9b9d0602e4 on Jul 10, 2018
  22. Bushstar referenced this in commit d436a5f8b6 on Jul 13, 2018
  23. Bushstar referenced this in commit 97cc2dc1d5 on Jul 13, 2018
  24. luke-jr referenced this in commit e953e65cd2 on Jul 30, 2018
  25. luke-jr referenced this in commit b87d341b40 on Jul 30, 2018
  26. HashUnlimited referenced this in commit e0e4395ceb on Sep 11, 2018
  27. HashUnlimited referenced this in commit 3a5d6b1f33 on Sep 11, 2018
  28. joemphilips referenced this in commit 505a3612dc on Nov 9, 2018
  29. joemphilips referenced this in commit bc3ce7ee83 on Nov 9, 2018
  30. jfhk referenced this in commit eee5c9ed44 on Nov 14, 2018
  31. jfhk referenced this in commit ed25104319 on Nov 14, 2018
  32. PastaPastaPasta referenced this in commit 9d25593ba7 on Jul 17, 2020
  33. PastaPastaPasta referenced this in commit 87cf14727a on Jul 17, 2020
  34. MarcoFalke locked this on Sep 8, 2021

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-18 21:12 UTC

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