From 7392deef228773dcd7daaf7afecf20b7f92ace0b Mon Sep 17 00:00:00 2001 From: Giulio Date: Fri, 2 Feb 2024 12:30:19 +0100 Subject: [PATCH 1/3] added more verbosity to information in the sentinel --- p2psentinel/sentinel.proto | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/p2psentinel/sentinel.proto b/p2psentinel/sentinel.proto index 57634da..869cd45 100644 --- a/p2psentinel/sentinel.proto +++ b/p2psentinel/sentinel.proto @@ -14,6 +14,23 @@ message SubscriptionData { message Peer { string pid = 1; + string state = 2; + string direction = 3; + string address = 4; + string enr = 5; +} + +message PeerInfoRequest { + string pid = 1; +} + +message PeersInfoRequest { + optional string direction = 1; + optional string state = 2; +} + +message PeersInfoResponse { + repeated Peer peers = 1; } message GossipData { @@ -31,7 +48,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 { @@ -55,4 +76,7 @@ service Sentinel { rpc PenalizePeer(Peer) returns(EmptyMessage); rpc RewardPeer(Peer) returns(EmptyMessage); rpc PublishGossip(GossipData) returns(EmptyMessage); + rpc Identity(EmptyMessage) returns(Peer); // Returns the identity of the peer. + rpc PeerInfo(PeerInfoRequest) returns(Peer); // Returns the identity of the peer. + rpc PeersInfo(PeersInfoRequest) returns(PeersInfoResponse); // Returns the identity of the peer. } From 28135b83f15d1fb13d63d8b19ddcca4af431c377 Mon Sep 17 00:00:00 2001 From: Giulio Date: Fri, 2 Feb 2024 16:06:01 +0100 Subject: [PATCH 2/3] save --- p2psentinel/sentinel.proto | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/p2psentinel/sentinel.proto b/p2psentinel/sentinel.proto index 869cd45..52945a5 100644 --- a/p2psentinel/sentinel.proto +++ b/p2psentinel/sentinel.proto @@ -20,9 +20,6 @@ message Peer { string enr = 5; } -message PeerInfoRequest { - string pid = 1; -} message PeersInfoRequest { optional string direction = 1; @@ -66,6 +63,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); @@ -76,7 +87,6 @@ service Sentinel { rpc PenalizePeer(Peer) returns(EmptyMessage); rpc RewardPeer(Peer) returns(EmptyMessage); rpc PublishGossip(GossipData) returns(EmptyMessage); - rpc Identity(EmptyMessage) returns(Peer); // Returns the identity of the peer. - rpc PeerInfo(PeerInfoRequest) returns(Peer); // Returns the identity of the peer. + rpc Identity(EmptyMessage) returns(IdentityResponse); // Returns the identity of the peer. rpc PeersInfo(PeersInfoRequest) returns(PeersInfoResponse); // Returns the identity of the peer. } From 1cf37a5264cc4085f1b38612d5d6ba69b6621be8 Mon Sep 17 00:00:00 2001 From: Giulio Date: Sat, 3 Feb 2024 15:25:14 +0100 Subject: [PATCH 3/3] save --- p2psentinel/sentinel.proto | 1 + 1 file changed, 1 insertion(+) diff --git a/p2psentinel/sentinel.proto b/p2psentinel/sentinel.proto index 52945a5..3b477bf 100644 --- a/p2psentinel/sentinel.proto +++ b/p2psentinel/sentinel.proto @@ -18,6 +18,7 @@ message Peer { string direction = 3; string address = 4; string enr = 5; + string agent_version = 6; }