File tree Expand file tree Collapse file tree 4 files changed +37
-9
lines changed Expand file tree Collapse file tree 4 files changed +37
-9
lines changed Original file line number Diff line number Diff line change @@ -123,18 +123,23 @@ message MessagesRequest {
123123 repeated MessageId ids = 1 ;
124124}
125125
126+ message PeersReply {
127+ repeated types.PeerInfo peers = 1 ;
128+ }
129+
126130message PeerCountRequest {}
127131
128132message PeerCountReply {uint64 count = 1 ;}
129133
130- message PeersRequest {}
131- message PeersReply {
132- enum PeerEvent {
134+ message PeerEventsRequest {}
135+ message PeerEvent {
136+ enum PeerEventId {
137+ // Happens after after a successful sub-protocol handshake.
133138 Connect = 0 ;
134139 Disconnect = 1 ;
135140 }
136141 types.H512 peer_id = 1 ;
137- PeerEvent event = 2 ;
142+ PeerEventId event_id = 2 ;
138143}
139144
140145service Sentry {
@@ -153,15 +158,16 @@ service Sentry {
153158 returns (SentPeers );
154159 rpc SendMessageToAll (OutboundMessageData ) returns (SentPeers );
155160
156-
157161 // Subscribe to receive messages.
158162 // Calling multiple times with a different set of ids starts separate streams.
159163 // It is possible to subscribe to the same set if ids more than once.
160164 rpc Messages (MessagesRequest ) returns (stream InboundMessage );
165+
166+ rpc Peers (google .protobuf .Empty ) returns (PeersReply );
161167 rpc PeerCount (PeerCountRequest ) returns (PeerCountReply );
168+ // Subscribe to notifications about connected or lost peers.
169+ rpc PeerEvents (PeerEventsRequest ) returns (stream PeerEvent );
162170
163- // Notifications about connected (after sub-protocol handshake) or lost peer
164- rpc Peers (PeersRequest ) returns (stream PeersReply );
165171 // NodeInfo returns a collection of metadata known about the host.
166172 rpc NodeInfo (google .protobuf .Empty ) returns (types .NodeInfoReply );
167173}
Original file line number Diff line number Diff line change @@ -47,11 +47,16 @@ service ETHBACKEND {
4747 // it doesn't provide consistency
4848 // Request fields are optional - it's ok to request block only by hash or only by number
4949 rpc Block (BlockRequest ) returns (BlockReply );
50+
5051 // High-level method - can find block number by txn hash
5152 // it doesn't provide consistency
5253 rpc TxnLookup (TxnLookupRequest ) returns (TxnLookupReply );
53- // NodeInfo collects and returns NodeInfo from all running celery instances.
54- rpc NodeInfo (NodesInfoRequest ) returns (NodesInfoReply );
54+
55+ // NodeInfo collects and returns NodeInfo from all running sentry instances.
56+ rpc NodeInfo (NodesInfoRequest ) returns (NodesInfoReply );
57+
58+ // Peers collects and returns peers information from all running sentry instances.
59+ rpc Peers (google .protobuf .Empty ) returns (PeersReply );
5560}
5661
5762enum Event {
@@ -179,3 +184,7 @@ message NodesInfoRequest {
179184message NodesInfoReply {
180185 repeated types.NodeInfoReply nodesInfo = 1 ;
181186}
187+
188+ message PeersReply {
189+ repeated types.PeerInfo peers = 1 ;
190+ }
Original file line number Diff line number Diff line change @@ -89,3 +89,16 @@ message NodeInfoReply {
8989 string listenerAddr = 6 ;
9090 bytes protocols = 7 ;
9191}
92+
93+ message PeerInfo {
94+ string id = 1 ;
95+ string name = 2 ;
96+ string enode = 3 ;
97+ string enr = 4 ;
98+ repeated string caps = 5 ;
99+ string connLocalAddr = 6 ;
100+ string connRemoteAddr = 7 ;
101+ bool connIsInbound = 8 ;
102+ bool connIsTrusted = 9 ;
103+ bool connIsStatic = 10 ;
104+ }
You can’t perform that action at this time.
0 commit comments