I am trying to learn HLF 2.0 chaincode lifecycle, my network configuration as follows
- Two orgs with one peer each
- RAFT as ordering service(total 3 orderes)
Following the official doc to install the chaincode https://hyperledger-fabric.readthedocs.io/en/release-2.0/deploy_chaincode.html
when I try to commit the chaincode getting the following error
Error: proposal failed with status: 500 - failed to invoke backing implementation of 'CommitChaincodeDefinition': chaincode definition not agreed to by this org (LeftOrgMSP)
however when i check the commitreadyness
{
"approvals": {
"LeftOrgMSP": true,
"RightOrgMSP": false
}
}
i got the LeftOrgMSP as true
UPDATE
command for approving org
peer lifecycle chaincode approveformyorg -o orderer1.base.order:7050 --channelID basechannel --name fabcar --version 1.0 --package-id $CC_PACKAGE_ID --sequence 1 --tls \
--cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/base.order/orderers/orderer1.base.order/msp/tlscacerts/tlsca.base.order-cert.pem
command to commit
peer lifecycle chaincode commit -o orderer1.base.order:7050 --channelID basechannel \
--name fabcar --version 1.0 \
--sequence 1 --tls true \
--cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/base.order/orderers/orderer1.base.order/msp/tlscacerts/tlsca.base.order-cert.pem \
--peerAddresses peer1.base.left:7051 \
--tlsRootCertFiles /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/peerOrganizations/base.left/peers/peer1.base.left/tls/ca.crt