If peers use the same chain code, is there any cha

2019-08-25 09:52发布

I will ask you thought Endorsement Policy example below

peer chaincode instantiate -C <channelid> -n mycc -P "AND('Org1.member', 'Org2.member')"

My understanding(Promise)

  • Org1.member or Org2.member refer to Peer.
  • The example means that Org1.member and Org2.member should have to get the same result as instantiating mycc.

Question

  1. If Org1.member and Org2.member have same chaincode, could their result be different?
  2. Are Org1.member and Org2.member refer to one peer of Organization? (2-1. If so, does the peer be set on organization randomly?)
  3. Can I use regular expressions like "AND('Org1.member > 10', 'Org2.member > 10')"

1条回答
The star\"
2楼-- · 2019-08-25 10:18

I hope you have referred to the fabric documentation on endorsement already. If not, then please find it here endorsement-policies

A principal is described in terms of the MSP that is tasked to validate the identity of the signer and of the role that the signer has within that MSP. Currently, two roles are supported: member and admin. Principals are described as MSP.ROLE, where MSP is the MSP ID that is required, and ROLE is either one of the two strings member and admin. Examples of valid principals are 'Org0.admin' (any administrator of the Org0 MSP) or 'Org1.member' (any member of the Org1 MSP).

AND (Org1.member, Org2.member) means that for successful endorsement, the transaction proposal response which is sent to Orderer ( from the client SDK) is expected to be signed by the member certificate of Peer of org1 and member certificate of the Peer of org2

  1. It is possible to have different result if your chaincode is Non-Deterministic ( ie, say its getting current time etc and putState() ). So write sets can be different.

  2. Org1.member & Org2.member are two different Peers. One peer belonging to Org1 and another peer belonging to Org2. [ You cannot have the Peer belonging to two organizations randomly ]

  3. I am not sure. Please check the link of Fabric Documentation above.

查看更多
登录 后发表回答