0
votes

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
1

1 Answers

1
votes

This error indicates that the endorsing peer is not able to communicate the private data to enough (in your case 1 other) peer. This generally is symptomatic of gossip endpoints not being configured correctly.

You can use the service discovery CLI to query your peer to find the other peers in the network that it is aware of. If the peer list is shorter than you expect it to be, then gossip is not configured correctly. Ensure that the anchor peer addresses and ports correctly resolve and correspond to the desired peer, ensure that the peer's TLS certificates validly chain to the TLS CAs defined in the channel config, and ensure that the external endpoint on the peers is set to true. Once you have resolved any underlying gossip networking configuration problems, your PDC distribution should begin to work.