-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Add ZMQ support. Report blocks and transactions via ZMQ. #5303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Continues Johnathan Corgan's work.
|
This is great work and I'm very excited to see this being contributed. |
|
@jgarzik what is the intended meaning of a block being relayed here? Just triggering on AcceptBlock isn't particularly interesting - it just means that it passes preliminary checks and is accepted into the block tree. I think the most interesting meaning is "is accepted as new tip of the chain", which already has a NotifyBlockTip signal. |
|
@jgarzik note that the code wasn't actually compiled/tested by travis here because libzmq doesn't exist. In fact, the error handling in configure is broken. Libs like this usually default to "auto" or so, so that an explicit --enable-zmq would cause an error if the lib wasn't found. I commented in #5303 about adding the dependency, please have a look there. Also, please consider fixing up configure and adding an explicit "--enable-zmq" to the travis tests as necessary. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a default you could list here?
|
As in #4594, idea ACK |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should use $enableval, or it will disable it with --enable-zmq
Minor nit: prefer --disable-zeromq as the name.
|
Johnathan Corgan has given a guidiance about how to configure in PR#4594 like this |
|
This should probably setup depends/ so binaries get ZeroMQ support... |
|
@luke-jr See my comment above. I have an old branch where it's hooked up: https://github.com/theuni/bitcoin/commits/zmq-test . That'll need a bit of adapting since depends have changed somewhat, but should come pretty close. |
|
Just a quick note of thanks to Jeff Garzik for picking this up. I've been away from bitcoin development for a while but hope to return at some point. |
|
Would def. nice to have this in 0.11. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think ZMQ_SNDHWM should be set here to configurable value (at least through configure.ac) this provides the option to the user on when to start dropping messages. the default value of zero means a queue as large as the available memory which is dangerous because networks could be slow or the production of messages is faster than the network I/O output -- a precursor to a memory overflow crash.
ZMQ_LINGER is another important socket property to set here, the default value of -1 (infinite linger period on socket shutdown when there are queued messages to be sent) will prevent the application from shutting down gracefully. A configurable value (or a reasonable one) should be set to prevent this scenario. The linger period starts after a call to zmq_close on a socket or zmq_ctx_term on a context, once it expires all queued messages will be dropped.
|
Yes, it would be nice to have this in 0.11. |
|
#6103 says it has superceded this PR, of so, this PR should be closed. |
|
Closing in favor of #6103 |
Continues Johnathan Corgan's work. Supercedes #4594