Ejemplo n.º 1
0
        public async Task <VerifiableClaimReply> GetVerifiableClaims(VerifiableClaimRequest request)
        {
            using var channel = GrpcChannel.ForAddress("https://localhost:5001");
            var client = new Claims.ClaimsClient(channel);

            return(await client.GetVerifiableClaimsAsync(request));
        }
Ejemplo n.º 2
0
        public override async Task <VerifiableClaimReply> GetVerifiableClaims(VerifiableClaimRequest request, ServerCallContext context)
        {
            m_logger.LogInformation("GetVerifiableClaim start");
            try
            {
                var channelSubscription = m_mamChannelSubscriptionFactory.Create(new Hash(request.ChannelRoot), Mode.Restricted, channelKey: new TryteString(request.SideKey).Value, keyIsTrytes: true);
                var publishedMessages   = await channelSubscription.FetchAsync();

                m_logger.LogInformation("Remove before production! GetVerifiableClaims", publishedMessages.ToString());
                var reply = CreateVerifiableClaimReplyFromMessage(publishedMessages);
                m_logger.LogInformation("Remove before production! GetVerifiableClaims", reply.ToString());
                return(reply);
            }
            catch (Exception ex)
            {
                m_logger.LogError("CreateVerifiableClaims", ex);

                throw new RpcException(new Status(StatusCode.NotFound, ex.Message));
            }
            finally
            {
                m_logger.LogInformation("GetVerifiableClaim end");
            }
        }