Beispiel #1
0
        //peer
        //[Authorize]
        //创建新通道并且启动
        public override async Task <TxResponse> InitChannel(TxHeader request, ServerCallContext context)
        {
            try
            {
                var model = Newtonsoft.Json.JsonConvert.DeserializeObject <QMBlockSDK.TX.TxHeader>(request.Data);
                var rs    = await _txService.InitChannel(model);

                return(new TxResponse()
                {
                    Data = Newtonsoft.Json.JsonConvert.SerializeObject(rs)
                });
            }
            catch (Exception ex)
            {
                _logger.LogError(ex, ex.Message);
                var rs = new QMBlockSDK.TX.TxResponse();
                rs.Msg    = ex.Message;
                rs.Status = false;
                return(new TxResponse()
                {
                    Data = Newtonsoft.Json.JsonConvert.SerializeObject(rs)
                });
            }
        }
Beispiel #2
0
        //peer
        //[Authorize]
        //创建新通道并且启动
        public async Task <JsonResult> InitChannel(TxHeader request)
        {
            var rs = await _txService.InitChannel(request);

            return(new JsonResult(rs));
        }