Hyperledger Fabric GOSSIP_BOOTSTRAP & GOSSIP_EXTERNALENDPOINTS

送分小仙女□ 提交于 2019-11-30 10:37:30
Gari Singh

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!