Orderer 在 Hyperledger Fabric 中的主要作用是什么?

What is the main role of Orderer in Hyperledger Fabric?

我很好奇Orderer在Hyperledger Fabric中的主要作用。有的教程说它是一个验证器,有的说它是用于共识。

Ordering service provides a shared communication channel to clients and peers, offering a broadcast service for messages containing transactions. Clients connect to the channel and may broadcast messages on the channel which are then delivered to all peers. The channel supports atomic delivery of all messages, that is, message communication with total-order delivery and (implementation specific) reliability. In other words, the channel outputs the same messages to all connected peers and outputs them to all peers in the same logical order.

摘自 official documentation.

排序服务无法进行交易验证,它的主要目标是为已发布的交易提供总订单,用已排序的交易切割块。

Orderer负责将交易打包成Blocks,并通过网络分发给Anchor Peers。

transaction flow of Fabric have the steps Proposal, Packaging and Validation. The orderer is responible for Packaging并参与 distribution of new blocks on the network 的验证步骤。

因此,Fabric Order 的默认生产就绪实现基于 Apache Kafka,其中“Kafka is a messaging software that has high throughput fault tolerant feature”。 Orderer 没有持久性,没有数据库,没有自己的分类账。

不幸的是,负责分发新块的排序节点并不意味着它是 Fabric 网络中唯一需要了解其他节点的节点(会不会太简单了,不是吗?)。在提议步骤中,客户需要请求背书节点同意(签署)提议的链代码调用的结果。背书节点由背书策略定义,并通过 service discovery 找到。