def __init__(self): CommonThread.__init__(self) self.__timer_list: Dict[str, Timer] = {} self.__loop: asyncio.BaseEventLoop = asyncio.new_event_loop() # self.__loop.set_debug(True) self._futures: Dict[str, Future] = {}
def start(self, port, peer_id="", group_id=""): self.__port = port if self.__inner_service_port is None: self.__inner_service_port = int(port) + conf.PORT_DIFF_INNER_SERVICE self.__peer_id = peer_id self.__group_id = group_id CommonThread.start(self)
def __init__(self, channel_service: 'ChannelService', channel: str = None, **kwargs): CommonThread.__init__(self) Publisher.__init__(self, [ Consensus.EVENT_COMPLETE_CONSENSUS, Consensus.EVENT_LEADER_COMPLAIN_F_1, Consensus.EVENT_LEADER_COMPLAIN_2F_1, Consensus.EVENT_MAKE_BLOCK ]) self.channel_name = channel self.__channel_service = channel_service self.__peer_manager = channel_service.peer_manager self.__last_epoch: Epoch = None self.__precommit_block: Block = None self.__epoch: Epoch = None self.__leader_id = None self.__tx_queue = AgingCache( max_age_seconds=conf.MAX_TX_QUEUE_AGING_SECONDS, default_item_status=TransactionStatusInQueue.normal) self.__sleep_time = None self.__run_logic = None self.__block_generation_scheduler = BlockGenerationScheduler( self.channel_name) self.__init_data()
def start(self, port, peer_id="", group_id=""): self.__port = port self.peer_id = peer_id self.__group_id = group_id CommonThread.start(self) self.__broadcast_process.set_to_process( BroadcastProcess.PROCESS_INFO_KEY, f"peer_id({self.get_peer_id()})")
def __init__(self, peer_port, peer_ip_address=None): if peer_ip_address is None: peer_ip_address = conf.IP_LOCAL CommonThread.__init__(self) self.__peer_port = peer_port self.__peer_ip_address = peer_ip_address ServerComponents().set_argument() ServerComponents().set_resource()
def start(self, port, peer_id="", group_id=""): self.__port = port if self.__inner_service_port is None: self.__inner_service_port = port + conf.PORT_DIFF_INNER_SERVICE self.__peer_id = peer_id self.__group_id = group_id CommonThread.start(self) self.__broadcast_process.set_to_process(BroadcastProcess.PROCESS_INFO_KEY, f"peer_id({self.__peer_id})")
def __init__(self): CommonThread.__init__(self) self.__timer_list = {}
def __init__(self): CommonThread.__init__(self) self.__timer_list = {} self.__loop: asyncio.BaseEventLoop = asyncio.new_event_loop()
def __init__(self, peer_port): CommonThread.__init__(self) self.__peer_port = peer_port ServerComponents().set_argument() ServerComponents().set_resource()
def __init__(self, channel): CommonThread.__init__(self) self.__channel_name = channel self.__schedule_queue = queue.Queue()
def __init__(self): CommonThread.__init__(self) self.__job = queue.Queue() self.__process = None
def stop(self): if conf.ALLOW_MAKE_EMPTY_BLOCK: self.__block_generation_scheduler.stop() CommonThread.stop(self)