Re: Commit readiness returns false but approvalformyorg returned success #fabric-chaincode


David Faulstich Diniz Reis
 

You are checking the commit readness with a different endorsement policy.

The checkcommitreadness  needs to be crafted with the same policy signature parameter. Try adding signature-policy ${SIG_POLICY} to the check.

Kind regards.

David

Em qua., 15 de jun. de 2022 11:21, <jeff.jo95z@...> escreveu:

Hi all,

I am executing this command for approving:

 peer lifecycle chaincode approveformyorg -o ${ORDERER0_URL} --ordererTLSHostnameOverride $ORDERER_ORG --tls true --cafile ${CA_FILE} \

 --channelID ${CHANNEL_ID} --name ${CC_NAME} --version ${VERSION} --collections-config ${COLL_CONFIG} --signature-policy ${SIG_POLICY} \

 --package-id ${PACKAGE_ID} --init-required --sequence  ${SEQUENCE} --tlsRootCertFiles ${CORE_PEER_TLS_ROOTCERT_FILE} --waitForEvent

 

and the response is :

2022-06-15 13:59:26.582 UTC [chaincodeCmd] ClientWait -> INFO 001 txid [6641dad8236e1b7b8bfed56222b7b0040ae1f5f30f857ace5d01d53395e4f3c3] committed with status (VALID) at 0.0.0.0:7051

 
but when I am checking the Commit readiness:
 
 
 peer lifecycle chaincode checkcommitreadiness --channelID $CHANNEL_ID --name ${CC_NAME} --version ${VERSION} --sequence ${SEQUENCE} --output json
 
response is :
 
{
        "approvals": {
                "Org1MSP": false,
                "Org2MSP": false
        }
}
 
What maybe the reason?
 
When I am approving without  :
--collections-config ${COLL_CONFIG} --signature-policy ${SIG_POLICY}
 
its working:
peer lifecycle chaincode approveformyorg -o ${ORDERER0_URL} --ordererTLSHostnameOverride $ORDERER_ORG --tls --cafile ${CA_FILE} \
 --channelID ${CHANNEL_ID} --name ${CC_NAME} --version ${VERSION} --package-id ${PACKAGE_ID} --sequence  ${SEQUENCE}
 
with COLL_CONFIG and SIG_POLICY its not working
 
these are the values:
export COLL_CONFIG=${PWD}/private_collections/collections_config.json
export SIG_POLICY="AND('Org1MSP.member','Org2MSP.member')"
 
this is my collections_config.json:
 
[
 
    {
        "name": "dhl-bmsinv",
        "policy": "OR('Org1MSP.member','Org2MSP.member')",
        "requiredPeerCount": 0,
        "maxPeerCount": 1,
        "blockToLive":0,
        "memberOnlyRead": true,
        "memberOnlyWrite": true,
        "endorsementPolicy": {
            "signaturePolicy": "AND('Org1MSP.member','Org2MSP.member')"
           }
    }
 
 
]
 

Join fabric@lists.hyperledger.org to automatically receive all group messages.