If peers use the same chain code, is there any chance that Endorsement of Endorsement Policy will be different?

痞子三分冷 提交于 2020-01-25 07:49:06

问题


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:


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.



来源:https://stackoverflow.com/questions/48105859/if-peers-use-the-same-chain-code-is-there-any-chance-that-endorsement-of-endors

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!