[英]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.