Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added more information querying to sentinel. #209

Merged
merged 3 commits into from
Feb 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 36 additions & 1 deletion p2psentinel/sentinel.proto
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,21 @@ message SubscriptionData {

message Peer {
string pid = 1;
string state = 2;
string direction = 3;
string address = 4;
string enr = 5;
string agent_version = 6;
}


message PeersInfoRequest {
optional string direction = 1;
optional string state = 2;
}

message PeersInfoResponse {
repeated Peer peers = 1;
}

message GossipData {
Expand All @@ -31,7 +46,11 @@ message Status {
}

message PeerCount {
uint64 amount = 1;
uint64 active = 1; // Amount of peers that are active.
uint64 connected = 2;
uint64 disconnected = 3;
uint64 connecting = 4;
uint64 disconnecting = 5;
}

message RequestData {
Expand All @@ -45,6 +64,20 @@ message ResponseData {
Peer peer = 3;
}

message Metadata {
uint64 seq = 1;
string attnets = 2;
string syncnets = 3;
}

message IdentityResponse {
string pid = 1;
string enr = 2;
repeated string p2p_addresses = 3;
repeated string discovery_addresses = 4;
Metadata metadata = 5;
}

service Sentinel {
rpc SubscribeGossip(SubscriptionData) returns (stream GossipData);
rpc SendRequest(RequestData) returns (ResponseData);
Expand All @@ -55,4 +88,6 @@ service Sentinel {
rpc PenalizePeer(Peer) returns(EmptyMessage);
rpc RewardPeer(Peer) returns(EmptyMessage);
rpc PublishGossip(GossipData) returns(EmptyMessage);
rpc Identity(EmptyMessage) returns(IdentityResponse); // Returns the identity of the peer.
rpc PeersInfo(PeersInfoRequest) returns(PeersInfoResponse); // Returns the identity of the peer.
}
Loading