Skip to content

Commit

Permalink
Added more information querying to sentinel. (#209)
Browse files Browse the repository at this point in the history
* added more verbosity to information in the sentinel

* save

* save
  • Loading branch information
Giulio2002 authored Feb 3, 2024
1 parent a7fd851 commit 18e6676
Showing 1 changed file with 36 additions and 1 deletion.
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.
}

0 comments on commit 18e6676

Please sign in to comment.