<p>Since this question still comes up in search results, it's worth noting that <code>bitcoin-cli</code> now has a <code>getzmqnotifications</code> method. If you get something like this, you've successfully built with ZMQ:</p>
<pre><code>$ bitcoin-cli getzmqnotifications
[
  {
    &quot;type&quot;: &quot;pubrawblock&quot;,
    &quot;address&quot;: &quot;tcp://127.0.0.1:28332&quot;,
    &quot;hwm&quot;: 1000
  },
  {
    &quot;type&quot;: &quot;pubrawtx&quot;,
    &quot;address&quot;: &quot;tcp://127.0.0.1:28333&quot;,
    &quot;hwm&quot;: 1000
  }
]
</code></pre>
<p>If you get</p>
<pre><code>error code: -32601
error message:
Method not found
</code></pre>
<p>... you haven't.</p>
<p>PR that introduced the method: <a href="https://github.com/bitcoin/bitcoin/pull/13570" rel="noreferrer">https://github.com/bitcoin/bitcoin/pull/13570</a></p>

CC BY-SA 4.0
2022-01-04T03:14:00.820Z
if you receive: `[ ]` (empty, but no error), what is then the state?
Melroy van den Berg
CC BY-SA 4.0
2022-04-25T22:49:43.497Z
Through trial and error, I have learned that an empty response [ ], means that zmq support IS compiled in, but the zmq ports have not been set up correctly (matching)  in bitcoin.conf and lnd.conf.
ckapilla
CC BY-SA 4.0
2021-02-08T05:54:35.667Z
2021-02-08T06:02:04.063Z
2021-02-08T06:02:04.063Z
davidfloyd91
<p>As this question is related to executable compilation which has to do with linking (static or dynamic), therefore the ultimate way to know if your compiled bitcoind executable has been compiled with 0mq support is simply:</p>

<p><code>
ldd /usr/bin/bitcoind | grep -i mq
</code></p>

CC BY-SA 4.0
2018-06-25T00:57:01.827Z
2018-06-25T00:57:01.827Z
daparic
<p>You should have a file named <code>config.log</code> in your Bitcoin Core working directory. Look in the file for ZMQ related lines. If ZMQ is enabled, you should see things like <code>#define ENABLE_ZMQ 1</code>. If it is not enabled, you should see things like <code>#define ENABLE_ZMQ 0</code>.</p>

CC BY-SA 3.0
2017-12-13T01:32:59.697Z
2017-12-13T01:32:59.697Z
Ava Chow
<h1>Question</h1>

<p>How can I check to see if ZeroMQ is not active due to a config error or due to lack of support at compile time?</p>

<h1>Details</h1>

<p>I'm seeing a lot of messages like this from the <code>insight</code> logs:</p>

<pre><code>[2017-12-12T12:21:31.695Z] warn: ZMQ connection delay: tcp://127.0.0.1:28332
</code></pre>

<p>When I test to see if the port is open and listening with <code>netstat -peanut</code> or <code>netcat -v localhost 28332</code> I can see that it is not (even though it's in bitcoind.conf).</p>

<p>bitcoind.conf</p>

<pre><code>server=1
whitelist=0.0.0.0/0
txindex=1
addressindex=1
timestampindex=1
spentindex=1
zmqpubrawtx=tcp://127.0.0.1:28332
zmqpubrawtxlock=tcp://127.0.0.1:28332
zmqpubhashblock=tcp://127.0.0.1:28332
rpcuser=user321
rpcpassword=local321
rpcport=9998
rpcallowip=0.0.0.0/0
uacomment=bitcore
#debug=1
#testnet=1
</code></pre>

<p>bitcore-node.json:</p>

<pre><code>    {
        "network": "mainnet",
        "port": 3001,
        "services": [
            "bitcoind",
            "insight-api-dash",
            "insight-ui-dash",
            "web"
        ],
        "servicesConfig": {
            "bitcoind": {
                "connect": [{
                    "rpchost": "127.0.0.1",
                    "rpcport": 9998,
                    "rpcuser": "user321",
                    "rpcpassword": "local321",
                    "zmqpubrawtx": "tcp://127.0.0.1:28332"
                }]
            }
        }
    }
</code></pre>

<p>I'm pretty sure I compiled with zmq support, but since it's not actually listening I'm guessing that it's possible that I did not (i.e. although libzmq was present perhaps it was not in the right path to be detected). </p>

<p>How can I check to see if it's a config error or a compile error?</p>

<bitcoin-core><bitcoind><zeromq>
How can I tell if bitcoind was compiled with ZeroMQ support?
coolaj86
# How can I tell if bitcoind was compiled with ZeroMQ support?

(Asked by: username_0 on 2017-12-12)

# Question

How can I check to see if ZeroMQ is not active due to a config error or due to lack of support at compile time?

# Details

I'm seeing a lot of messages like this from the `insight` logs:

```
[2017-12-12T12:21:31.695Z] warn: ZMQ connection delay: tcp://127.0.0.1:28332

```

When I test to see if the port is open and listening with `netstat -peanut` or `netcat -v localhost 28332` I can see that it is not (even though it's in bitcoind.conf).

bitcoind.conf

```
server=1
whitelist=0.0.0.0/0
txindex=1
addressindex=1
timestampindex=1
spentindex=1
zmqpubrawtx=tcp://127.0.0.1:28332
zmqpubrawtxlock=tcp://127.0.0.1:28332
zmqpubhashblock=tcp://127.0.0.1:28332
rpcuser=user321
rpcpassword=local321
rpcport=9998
rpcallowip=0.0.0.0/0
uacomment=bitcore
#debug=1
#testnet=1

```

bitcore-node.json:

```
    {
        "network": "mainnet",
        "port": 3001,
        "services": [
            "bitcoind",
            "insight-api-dash",
            "insight-ui-dash",
            "web"
        ],
        "servicesConfig": {
            "bitcoind": {
                "connect": [{
                    "rpchost": "127.0.0.1",
                    "rpcport": 9998,
                    "rpcuser": "user321",
                    "rpcpassword": "local321",
                    "zmqpubrawtx": "tcp://127.0.0.1:28332"
                }]
            }
        }
    }

```

I'm pretty sure I compiled with zmq support, but since it's not actually listening I'm guessing that it's possible that I did not (i.e. although libzmq was present perhaps it was not in the right path to be detected).

How can I check to see if it's a config error or a compile error?

**Tags:** bitcoin-core, bitcoind, zeromq


---

## 3 answers

### Answer by username_5 on 2017-12-13. Score: 6 | Accepted answer

You should have a file named `config.log` in your Bitcoin Core working directory. Look in the file for ZMQ related lines. If ZMQ is enabled, you should see things like `#define ENABLE_ZMQ 1`. If it is not enabled, you should see things like `#define ENABLE_ZMQ 0`.


---

### Answer by username_1 on 2021-02-08. Score: 7

Since this question still comes up in search results, it's worth noting that `bitcoin-cli` now has a `getzmqnotifications` method. If you get something like this, you've successfully built with ZMQ:

```
$ bitcoin-cli getzmqnotifications
[
  {
    "type": "pubrawblock",
    "address": "tcp://127.0.0.1:28332",
    "hwm": 1000
  },
  {
    "type": "pubrawtx",
    "address": "tcp://127.0.0.1:28333",
    "hwm": 1000
  }
]

```

If you get

```
error code: -32601
error message:
Method not found

```

... you haven't.

PR that introduced the method: <https://github.com/bitcoin/bitcoin/pull/13570>

> **Comments:**
> **username_2**: if you receive: `[ ]` (empty, but no error), what is then the state?  
> **username_3**: Through trial and error, I have learned that an empty response [ ], means that zmq support IS compiled in, but the zmq ports have not been set up correctly (matching)  in bitcoin.conf and lnd.conf.  

---

### Answer by username_4 on 2018-06-25. Score: 6

As this question is related to executable compilation which has to do with linking (static or dynamic), therefore the ultimate way to know if your compiled bitcoind executable has been compiled with 0mq support is simply:

`ldd /usr/bin/bitcoind | grep -i mq`


---

