We have a hyperledger fabric 2.1 setup with 1 channel and we have 2 orgs in the channel. we have defined anchor peers for both the orgs and also we have mentioned CORE_PEER_GOSSIP_EXTERNALENDPOINT for the peers. we have have a chaincode which make use of private data collection, the collection policy is as below
[
{
"name": "Org1_testChannel_PDC",
"policy": "OR ('Org1.member', 'Org2.member')",
"requiredPeerCount": 1,
"maxPeerCount": 2,
"memberOnlyRead": true,
"memberOnlyWrite": true,
"blockToLive": 0,
"endorsementPolicy": {
"signaturePolicy": "OR('Org1.member', 'Org2.member')"
}
},
{
"name": "Org1_Secret_PDC",
"policy": "OR ('Org1.member')",
"requiredPeerCount": 0,
"maxPeerCount": 1,
"memberOnlyRead": true,
"memberOnlyWrite": true,
"blockToLive": 0,
"endorsementPolicy": {
"signaturePolicy": "OR('Org1.member')"
}
}
]
The chaincode commit was successful. But when we try to make a transaction from peer of Org1 by using Org1_testChannel_PDC collection we are getting an error. We had also mentioned peer1 of Org2 in the transaction but still we are getting the error.
Error: endorsement failure during invoke. response: status:500 message:"error in simulation: failed to distribute private collection, txID d9be8f15bf8a941d49aea96e369c7b00cb0b21b35c09a8c41380f6609a7754b9, channel testchannel: could not build private data dissemination plan for chaincode testcc and collection Org1_testChannel_PDC: required to disseminate to at least 1 peers, but know of only 0 eligible peers