Esempio n. 1
0
    def GetChannelInfos(self, request: loopchain_pb2.GetChannelInfosRequest, context):
        """Return channels by peer target

        :param request:
        :param context:
        :return:
        """
        logging.info(f"peer_outer_service:GetChannelInfos target({request.peer_target}) "
                     f"channel_infos({ObjectManager().peer_service.channel_infos})")

        return loopchain_pb2.GetChannelInfosReply(
            response_code=message_code.Response.success,
            channel_infos=json.dumps(ObjectManager().peer_service.channel_infos)
        )
Esempio n. 2
0
    def GetChannelInfos(self, request: loopchain_pb2.GetChannelInfosRequest,
                        context):
        """Return channels by peer target

        :param request:
        :param context:
        :return:
        """

        channel_infos: str = \
            ObjectManager().rs_service.admin_manager.get_channel_infos_by_peer_target(request.peer_target)

        return loopchain_pb2.GetChannelInfosReply(
            response_code=message_code.Response.success,
            channel_infos=channel_infos)
    def GetChannelInfos(self, request: loopchain_pb2.GetChannelInfosRequest, context):
        """Return channels by peer target

        :param request:
        :param context:
        :return:
        """
        if conf.ENABLE_CHANNEL_AUTH:
            channel_infos: str = \
                ObjectManager().rs_service.admin_manager.get_channel_infos_by_peer_target(request.peer_target)
        else:
            channel_infos: str = ObjectManager().rs_service.admin_manager.get_all_channel_info()
        logging.info(f"rs_outer_service:GetChannelInfos target({request.peer_target}) channel_infos({channel_infos})")

        return loopchain_pb2.GetChannelInfosReply(
            response_code=message_code.Response.success,
            channel_infos=channel_infos
        )