Using endorsements in Hyperledger Composer to design a process

旧巷老猫 提交于 2019-11-30 10:38:35

The endorsement process is described in the docs. That said, in simple terms, the process of endorsement involves an endorsing peer signing the read/write set of a transaction proposal with its certificate. This basically says: the peer identified by the signing certificate asserts that these are the read/write sets of the proposed transaction simulation.

A client that invokes a proposed transaction will need knowledge of the endorsement policy for that channel/chaincode so that it can transmit the proposed transaction to each of the endorsing peers (or to a sufficient subset of endorsing peers to satisfy the policy). When it has received the responses from each endorsing peer, it will check that the transaction is valid and then broadcast the endorsed transaction to the ordering service, which will add it to a block and broadcast to the validating peers for that channel.

Validating peers will then validate the endorsement policy of the channel/chaincode against the transactions in a block to ensure that:

  1. all endorsements are valid (i.e. they are valid signatures from valid certificates over the expected message)
  2. there are an appropriate number of endorsements
  3. endorsements come from the expected source(s)

If the endorsement policy is satisfied, then the transaction is committed and the world state updated with the read/write set.

At present, Composer cannot manage the endorsement policy, but this is definitely on the development roadmap.

The endorsement policy enables you the chance to add an extra verification layer to your Blockchain. You define it when you create the channel.

  • When a (Initial) Peer sends a proposal, firts of all the proposal is send to all of the Peers that you have defined in your Endorsement policy.
  • Then, each Endorser Peer executes the proposal against its ledger. The Endorser Peer will send the result signed to the Initial Peer.
  • The Initial Peer will receive more than one respone. Then, the Initial Peer will verify all the signatures and will compare the result of each response. The result sent by each Endorse Peer have to be the same.
  • In that case, the Initial Peer will send the transaction to the Orderers. That transaction will wraper all the responses all of the Endorses Peers.

So, you should define your Endorsement policy according to your requirements

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