Search code examples
hyperledger-fabricblockchaincommitchaincode

Chaincode definition not agreed to by this org (Org1MSP)


When I try to run the following command to commit the chaincode,

peer lifecycle chaincode commit -o localhost:7050 --ordererTLSHostnameOverride orderer.example.com --tls $CORE_PEER_TLS_ENABLED --cafile $ORDERER_CA --channelID testchannel --name property --peerAddresses localhost:7051 --tlsRootCertFiles $CORE_PEER_TLS_ROOTCERT_FILE_ORG1 --peerAddresses localhost:9051 --tlsRootCertFiles $CORE_PEER_TLS_ROOTCERT_FILE_ORG2 --version 1.0 --sequence 1 --init-required

I encountered the error as follows even though the org1 approved the chaincode definition,

Error: proposal failed with status: 500 - failed to invoke backing implementation of 'CommitChaincodeDefinition': chaincode definition not agreed to by this org (Org1MSP)

Error Screenshot I've attached a screenshot of the error. Both organizations approved the chaincode definition by returning 'true' in this scenario. It still encounters the error "chaincode definition not agreed to by this org (Org1MSP)" after that.

How can I rectify from this?


Solution

  • The checkcommitreadiness uses a contract called product whereas the commit uses a contract called property.