Re: Fabric 2.0 - Commit Chaincode

Nikhil Gupta


Does your organization have the endorsement sub policy?

Type: Signature
Rule: "OR('Org1MSP.peer')"

-----fabric@... wrote: -----
To: Fabric <fabric@...>
From: "Nicholas Leonardi via"
Sent by: fabric@...
Date: 04/07/2020 01:53PM
Subject: [EXTERNAL] [Hyperledger Fabric] Fabric 2.0 - Commit Chaincode

Hey guys,
I have a simple network with 1 org, 3 orderers and 1 peer.
I can't seem to commit the chaincode.
I'm able to package, install and approveForMyOrg. I checked
the commit readiness and it is showing as true for my org

"approvals": {
"Org1MSP": true

Only the commit isn't working. I checked everything, the MSP envs,
paths to the certs, --peerAddresses, fabric-cfg-path env


The peer logs gives this error:

VSCC error: stateBasedValidator.Validate failed, err validation of endorsement policy for chaincode _lifecycle in tx 3:0 failed: implicit policy evaluation failed - 0 sub-policies were satisfied, but this policy requires 1 of the 'Endorsement' sub-policies to be satisfied
The configtx ApplicationDefaults are correct. Also, the configtx.yaml was copied from the fabric samples so everything is there.

Type: ImplicitMeta
Rule: "MAJORITY Endorsement"
Type: ImplicitMeta
Rule: "MAJORITY Endorsement"

Since there is only one org, it is the majority. I've tried everything, nothing seems to work. Can anyone
shed some light?

Thanks in advance. 

Below are the commands I'm using to install cc

peer lifecycle chaincode package chaincode.tar.gz --path /etc/hyperledger/chaincode --lang node --label ccv1

lifecycle chaincode install chaincode.tar.gz

peer lifecycle chaincode approveformyorg -o --channelID channel --name chaincode --version 1.0 --init-required --sequence 1 --tls --cafile /etc/hyperledger/crypto-config/ordererOrganizations/orderers/ --package-id myccv1:f997652c8722e223ccc7453128d5d8db797e9a1abf712863a255c8338530ed6d

peer lifecycle chaincode commit -o --channelID channel --name chaincode --version 1.0 --sequence 1 --init-required --tls true --cafile /etc/hyperledger/crypto-config/ordererOrganizations/orderers/ --peerAddresses --tlsRootCertFiles /etc/hyperledger/crypto-config/peerOrganizations/peers/

Join to automatically receive all group messages.