背书逻辑在超级账本中有哪些应用?

What are applications of an endorsement logic in hyperledger?

我正在尝试理解由超级账本同行背书的交易的想法。

虽然 Next-Consensus-Architecture-Proposal.md 文档中描述的关于所需背书集的示例非常简单,但我想知道背书逻辑是否可以在对链码进行 Invoke 调用期间执行类似以下示例的操作:

"if a value A is even and a value B is odd then return transaction_is_not_valid otherwise return transaction_is_valid "

(参考 chaincode_example0x 我不确定我是否正确地解释了整个想法。

来自Next-Consensus-Architecture-Proposal.md

An endorsement shall be evaluated locally by every peer such that a peer does not need to interact with other peers, yet all correct peers evaluate the endorsement policy in the same way.

...

The assignment of stake in the previous example condition could be static (fixed in the metadata of the chaincode) or dynamic (e.g., dependent on the state of the chaincode and be modified during the execution).

=> 禁止调用事务,但可以查询世界状态的值。所以上面的逻辑可以表示为背书策略。但是,我认为背书策略不应该保持状态一致性逻辑,有效性规则最好在链代码本身内部实现(并且应该通过将事务标记为无效来防止违反它的方法调用)。