Some details of the dissemination of the principles and protocols Fabric v1.x Gossip

First, the function Gossip Protocol

Fabric needed to trade turnover between the three different types of nodes, need to be very safe, reliable and scalable transport protocol to ensure the integrity and consistency of the data, therefore Fabric achieved Gossip data transfer protocol. Gossip Using a random way information is spread throughout the network, and the meaning of its name, like, similar to the spread of rumors of scandal.

Gossip protocol specific functions are as follows:

  • Maintenance and management of channel members to discover new peer nodes, peer nodes continue to probe state, and updates the membership;
  • Between peer nodes in the transmission channel data books, peer will continue to receive requests from other peer data transmission, data received when new books of peer nodes, will be saved to the local books, and then also the data to other books spread awareness the peer node;
  • For new books added peer or peer backward state, you can quickly access to books via point to point data transmission status.

Two, Leader Peer

When a new trading blocks, Leader Peer will be to connect ordering service, pull a new block, while block randomly spread to other Committing peers within the organization, then these nodes will continue to spread to other Committing peers .
Allows the definition of one or more Leader Peer within an organization.

Leader Election

Leader election include static (Static) mode and dynamic (Dynamic) mode:

  • Static:
    The system administrator to manually configure the tissue to be a peer Leader, there may be one or more Leading peer within an organization, to set the current peer Leader manner as follows:
peer:
# Gossip related configuration
gossip: useLeaderElection: false
orgLeader: true
  • The Dynamic:
    peers perform a leader election process to select a leader within the organization, the elected leader dynamically send heartbeat messages to other peers, as evidence of survival, the configuration example is shown below:
peer:
	# Gossip related configuration
	gossip:
		useLeaderElection: true
		orgLeader: false
		election:
			leaderAliveThreshold: 10s

Three, Anchor Peer

Anchor Peer is used to ensure that gossip Peers different organizations know each other, between different tissues Anchor peer can communicate with each other, then the members of the organization can be in communication with Anchor peer, whereby data transmission between host tissue Peer. Anchor Peer equivalent of a bridge in different organizations.

Set anchor peer configuration way is to send a sum of the transaction, because you want other organizations to know what is anchor peer organizations, which need to broadcast to all other nodes.

Four, Gossip Spread principle

Online peers to show their availability, will continue to broadcast "alive" messages, other peers also collect "alive" messages, so as to maintain membership of the channel.

When the leader peer trading blocks to get from ordering service, will spread to other Peers in the organization, after the Peers receive messages to keep books, blocks also automatically distribute these messages. Each peer will continue to ask from other peers on the channel state, to see whether there are differences, there are differences in the pull block through P2P way to quickly repair their own books state.

Gossip protocol is not spread across the channel, peers on a channel can not be transmitted on any other channel message or share information.

Published 30 original articles · won praise 3 · Views 5726

Guess you like

Origin blog.csdn.net/ice_fire_x/article/details/104407240