简体   繁体   English

Hyperledger Fabric 私有数据收集

[英]Hyperledger Fabric Private Data Collection

I am running BYFN(Default) as a.network and here is my chaincode used for test purpose Chaincode link My collection config is Config File Link .我将 BYFN(Default) 作为chaincode运行,这是我用于测试目的的链代码 Chaincode link我的集合配置是Config File Link Now Let me explain the issue.现在让我解释一下这个问题。 When i Query from authorized peer means any of peer of ORG1 its gives me correct result当我从授权对等方查询时意味着 ORG1 的任何对等方都会给我正确的结果

{
  "public_data": {
    "docType": "car",
    "name": "Honda Amaze",
    "color": "blue",
    "size": 35,
    "owner": "tom"
  },
  "privatedata": {
    "docType": "car",
    "name": "Honda Amaze",
    "owner_address": "Vill anyari url alinagar Moradabad"
  }
}

But when I query from unauthorized peer means any peer of organization 2 then inspite of error message that we can't access data.但是,当我从未经授权的对等方查询时,意味着组织 2 的任何对等方都会出现我们无法访问数据的错误消息。 I am getting response as我得到的回应是

{
  "public_data": {
    "docType": "car",
    "name": "Honda Amaze",
    "color": "blue",
    "size": 35,
    "owner": "tom"
  },
  "privatedata": {
    "docType": "",
    "name": "",
    "owner_address": ""
  }
}

You can see that private data is not there.您可以看到不存在私有数据。 If i run marbels private data exmple it gives me error from unauthorized peer如果我运行 marbels private data exmple 它会给我来自未经授权的同行的错误

{"Error":"Failed to get private details for marble1: GET_STATE failed: transaction ID: b04adebbf165ddc90b4ab897171e1daa7d360079ac18e65fa15d84ddfebfae90: Private data matching public hash version is not available. Public hash version = &version.Height{BlockNum:0x6, TxNum:0x0}, Private data version = (*version.Height)(nil)"}" {"Error":"Failed to get private details for marble1: GET_STATE failed: transaction ID: b04adebbf165ddc90b4ab897171e1daa7d360079ac18e65fa15d84ddfebfae90: Private data matching public hash version is not available. Public hash version = &version.Height{BlockNum:0x6, TxNum:0x0}, Private数据版本 = (*version.Height)(nil)"}"

No Marbels private example they are not getting data from simple ledger But in my chaincode am getting data from normal ledger and private data both.没有Marbels私人示例,他们没有从简单的分类帐中获取数据,但是在我的chaincode中,我从普通分类帐和私人数据中获取数据。

Any help Much appereciated.任何帮助非常感谢。

Thanks in advance.提前致谢。

I expect the difference is simply related to your error handling code in your chaincode. 我希望区别仅与您的链码中的错误处理代码有关。 You need to handle the error returned by GetPrivateData(). 您需要处理GetPrivateData()返回的错误。

This error I also faced but for me it was occurring because I added the peer details of unauthorized peer.我也遇到过这个错误,但对我来说,这是因为我添加了未经授权的对等点的详细信息。

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

相关问题 超账结构中的私人数据收集 - Private data collection in hyperledger fabric Hyperledger Fabric 1.4 私有数据收集 - Hyperledger Fabric 1.4 Private data collection Hyperledger Fabric:用于私人数据收集的服务发现 - Hyperledger Fabric: Service discovery for private data collection 更新 Hyperledger Fabric 中的私有数据收集策略 - Update private data collection policy in Hyperledger Fabric Hyperledger Fabric私有数据集合中的私有数据活度设置 - Private data liveliness settings in a hyperledger fabric private data collection 在 Hyperledger Fabric 2.0 中实现私有数据收集错误 - Implementing Private Data Collection in Hyperledger Fabric 2.0 Error Hyperledger Fabric私有数据收集以分发大文件 - Hyperledger Fabric private data collection to distribute large files Hyperledger fabric - 在私人数据收集中需要两个独特的领域 - Hyperledger fabric - Need two unique fields in private data collection Hyperledger Fabric 中隐式私有数据收集中的 blockToLive 属性是什么? - What is the blockToLive property in implicit private data collection in Hyperledger Fabric? Hyperledger Fabric 2.2 - 使用 collection-config 保护私有数据 - Hyperledger Fabric 2.2 - securing private data with collection-config
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM