Beispiel #1
0
 def set_neighbours(self):
     self.neighbours = utils.find_neighbours(
         utils.get_host(), self.port,
         NEIGHBOURS_IP_RANGE[0], NEIGHBOURS_IP_RANGE[1],
         BLOCKCHAIN_PORT_RANGE[0], BLOCKCHAIN_PORT_RANGE[1]
     )
     logger.info({'action': 'set_neighbours', 'neighbours': self.neighbours})
Beispiel #2
0
    def set_neighbours(self):
        """
        条件に沿ったnodeを検索する.

        See Also
        ----------
        NEIGHBOURS_IP_RANGE_NUM : tuple
            NEIGHBOURS_IP_RANGE_NUM[0] : int
                start_ip_range
            NEIGHBOURS_IP_RANGE_NUM[1] : int
                end_ip_range

        BLOCKCHAIN_PORT_RANGE : tuple
            BLOCKCHAIN_PORT_RANGE[0] : int
                start_port
            BLOCKCHAIN_PORT_RANGE[1] : int
                end_port
        """
        self.neighbours = utils.find_neighbours(utils.get_host(), self.port,
                                                NEIGHBOURS_IP_RANGE_NUM[0],
                                                NEIGHBOURS_IP_RANGE_NUM[1],
                                                BLOCKCHAIN_PORT_RANGE[0],
                                                BLOCKCHAIN_PORT_RANGE[1])
        logger.info({
            "action": "set_neighbours",
            "neighbours": self.neighbours
        })