Changeset View
Changeset View
Standalone View
Standalone View
test/functional/interface_zmq.py
Show First 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
self.ctx.destroy(linger=None) | self.ctx.destroy(linger=None) | ||||
def test_basic(self): | def test_basic(self): | ||||
# All messages are received in the same socket which means that this | # All messages are received in the same socket which means that this | ||||
# test fails if the publishing order changes. | # test fails if the publishing order changes. | ||||
# Note that the publishing order is not defined in the documentation and | # Note that the publishing order is not defined in the documentation and | ||||
# is subject to change. | # is subject to change. | ||||
import zmq | import zmq | ||||
# Invalid zmq arguments don't take down the node, see #17185. | |||||
self.restart_node(0, ["-zmqpubrawtx=foo", "-zmqpubhashtx=bar"]) | |||||
address = 'tcp://127.0.0.1:28332' | address = 'tcp://127.0.0.1:28332' | ||||
socket = self.ctx.socket(zmq.SUB) | socket = self.ctx.socket(zmq.SUB) | ||||
socket.set(zmq.RCVTIMEO, 60000) | socket.set(zmq.RCVTIMEO, 60000) | ||||
# Subscribe to all available topics. | # Subscribe to all available topics. | ||||
hashblock = ZMQSubscriber(socket, b"hashblock") | hashblock = ZMQSubscriber(socket, b"hashblock") | ||||
hashtx = ZMQSubscriber(socket, b"hashtx") | hashtx = ZMQSubscriber(socket, b"hashtx") | ||||
rawblock = ZMQSubscriber(socket, b"rawblock") | rawblock = ZMQSubscriber(socket, b"rawblock") | ||||
▲ Show 20 Lines • Show All 96 Lines • Show Last 20 Lines |