async def __init_peer_auth(self): try: node_key: bytes = await StubCollection().peer_stub.async_task().get_node_key(ChannelProperty().name) self.__peer_auth = Signer.from_prikey(node_key) except KeyError: self.__peer_auth = Signer.from_channel(ChannelProperty().name) except Exception as e: logging.exception(f"peer auth init fail cause : {e}") util.exit_and_msg(f"peer auth init fail cause : {e}")
def __make_peer_id(self): """네트워크에서 Peer 를 식별하기 위한 UUID를 level db 에 생성한다. """ self.__peer_id = Signer.from_channel( conf.LOOPCHAIN_DEFAULT_CHANNEL).address logger_preset = loggers.get_preset() logger_preset.peer_id = self.peer_id logger_preset.update_logger() logging.info(f"run peer_id : {self.__peer_id}")
def __init_key_by_channel(self): for channel in conf.CHANNEL_OPTION: signer = Signer.from_channel(channel) if channel == conf.LOOPCHAIN_DEFAULT_CHANNEL: self.__make_peer_id(signer.address) self.__node_keys[channel] = signer.private_key.private_key
def __init_peer_auth(self): try: self.__peer_auth = Signer.from_channel(ChannelProperty().name) except Exception as e: logging.exception(f"peer auth init fail cause : {e}") util.exit_and_msg(f"peer auth init fail cause : {e}")