0 votes
1 view
in Blockchain by (4.1k points)

I changed the endorsement policy from "OR" to "AND" with BYFN and instantiate the Chaincode. But, the data in the ledger is not changed even after the Invoke is executed. I confirmed the "OR" condition is working. (data in the ledger is changed)

Kindly let me know how I can solve it.

peer chaincode instantiate -o orderer.example.com:7050 --tls $CORE_PEER_TLS_ENABLED --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C $CHANNEL_NAME -n mycc -v 1.0 -c '{"Args":["init","a", "100", "b","200"]}' -P "**OR** ('Org1MSP.member','Org2MSP.member')"


peer chaincode instantiate -o orderer.example.com:7050 --tls $CORE_PEER_TLS_ENABLED --cafile /opt/gopath/src/github.com/hyperledger/fabric/peer/crypto/ordererOrganizations/example.com/orderers/orderer.example.com/msp/tlscacerts/tlsca.example.com-cert.pem -C $CHANNEL_NAME -n mycc -v 1.0 -c '{"Args":["init","a", "100", "b","200"]}' -P "**AND** ('Org1MSP.member','Org2MSP.member')"

1 Answer

0 votes
by (14.4k points)

From what I understand about endorsements, you cannot actually use an endorsement policy with an AND condition in BYFN. You can do that only when you create your own client using one of the SDKs. 

What happens here internally is that the BYFN script leverages the peer CLI to run invokes on processes. The problem is that peer CLI cannot collect multiple endorsements. Therefore, AND has no use here as only one endorsement will be collected. Validation fails hence. 

Welcome to Intellipaat Community. Get your technical queries answered by top developers !