def METHOD_NAME(self):
    # All messages are received in the same socket which means
    # that this test fails if the publishing order changes.
    # Note that the publishing order is not defined in the documentation and
    # is subject to change.
    import zmq
    address = "tcp://127.0.0.1:28554"
    socket = self.ctx.socket(zmq.SUB)
    socket.set(zmq.RCVTIMEO, 60000)
    # Subscribe to all available topics.
    hashblock = ZMQSubscriber(socket, b"hashblock")
    hashtx = ZMQSubscriber(socket, b"hashtx")
    rawblock = ZMQSubscriber(socket, b"rawblock")
    rawtx = ZMQSubscriber(socket, b"rawtx")
    self.restart_node(
        0,
        [
            "-zmqpub%s=%s" % (sub.topic.decode(), address)
            for sub in [hashblock, hashtx, rawblock, rawtx]
        ],
    )
    connect_nodes(self.nodes[0], 1)
    socket.connect(address)
    # Relax so that the subscriber is ready before publishing zmq messages
    sleep(0.2)
    num_blocks = 5
    self.log.info(
        "Generate %(n)d blocks (and %(n)d coinbase txes)" % {"n": num_blocks}
    )
    genhashes = self.nodes[0].generate(
        nblocks=num_blocks, address=ADDRESS_BCRT1_UNSPENDABLE
    )
    self.sync_blocks()
    for x in range(num_blocks):
        # Should receive the coinbase txid.
        txid = hashtx.receive()
        # Should receive the coinbase raw transaction.
        hex = rawtx.receive()
        tx = CTransaction()
        tx.deserialize(BytesIO(hex))
        tx.calc_sha256()
        assert_equal(tx.hash, txid.hex())
        # Should receive the generated block hash.
        hash = hashblock.receive().hex()
        assert_equal(genhashes[x], hash)
        # The block should only have the coinbase txid.
        assert_equal([txid.hex()], self.nodes[1].getblock(hash)["tx"])
        # Should receive the generated raw block.
        block = rawblock.receive()
        assert_equal(
            genhashes[x], hash256_reversed(block[:BLOCK_HEADER_SIZE]).hex()
        )
    if self.is_wallet_compiled():
        self.log.info("Wait for tx from second node")
        payment_txid = self.nodes[1].sendtoaddress(
            self.nodes[0].getnewaddress(), 1.0
        )
        self.sync_mempools()
        # Should receive the broadcasted txid.
        txid = hashtx.receive()
        assert_equal(payment_txid, txid.hex())
        # Should receive the broadcasted raw transaction.
        hex = rawtx.receive()
        assert_equal(payment_txid, hash256_reversed(hex).hex())
    self.log.info("Test the getzmqnotifications RPC")
    assert_equal(
        self.nodes[0].getzmqnotifications(),
        [
            {"type": "pubhashblock", "address": address, "hwm": 1000},
            {"type": "pubhashtx", "address": address, "hwm": 1000},
            {"type": "pubrawblock", "address": address, "hwm": 1000},
            {"type": "pubrawtx", "address": address, "hwm": 1000},
        ],
    )
    assert_equal(self.nodes[1].getzmqnotifications(), [])