-1

No peers defined in the channel that have the ledger query role. Failed to execute the transaction: Error: No peers defined in the channel that have the ledger query role.

When I remove particular chaincode in the start.sh file, It is working fine. I'm adding one more chaincode to the channel, when deploying the chaincode it is showing 200. But when I try to query the chaincode, I'm getting this error.

Here is the error message that I'm getting

1

I checked with the config.yaml file. Everything good. Working fine with other chaincodes.

vimuth
  • 5,064
  • 33
  • 79
  • 116

1 Answers1

0

The client-side error you are seeing has nothing to do with chaincode. It is a failure to identify any peers (with the ledger query role) in your connection profile for the channel name you have specified, only if you are not using service discovery to locate network nodes. You probably need to check:

  1. Which connection profile you are specifying when calling gateway.connect().
  2. Exactly which channel name you are specifying in your client application when calling gateway.getNetwork().
  3. That this channel name is defined in your connection profile.
  4. There are peers defined for this channel in your connection profile.
  5. The peer definitions don't explicitly disable the the ledger query role.

The error message you are seeing only exists in the v1.4 legacy Node client SDK, which is no longer supported. If at all possible, I would recommend using Fabric v2.4 (or later) and the newer Fabric Gateway client API.

bestbeforetoday
  • 1,302
  • 1
  • 8
  • 12