Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
379 views
in Technique[技术] by (71.8m points)

blockchain - 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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...