Hyperledger Fabric中AND('Org1.member','Org2.member')的YAML背书政策查询
YAML Format for Hyperledger Fabric Endorsement Policy: AND('Org1.member', 'Org2.member')
Alright, since you're working through the BYFN network in Fabric Samples 1.0 and need to translate that logical endorsement policy into structured YAML, here's exactly what you need to enforce signatures from one member each of Org1 and Org2:
identities: - role: name: member mspId: Org1MSP - role: name: member mspId: Org2MSP policy: 1-of: - 1-of: - signed-by: 0 - 1-of: - signed-by: 1
Let me break down what this does:
- The
identitiessection defines two valid signer roles: a member of Org1 (indexed as0) and a member of Org2 (indexed as1). - The
policysection uses nested1-ofrules to implement the AND logic:- First, we require at least 1 signature from the first identity group (Org1 members)
- Second, we require at least 1 signature from the second identity group (Org2 members)
Together, these two conditions mean both organizations must provide a member signature for the endorsement to be valid—exactly matching yourAND('Org1.member', 'Org2.member')requirement.
If you're specifying this policy during chaincode instantiation, you might also see the shorthand command-line syntax -P "AND('Org1MSP.member','Org2MSP.member')", but the YAML above is the fully structured version that maps directly to that logical expression.
内容的提问来源于stack exchange,提问作者Skadoosh
相关产品推荐
相关产品推荐

