Caliper Fabric support AND/OR endorsement policy?
Which Caliper version are you using?
0.5.0
Which Node.JS version are you using?
16.18.1
Which operating system are you using?
Ubuntu 18.04.6 LTS
Please provide some context for your error. For example, when did the error occur? What were you trying to achieve, and how?
I'm trying to specify endorsement policy:
./network.sh deployCC -ccn simple -ccp ../../caliper-benchmarks/src/fabric/scenario/simple/go -ccl go -ccep "AND('Org1.peer','Org2.peer')"
although changed test-network.yaml organizations identity information, still can't satisfy the endorsement policy.
i use docker to start caliper, IdentityManager shows:
Adding Admin (admin=false) as Admin for organization Org1MSP
Adding User1 (admin=false) as _Org2MSP_User1 for organization Org2MSP
Adding Admin (admin=false) as _Org2MSP_Admin for organization Org2MSP
Adding User1 (admin=false) as User1 for organization Org1MSP
is this correct? always show (admin=false), maybe Admin should show true?
besides, i want to know the meaning of attribute discover in test-network.yaml
What was the observed incorrect behavior?
can't satisfy the endorsement policy
Please provide the error logs and their surroundings.
2024.02.07-19:03:30.789 error [caliper] [connectors/peer-gateway/PeerGateway] Failed to perform submit transaction [open] using arguments [sb,100000], with error: EndorseError: 9 FAILED_PRECONDITION: no combination of peers can be derived which satisfy the endorsement policy: no peer combination can satisfy the endorsement policy
Details:
2024.02.07-19:03:30.796 error [caliper] [connectors/peer-gateway/PeerGateway] Failed to perform submit transaction [open] using arguments [fsb,100000], with error: EndorseError: 9 FAILED_PRECONDITION: no combination of peers can be derived which satisfy the endorsement policy: no peer combination can satisfy the endorsement policy
Details:
2024.02.07-19:03:30.802 error [caliper] [connectors/peer-gateway/PeerGateway] Failed to perform submit transaction [open] using arguments [gsb,100000], with error: EndorseError: 9 FAILED_PRECONDITION: no combination of peers can be derived which satisfy the endorsement policy: no peer combination can satisfy the endorsement policy
Details:
Please provide your benchmark configuration file content, if possible.
No response
Please provide your network configuration file content, if possible.
organizations:
- mspid: Org1MSP
# Identities come from cryptogen created material for test-network
identities:
certificates:
- name: 'User1'
clientPrivateKey:
path: './fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/users/[email protected]/msp/keystore/priv_sk'
clientSignedCert:
path: './fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/users/[email protected]/msp/signcerts/[email protected]'
- name: 'Admin'
clientPrivateKey:
path: './fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/users/[email protected]/msp/keystore/priv_sk'
clientSignedCert:
path: './fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/users/[email protected]/msp/signcerts/[email protected]'
connectionProfile:
path: './fabric-samples/test-network/organizations/peerOrganizations/org1.example.com/connection-org1.yaml'
discover: true
- mspid: Org2MSP
# Identities come from cryptogen created material for test-network
identities:
certificates:
- name: 'User1'
clientPrivateKey:
path: './fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/users/[email protected]/msp/keystore/priv_sk'
clientSignedCert:
path: './fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/users/[email protected]/msp/signcerts/[email protected]'
- name: 'Admin'
clientPrivateKey:
path: './fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/users/[email protected]/msp/keystore/priv_sk'
clientSignedCert:
path: './fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/users/[email protected]/msp/signcerts/[email protected]'
connectionProfile:
path: './fabric-samples/test-network/organizations/peerOrganizations/org2.example.com/connection-org2.yaml'
discover: true
Please provide your workload module content, if possible.
No response
Please provide any additional information you deem relevant to the error.
No response
The documentation is missing some minor improvements, but it does explain how to label an identity as an admin identity. However labeling identities as admin is only required if you are going to use caliper to install/instantiate chaincode and that capability is deprecated and should not be used now as it has been removed from the codebase and won't be in any future version if caliper (and it only works when bound to fabric 1.4 anyway). So the identities showing up as admin=false is exactly what you would expect and want.
As you are using the peer gateway to interact with fabric (as you bound to fabric:2.4) the discovery option is not used and ignored. If you were using 1.4 (gateway option) or 2.2 then you can specify whether the connection profile is dynamic (discovery:true) or static (discovery:false). The difference is covered in the Fabric documentation on connection profiles but basically discovery means it will get the network topology from the peer rather than having the network topology described completely in the connection profile.
The error you are seeing EndorseError: 9 FAILED_PRECONDITION: no combination of peers can be derived which satisfy the endorsement policy: no peer combination can satisfy the endorsement policy is coming from the fabric peer itself as it tries to determine a combination of peers that would satisfy your endorsement policy + any state based endorsement + safeguards if you are using private data and as such caliper has no control over this. It just sends the request and it's getting rejected by fabric itself. There can be many reasons for this to happen for example incorrect definition of anchor peers, or the peer gateway being too overly cautious with private data, but this is an issue with your fabric setup and chaincode implementation combination and I think you will have to read up more about fabric and the peer gateway in the official fabric documentation and if required seek more help from the fabric community. From a caliper setup point of view everything looks ok and this isn't an issue with caliper or your caliper configuration
A few observations on the documentation/code for the next release
- Remove the concept of admin identities from the documentation
- Remove the logic that recognises admin identities and display a message. It is not required anymore as the code has gone to install/instantiate
- Note in the documentation that discovery definition for a connection profile doesn't apply when binding to fabric:2.4