use peer center instance to gatter peers info (#21)

* use peer center instance to gatter peers info
This commit is contained in:
Sijie.Sun
2024-02-29 00:04:48 +08:00
committed by GitHub
parent 31af413b03
commit 24178bcf6e
8 changed files with 291 additions and 65 deletions

View File

@@ -115,3 +115,29 @@ service ConnectorManageRpc {
rpc ListConnector (ListConnectorRequest) returns (ListConnectorResponse);
rpc ManageConnector (ManageConnectorRequest) returns (ManageConnectorResponse);
}
enum LatencyLevel {
VeryLow = 0;
Low = 1;
Normal = 2;
High = 3;
VeryHigh = 4;
}
message DirectConnectedPeerInfo {
LatencyLevel latency_level = 2;
}
message PeerInfoForGlobalMap {
map<string, DirectConnectedPeerInfo> direct_peers = 1;
}
message GetGlobalPeerMapRequest {}
message GetGlobalPeerMapResponse {
map<string, PeerInfoForGlobalMap> global_peer_map = 1;
}
service PeerCenterRpc {
rpc GetGlobalPeerMap (GetGlobalPeerMapRequest) returns (GetGlobalPeerMapResponse);
}