From 18e6676b844b2d1fbc676997927fb0c3e8003831 Mon Sep 17 00:00:00 2001 From: Giulio rebuffo Date: Sat, 3 Feb 2024 16:23:45 +0100 Subject: [PATCH] Added more information querying to sentinel. (#209) * added more verbosity to information in the sentinel * save * save --- p2psentinel/sentinel.proto | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/p2psentinel/sentinel.proto b/p2psentinel/sentinel.proto index 57634da..3b477bf 100644 --- a/p2psentinel/sentinel.proto +++ b/p2psentinel/sentinel.proto @@ -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 { @@ -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 { @@ -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); @@ -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. }