I'm trying to connect to Bitcoin's ZeroMQ queue, having no success and don't even know where my problem is. Here is what I did so far on my Ubuntu 14.04:

  1. Installed Bitcoin via sudo apt-get install bitcoin-qt
  2. installed ZeroMQ via wget http://download.zeromq.org/zeromq-4.1.2.tar.gz && cd libzmq/ && ./autogen.sh && ./configure && make -j 4 && make check && make install
  3. In my Scala application I use jeromq: libraryDependencies += "org.zeromq" % "jeromq" % "0.3.5"
  4. In Bitcoin's bitcoin.conf I add the following line: zmqpubhashtx=tcp:// (i'm only interested in incoming tx id's)

After doing all that I launch Bitcoin, then I launch my Scala app with the following code:

import org.zeromq.ZMQ
val context = ZMQ.context(1)
val socket = context.socket(ZMQ.SUB) // Since server side is PUB

while (true) {
  logger info socket.recv.length.toString

And I receive no messages. Thing is I don't even know what the problem is or how to test it. Does apt-get version of Bitcoin even has ZeroMQ support? On jeromq github it is stated that it's Based on libzmq 3.2.5 while Bitcoin requires ZeroMQ API version 4.x or newer, could that be a reason? Or perhaps it's something else entirely?


It is not specified what to subscribe.


# if you need raw data or block data, to add->

see. https://github.com/bitcoin/bitcoin/blob/master/contrib/zmq/zmq_sub.py

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.