简体   繁体   English

Hyperledger Fabric:用于私人数据收集的服务发现

[英]Hyperledger Fabric: Service discovery for private data collection

In Hyperledger Fabric, does service discovery support finding query peers for private data collection (PDC).在 Hyperledger Fabric 中,服务发现是否支持为私有数据收集 (PDC) 查找查询对等点。

In a channel consisting of 2 orgs (org1 and org2), if I create a PDC for org1 only, only the peers in org1 hold the private data.在由 2 个组织(org1 和 org2)组成的通道中,如果我仅为 org1 创建 PDC,则只有 org1 中的对等方持有私有数据。 If in PDC collection profile I specify memberReadOnly=false, it allows org2 users to query org1 peer to read the private data.如果在 PDC 集合配置文件中指定 memberReadOnly=false,则它允许 org2 用户查询 org1 对等方以读取私有数据。 But this requires the support of service discovery in peers and Fabric Java SDK.但这需要peer和Fabric Java SDK中服务发现的支持。

The objective we'd like to accomplish is in client side as org2 user, via Java SDK, when calling chaincode to read the private data, the SDK will automatically connect to org1 peer.我们想要完成的目标是在客户端作为org2用户,通过Java SDK,当调用chaincode读取私有数据时,SDK会自动连接到org1 peer。

Is this currently supported.目前是否支持。

Yeah, discovery supports private data.是的,发现支持私有数据。

If you take a look at the discovery CLI which implements the client side API (apart from SDKs) you will see that the endorsement query has a --collection flag.如果您查看实现客户端 API(SDK 除外)的发现 CLI ,您将看到背书查询具有--collection标志。

For example the following flags --chaincode=cc1 --chaincode=cc2 --collection=cc2:col1 to the discover endorsers command mean you want to ask about a transaction which writes to chaincodes cc1 and cc2 and also while invoking cc2 you are writing/reading to/from collection col .例如, discover endorsers命令的以下标志--chaincode=cc1 --chaincode=cc2 --collection=cc2:col1意味着您想询问写入链码cc1cc2的交易,并且在调用您正在编写的cc2 /读取到/从集合col

In Fabric 2.1 we added another flag --noPrivateReads which hints discovery that you only want to write to the collection but not read from it.在 Fabric 2.1 中,我们添加了另一个标志--noPrivateReads ,它暗示您只想写入集合但不想从中读取。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM