Hyperledger Fabric:在提交事务时监听数据流 [英] Hyperledger Fabric: Listen to Datastream, while submit transaction

查看:98
本文介绍了Hyperledger Fabric:在提交事务时监听数据流的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用SDK或不使用SDK来调用新事务时,找出从客户端到对等方的通信的最佳方法是什么.我想详细关注提交的内容以及同级以后发回的内容.

When I invoke a new transaction with the SDK/ or without, what is the best way to find out the communication from the client to the peer. I want to follow in detail what's submitted and what the peer sents back later.

使用wireshark时,由于TLS,gRPC/pb而出现问题.有没有办法监听所有发送的消息和流量?

With wireshark, I had problems due to TLS,gRPC/pb. Is there a way to listen to all messages and traffic sent?

据我所知,gRPC框架用于在Fabric中仅 用于客户端,对等方和订购者之间的通信.

As far as I understood it the gRPC Framework is used for communication between client, peers and orderer only in Fabric.

推荐答案

您可以采用几种不同的选择.

There are a few different options you could pursue.

  1. 由于Hyperledger Fabric是OSS,因此您可以简单地修改代码以检查消息并在gRPC服务实现中记录或转储数据.例如: ProcessProposal gRPC服务已在endorser.go中中实现.
  2. 您可以禁用TLS,并使用您在帖子中引用的工具(例如wireshark).您可以在 core.yaml 中禁用TLS.同伴,或在 orderer.yaml
  3. 您可以尝试获取类似 mitmproxy 之类的内容,并将CLI/SDK配置为信任其TLS证书.不幸的是,看起来当前发布的版本 gRPC出现了一些问题,因此您可能需要自定义版本才能完成这项工作.
  1. Since Hyperledger Fabric is OSS, you can simply modify the code to inspect the message and log or dump the data at the gRPC service implementations. For instance: the ProcessProposal gRPC service is implemented in endorser.go.
  2. You could disable TLS, and use the tooling you referenced in your post (like wireshark). You can disable TLS in core.yaml for the peer, or in orderer.yaml for the orderer.
  3. You could attempt to get something like mitmproxy and configure the CLI/SDK to trust its TLS cert. Unfortunately, it looks like the currently released version has some problems with gRPC, so you might need a custom build to make this work.

据我了解,gRPC框架仅在Fabric中用于客户端,对等方和订购者之间的通信.

As far as I understood it the gRPC Framework is used for communication between client, peers and orderer only in Fabric.

大多数客户端API的确基于gRPC.诸如用于设置日志级别和收集指标的操作端点之类的一些应用是基于REST的.

Most of the client APIs are indeed gRPC based. A few, like the operations endpoint for setting log levels and collecting metrics are REST based.

这篇关于Hyperledger Fabric:在提交事务时监听数据流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆