Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hyperledger Fabric GOSSIP_BOOTSTRAP & GOSSIP_EXTERNALENDPOINTS

I was looking into the docker configuration files and found two parameters in peer environment as shown below:

environment:
      - CORE_PEER_ID=peer0.org1.example.com
      - CORE_PEER_ADDRESS=peer0.org1.example.com:7051
      - CORE_PEER_GOSSIP_BOOTSTRAP=peer1.org1.example.com:7051
      - CORE_PEER_GOSSIP_EXTERNALENDPOINT=peer0.org1.example.com:7051
      - CORE_PEER_LOCALMSPID=Org1MSP 

Can anyone explain what there two variables CORE_PEER_GOSSIP_BOOTSTRAP & CORE_PEER_GOSSIP_EXTERNALENDPOINT works. How they can be configured in case of odd number of peers.

A detailed explanation would be really appreciated.

like image 439
Akshay Sood Avatar asked Jul 17 '18 09:07

Akshay Sood


People also ask

What is gossip based data dissemination?

The gossip-based data dissemination protocol performs three primary functions on a Fabric network: Manages peer discovery and channel membership, by continually identifying available member peers, and eventually detecting peers that have gone offline. Disseminates ledger data across all peers on a channel.

What are the two types of transactions in the Hyperledger fabric?

Transactions may be of two types: Deploy transactions create new chaincode and take a program as parameter. When a deploy transaction executes successfully, the chaincode has been installed “on” the blockchain. Invoke transactions perform an operation in the context of previously deployed chaincode.

What is peer in Hyperledger fabric?

Peers are a fundamental element of the network because they host ledgers and smart contracts. Recall that a ledger immutably records all the transactions generated by smart contracts (which in Hyperledger Fabric are contained in a chaincode, more on this later).

Which of the following allows private ledgers between two or more participants?

Hyperledger Fabric allows two or more participants to create a private channel for creating and maintaining the separate ledger of transactions. This ledger is not visible to anyone else than the member participating in the channel.

What is Hyperledger Fabric and how does it work?

What actually happens in Hyperledger Fabric is that the orderer only delivers new blocks to a single peer in each organization — the leader peer. Through a process called gossip, the peers themselves do the job of spreading the word to each other: A peer has a message that needs to be distributed to all other peers.

How do I configure gossip to point to bootstrap peers?

If you are using gossip, you will typically configure all the peers in your organization to point to an initial set of bootstrap peers (you can specify a space-separated list of peers). The internal endpoint is usually auto-computed by the peer itself or just passed explicitly via core.peer.address in core.yaml.

What is gossip data dissemination in fabric?

To meet these requirements, Fabric implements a gossip data dissemination protocol. Peers leverage gossip to broadcast ledger and channel data in a scalable fashion. Gossip messaging is continuous, and each peer on a channel is constantly receiving current and consistent ledger data from multiple peers.

What is the gossip protocol?

A key component of the gossip protocol is that each peer forwards messages to a random selection of the current peers in the network. This implies that each peer knows which peers are in the network so it can choose among them.


1 Answers

Gossip can be used just between peers in the same organization or between peers in different organizations. It is always scoped to specific channels.

1) Communication between the peers in a single organization

  • One peer may be the leader and connect to the ordering service and deliver blocks to other peers in its own organization

  • A peer can connect to other peers in its organization to obtain missing blocks

2) Communication between peers in different organizations

  • In v1.2 when using the private data feature, gossip is used to distribute the private data to other peers in the org at endorsement time

  • Peers can get missing blocks that have been already committed, from peers in other organizations

  • Peers can get missing private data from peers in other organizations at commit time

In order for gossip to actually work, it needs to be able to obtain the endpoint information for peers in its own organization as well as from peers in other organizations.

CORE_PEER_GOSSIP_BOOTSTRAP is used to bootstrap gossip within an organization. If you are using gossip, you will typically configure all the peers in your org to point to an initial set of peers for bootstrap (you can specific a space-separated list of peers). Off course peers can bootstrap from different peers as well, but in that case you just need to make sure that there's a bootstrap path across all peers. Peers within an organization will typically communicate on their internal endpoints (meaning you do not have to expose all the peers in an org publicly). When the peer contacts the bootstrap peer, it passes it's endpoint info and then gossip is used to distribute the info about all the peers in the organization among the peers in the organization.

In order for peers to communicate across organizations, again some type of bootstrap information is required. The initial cross-organization bootstrap information is provided via the "anchor peers" setting in the channel configuration. This allows peers who have joined a channel to discover other peers on the channel as well. But clearly initially a peer in on organization will only know about the anchor peers for there organizations. If you want to make other peers in your organization known to other organizations, then you need to set the CORE_PEER_GOSSIP_EXTERNALENDPOINT property. If this is not set, then the endpoint information about the peer will not be broadcast to peers in other organizations, and in fact - that peer will only be known to its own organization.

like image 63
Gari Singh Avatar answered Oct 12 '22 16:10

Gari Singh