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

RPC/Sentry: Peers method #102

Merged
merged 1 commit into from
Apr 25, 2022
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions p2psentry/sentry.proto
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ message MessagesRequest {
repeated MessageId ids = 1;
}

message PeersReply {
repeated types.PeerInfo peers = 1;
}

message PeerCountRequest {}

message PeerCountReply {uint64 count = 1;}
Expand Down Expand Up @@ -159,6 +163,7 @@ service Sentry {
// It is possible to subscribe to the same set if ids more than once.
rpc Messages(MessagesRequest) returns (stream InboundMessage);

rpc Peers(google.protobuf.Empty) returns (PeersReply);
rpc PeerCount(PeerCountRequest) returns (PeerCountReply);
// Subscribe to notifications about connected or lost peers.
rpc PeerEvents(PeerEventsRequest) returns (stream PeerEvent);
Expand Down
13 changes: 11 additions & 2 deletions remote/ethbackend.proto
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,16 @@ service ETHBACKEND {
// it doesn't provide consistency
// Request fields are optional - it's ok to request block only by hash or only by number
rpc Block(BlockRequest) returns (BlockReply);

// High-level method - can find block number by txn hash
// it doesn't provide consistency
rpc TxnLookup(TxnLookupRequest) returns (TxnLookupReply);
// NodeInfo collects and returns NodeInfo from all running celery instances.
rpc NodeInfo(NodesInfoRequest) returns(NodesInfoReply);

// NodeInfo collects and returns NodeInfo from all running sentry instances.
rpc NodeInfo(NodesInfoRequest) returns (NodesInfoReply);

// Peers collects and returns peers information from all running sentry instances.
rpc Peers(google.protobuf.Empty) returns (PeersReply);
}

enum Event {
Expand Down Expand Up @@ -179,3 +184,7 @@ message NodesInfoRequest {
message NodesInfoReply {
repeated types.NodeInfoReply nodesInfo = 1;
}

message PeersReply {
repeated types.PeerInfo peers = 1;
}
13 changes: 13 additions & 0 deletions types/types.proto
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,16 @@ message NodeInfoReply {
string listenerAddr = 6;
bytes protocols = 7;
}

message PeerInfo {
string id = 1;
string name = 2;
string enode = 3;
string enr = 4;
repeated string caps = 5;
string connLocalAddr = 6;
string connRemoteAddr = 7;
bool connIsInbound = 8;
bool connIsTrusted = 9;
bool connIsStatic = 10;
}