-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FAB-2007] Gossip:Add support of external endpoint
Peers in the same organization might need to communicate by connecting to endpoints that are only route-able from within the organization, and when communication with peers in different organizations, they should connect to endpoints that are route-able from outside the organization. For example if the peers are behind a NAT with port-forwarding rules for the peers. This commit adds an internal endpoint to the Member proto message. The endpoint is signed separately and when a message would cross an organization, the inner endpoint would be deleted from the last peer that was in the source organization. The access control and filtering will be done in upcoming commits. This commit only adds the internal endpoint, and changes the gossip logic to prefer using the internal endpoint over the external one. Unit tests: I changed the discovery and gossip unit tests accordingly, and added a check in the discovery unit test that both endpoints are gossiped to peers. In the gossip unit-tests, made sure that the external endpoint is never used, and only the internal one is used. In upcoming commits, I would add tests that have several organizations. How was this tested? This commit doesn't add any new functionality, so I just tested that the communication and discovery between peers wasn't damaged. I ran a modified docs/channel-setup.md with an additional peer (peer1) - Once with CORE_PEER_GOSSIP_BOOTSTRAP=ip-of-peer-0:7051 and saw that peers were able to connect to one another - Once without any bootstrap set, but created an anchor peer file with the ip address of peer0, and made peer0 and peer1 join the channel and saw in the logs that channel-based messages were sent between the peers. Signed-off-by: Yacov Manevich <yacovm@il.ibm.com> Change-Id: I243b55fc192c3d7e516598a899cd58039ded7587
- Loading branch information
Showing
14 changed files
with
378 additions
and
211 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.