예제 #1
0
    def setup_nodes(self):
        skip_if_no_py3_zmq()
        skip_if_no_topazd_zmq(self)
        import zmq

        # Initialize ZMQ context and socket.
        # 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.
        address = "tcp://127.0.0.1:28867"
        self.zmq_context = zmq.Context()
        socket = self.zmq_context.socket(zmq.SUB)
        socket.set(zmq.RCVTIMEO, 60000)
        socket.connect(address)

        # Subscribe to all available topics.
        self.hashblock = ZMQSubscriber(socket, b"hashblock")
        self.hashtx = ZMQSubscriber(socket, b"hashtx")
        self.rawblock = ZMQSubscriber(socket, b"rawblock")
        self.rawtx = ZMQSubscriber(socket, b"rawtx")

        self.extra_args = [["-zmqpub%s=%s" % (sub.topic.decode(), address) for sub in [self.hashblock, self.hashtx, self.rawblock, self.rawtx]], []]
        self.add_nodes(self.num_nodes, self.extra_args)
        self.start_nodes()
예제 #2
0
    def run_test(self):
        # Check that xazabd has been built with ZMQ enabled.
        config = configparser.ConfigParser()
        config.read_file(open(self.options.configfile))

        skip_if_no_py3_zmq()
        skip_if_no_bitcoind_zmq(self)

        try:
            # Setup the ZMQ subscriber socket
            self.zmq_context = zmq.Context()
            self.socket = self.zmq_context.socket(zmq.SUB)
            self.socket.connect(self.address)
            # Initialize the network
            self.activate_dip8()
            self.nodes[0].spork("SPORK_17_QUORUM_DKG_ENABLED", 0)
            self.wait_for_sporks_same()
            # Create an LLMQ for testing
            self.quorum_type = 100  # llmq_test
            self.quorum_hash = self.mine_quorum()
            self.sync_blocks()
            self.wait_for_chainlocked_block_all_nodes(
                self.nodes[0].getbestblockhash())
            # Wait a moment to avoid subscribing to recovered sig in the test before the one from the chainlock
            # has been sent which leads to test failure.
            time.sleep(1)
            # Test all xazab related ZMQ publisher
            self.test_recovered_signature_publishers()
            self.test_chainlock_publishers()
            self.test_instantsend_publishers()
            self.test_governance_publishers()
        finally:
            # Destroy the ZMQ context.
            self.log.debug("Destroying ZMQ context")
            self.zmq_context.destroy(linger=None)
예제 #3
0
    def setup_nodes(self):
        skip_if_no_py3_zmq()
        skip_if_no_digibyted_zmq(self)
        import zmq

        # Initialize ZMQ context and socket.
        # 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.
        address = "tcp://127.0.0.1:28332"
        self.zmq_context = zmq.Context()
        socket = self.zmq_context.socket(zmq.SUB)
        socket.set(zmq.RCVTIMEO, 60000)
        socket.connect(address)

        # Subscribe to all available topics.
        self.hashblock = ZMQSubscriber(socket, b"hashblock")
        self.hashtx = ZMQSubscriber(socket, b"hashtx")
        self.rawblock = ZMQSubscriber(socket, b"rawblock")
        self.rawtx = ZMQSubscriber(socket, b"rawtx")

        self.extra_args = [["-zmqpub%s=%s" % (sub.topic.decode(), address) for sub in [self.hashblock, self.hashtx, self.rawblock, self.rawtx]], []]
        self.add_nodes(self.num_nodes, self.extra_args)
        self.start_nodes()
예제 #4
0
    def setup_nodes(self):
        skip_if_no_py3_zmq()
        skip_if_no_bitcoind_zmq(self)

        # Import keys
        self.add_nodes(self.num_nodes)
        self.start_nodes()
        super().import_deterministic_coinbase_privkeys()
        self.stop_nodes()

        import zmq

        # Initialize ZMQ context and socket.
        # 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.
        address = "tcp://127.0.0.1:28332"
        self.zmq_context = zmq.Context()
        socket = self.zmq_context.socket(zmq.SUB)
        socket.set(zmq.RCVTIMEO, 60000)
        socket.connect(address)

        # Subscribe to all available topics.
        self.hashblock = ZMQSubscriber(socket, b"hashblock")
        self.hashtx = ZMQSubscriber(socket, b"hashtx")
        self.rawblock = ZMQSubscriber(socket, b"rawblock")
        self.rawtx = ZMQSubscriber(socket, b"rawtx")

        self.nodes[0].extra_args = [
            "-zmqpub{}={}".format(sub.topic.decode(), address) for sub in
            [self.hashblock, self.hashtx, self.rawblock, self.rawtx]
        ]
        self.start_nodes()
예제 #5
0
    def setup_nodes(self):
        skip_if_no_py3_zmq()
        skip_if_no_bitcoind_zmq(self)

        import zmq
        self.zmq_context = zmq.Context()
        self.games = {}
        for g in ["a", "b", "ignored"]:
            self.games[g] = GameSubscriber(self.zmq_context, self._address, g)

        args = []
        args.append("-zmqpubgameblocks=%s" % self._address)
        args.extend(["-trackgame=%s" % g for g in ["a", "b", "other"]])
        self.extra_args = [args]
        self.add_nodes(self.num_nodes, self.extra_args)
        self.start_nodes()

        self.node = self.nodes[0]
예제 #6
0
 def run_test(self):
     skip_if_no_py3_zmq()
     skip_if_no_bitcoinb3d_zmq(self)
     self._test_getzmqnotifications()
예제 #7
0
 def run_test(self):
     skip_if_no_py3_zmq()
     skip_if_no_bastojid_zmq(self)
     self._test_getzmqnotifications()
예제 #8
0
 def run_test(self):
     skip_if_no_py3_zmq()
     skip_if_no_digibyted_zmq(self)
     self._test_getzmqnotifications()
예제 #9
0
 def run_test(self):
     skip_if_no_py3_zmq()
     skip_if_no_connexd_zmq(self)
     self._test_getzmqnotifications()
예제 #10
0
 def run_test(self):
     skip_if_no_py3_zmq()
     skip_if_no_imperiumd_zmq(self)
     self._test_getzmqnotifications()
예제 #11
0
 def run_test(self):
     skip_if_no_py3_zmq()
     skip_if_no_theburningsavaged_zmq(self)
     self._test_getzmqnotifications()
예제 #12
0
 def run_test(self):
     skip_if_no_py3_zmq()
     skip_if_no_ecommercecoind_zmq(self)
     self._test_getzmqnotifications()