mohammed
mohammed

Reputation: 383

How hyperledger fabric kafka consensus works

  1. How kafka consensus works in hyperledger fabric.?

  2. If i have three orderers which one will create block.?

  3. How messages will be delivered to all the peers.? are they fetched from kafka or orderer is responsible for delivering them.?

Upvotes: 3

Views: 4386

Answers (1)

yacovm
yacovm

Reputation: 5140

  1. Consensus in blockchain involves nodes agreeing on the same order of transactions. Ordering nodes send to Kafka transactions, and receive from Kafka transactions in the same order, since Kafka presents an abstraction of a shared queue.
  2. All orderers create blocks when they read enough messages or enough data from kafka. Also - if a transaction was sent but no block was created, and enough time (timeout) passed - the orderer node would send a special message to Kafka that would signal all ordering nodes to cut a block. This ensures that all orderers cut blocks based on timeout, but also that they cut the same blocks.
  3. Each leader peer connects to a random orderer and then sends a request, saying from what block index it wants to receive blocks. Then - the orderer reads the blocks from its file system and sends them to the peer. When the peer receives the blocks, it also sends them to other peers via the gossip component inside the peer, which ensures peers stay in sync.

Upvotes: 5

Related Questions