| 51 | self.skip_if_no_wallet() |
| 52 | |
| 53 | def setup_nodes(self): |
| 54 | # Import keys |
| 55 | self.add_nodes(self.num_nodes) |
| 56 | self.start_nodes() |
| 57 | super().import_deterministic_coinbase_privkeys() |
| 58 | self.stop_nodes() |
| 59 | |
| 60 | import zmq |
| 61 | |
| 62 | # Initialize ZMQ context and socket. |
| 63 | # All messages are received in the same socket which means |
| 64 | # that this test fails if the publishing order changes. |
| 65 | # Note that the publishing order is not defined in the documentation and |
| 66 | # is subject to change. |
| 67 | address = "tcp://127.0.0.1:28332" |
| 68 | self.zmq_context = zmq.Context() |
| 69 | socket = self.zmq_context.socket(zmq.SUB) |
| 70 | socket.set(zmq.RCVTIMEO, 60000) |
| 71 | socket.connect(address) |
| 72 | |
| 73 | # Subscribe to all available topics. |
| 74 | self.hashblock = ZMQSubscriber(socket, b"hashblock") |
| 75 | self.hashtx = ZMQSubscriber(socket, b"hashtx") |
| 76 | self.rawblock = ZMQSubscriber(socket, b"rawblock") |
| 77 | self.rawtx = ZMQSubscriber(socket, b"rawtx") |
| 78 | |
| 79 | self.nodes[0].extra_args = ["-zmqpub%s=%s" % (sub.topic.decode(), address) for sub in [self.hashblock, self.hashtx, self.rawblock, self.rawtx]] |
| 80 | self.start_nodes() |
| 81 | |
| 82 | def import_deterministic_coinbase_privkeys(self): |
| 83 | pass |