Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize block broadcast by using Gossip in super ledger Fabric

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

How to use Gossip to realize block broadcasting in super ledger Fabric? for this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.

Hyperledger Fabric is a distributed blockchain network in which each node holds a copy of the shared ledger that holds a deterministic history of all transactions. When new transactions occur, they must spread throughout the Hyperledger Fabric network in order to keep all copies of the books consistent. This article introduces the principle of the Gossip protocol mechanism and explains how Hyperledger Fabric uses the Gossip mechanism to ensure the data synchronization of all peer nodes.

At a large level, the whole transaction processing flow in Hyperledger Fabric is as follows:

The new deal is submitted to the sort node

The sort node creates a new block containing the newly generated transactions

Sort nodes distribute blocks to all peer nodes

The last step, distribution, is where the gossip protocol plays a role. Even in a Hyperledger Fabric network with only a small number of member organizations, there may be a large number of peer nodes. For example, a Hyperledger Fabric network that heavily uses IoT devices may need many Peer nodes to connect these IoT devices to the blockchain network. Furthermore, peer node connections in large-scale networks may be intermittent, and some peer nodes are not always accessed by sorted nodes. There is also no need to require sorting nodes to distribute new chunks to each peer node, and in some cases this requirement cannot be met.

Gossip: gossip; gossip; gossip

In fact, when the sorting node of Hyperledger Fabric distributes chunks, it only distributes the new chunks to the dominant peer nodes in each organization, and then through the gossip process, these peer nodes themselves spread the new chunks between each other:

One peer node has a message that needs to be spread to other peer nodes. For example, the leading peer node has a new block.

The peer node sends messages to (randomly selected) a predetermined number of other peer nodes

The peer node that receives the message sends the message to (randomly selected) a predetermined number of other peer nodes

This goes on and on until each peer node receives a message.

The above process, called broadcast, is applied to Fabric's gossip system to distribute various types of messages to all peer members.

1. Gossip process for network members

A core component of the Gossip protocol is that each peer forwards messages to a group of randomly selected nodes in the network. This implies that each peer node knows which peer nodes are in the network so that it can be randomly selected.

In Fabric, each peer node periodically broadcasts messages to indicate that it is alive and has been connected to the network. Each peer node maintains a list of all the peer nodes on the network-which peer is alive and which peer is dead.

When Peer A receives an alive message from Peer B, it marks Peer B as alive. For Peer A, Peer B is a member of the network

If after a period of time, Peer SA no longer receives an alive message from Peer B, it marks Peer B as dead. For Peer A, Peer B is no longer a member of the network.

Assuming that Peer B is not really dead, Peer A periodically attempts to connect to the Peer node marked dead to see if it is still alive. For example, it is possible that Peer B's alive messages cannot reach Peer A because of network problems or other Peer node failures, so when Peer A contacts Peer B directly, it can determine the true state of Peer B.

The process described above works only if the peer node has a list of peer nodes available to send alive messages. So each peer node has a boot node set at boot time to provide the initial list of peer nodes.

Each peer node signs the alive message it sends, which means that a bad guy can't fake a message to fool other network members. All this bad guy can do is not forward alive messages. As long as other peer nodes continue to forward alive messages, this is not a big deal.

2. Data Diffusion gossip process

As described earlier, the basic principles of data diffusion in Hyperledger Fabric networks are simple. Each peer node only needs to forward the new data to a group of randomly selected peer nodes, and finally can complete the diffusion of the new data in the whole network. This process is called broadcasting, with a push-based messaging scheme.

However, if a peer node is disconnected from the network and reconnected later, it may miss the broadcast process. In order to keep up with the data progress of other members of the network, this node needs a pull-based mechanism to request its missing data. In Hyperledger Fabric, network member data and account data are exchanged periodically between peer nodes, so that peer nodes can keep their update status even if they miss a broadcast process.

3. Gossip application in Hyperledger Fabric

Hyperledger Fabric uses Gossip as a scalable fault-tolerant mechanism between peer nodes to ensure that copies of account books on all peer nodes remain synchronized. The use of gossip effectively reduces the pressure on sorting nodes, because sorting nodes only need to distribute blocks to the dominant node in each organization, and it also allows peer nodes to keep up with the status updates of the entire network even in the case of disconnected reconnection.

This is the answer to the question about how the super ledger Fabric uses Gossip to achieve block broadcasting. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel for more related knowledge.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report