3

Im trying to invoke a transaction on basic network The error that I get is:

[discovery] chaincodeQuery -> ERRO 06c Failed constructing descriptor for chaincode chaincodes:<name:"mycc" > ,: cannot satisfy any principal combination

After a search I did i found that this error occurs when the peer's enroll id type does not match the smart contract endorsement policy that was configured when the smart contract was instantiated on the channel.

The fix for that as described on this link: https://cloud.ibm.com/docs/services/blockchain-rhos?topic=blockchain-rhos-ibp-v2-troubleshooting#ibp-v2-troubleshooting-anchor-peer is that the only way to resolve this error is to delete the peer and create a new one with an enroll id that has the correct type peer.

How am I doing that?

I have succesfully install, instantiated and run contracts on byfn(first network sample). Whats different on the basic network other than the existence of a CA container.

Thats how I instantianted the contract:

peer chaincode instantiate -o orderer.example.com:7050 -C $CHANNEL_NAME -n mycc -l node -v 1.0 -c '{"Args":[]}' -P "AND ('Org1MSP.peer')"

Thanks in advance

  • You are defining an endorcement policy spefic for peer, but did you enable correct MSPs and enabled EnableNodeOUs? Otherwise you cannot do that. Try with another policy, like "Org1.member" – RicNtt Jan 21 '20 at 10:16
  • no.Nothing changed with "Org1.member". I've tried invoking with cli(didn't work),tried threw vsIBMextension(didn't work) and even wrote node.js program to invoke it(didn't work either). But node.js throws another error first: ~~~ 2020-01-23T19:46:49.378Z - error: [Channel.js]: Channel:mychannel received discovery error:failed constructing descriptor for chaincodes: 2020-01-23T19:46:49.379Z - error: [DiscoveryEndorsementHandler]: endorse - no endorsement plan found for {"chaincodes":[{"name":"mychaincodes"}]} ~~~ – Giorgos Niotis Jan 23 '20 at 19:53
  • So you were right but there was also a problem with my chaincode. After fixing that. your way was right. After changing to .member everything went straight. Thanks – Giorgos Niotis Jan 26 '20 at 23:49
  • Very good, happy to hear this. Just added this as answer to the question. Please mark it as answer too so that we close this. Best :) – RicNtt Jan 27 '20 at 09:07
  • is there any way to contact you to ask you some more questions? – Giorgos Niotis Jan 27 '20 at 18:17
  • I'm having similar issues. I defined policies as "And(Org1.member, ...)". What exactly did you fix in your chaincode? – Eduardo Pascual Aseff Jun 14 '20 at 18:56

1 Answers1

0

You are defining an endorcement policy spefic for peer, but did you enable correct MSPs and enabled EnableNodeOUs? Otherwise you cannot do that. Try with another policy, like "Org1.member"

RicNtt
  • 622
  • 3
  • 12