Skip to content

Commit

Permalink
Merge pull request #6 from testinprod-io/pcw109550/addpeer
Browse files Browse the repository at this point in the history
Add addPeer RPC
  • Loading branch information
pcw109550 authored Jun 16, 2023
2 parents 3472117 + 8ded43c commit 9393a05
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions p2psentry/sentry.proto
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ message PeerMinBlockRequest {
uint64 min_block = 2;
}

message AddPeerRequest {
string url = 1;
}

message InboundMessage {
MessageId id = 1;
bytes data = 2;
Expand Down Expand Up @@ -163,6 +167,10 @@ message PeerEvent {
PeerEventId event_id = 2;
}

message AddPeerReply {
bool success = 1;
}

service Sentry {
// SetStatus - force new ETH client state of sentry - network_id, max_block, etc...
rpc SetStatus(StatusData) returns (SetStatusReply);
Expand Down Expand Up @@ -190,6 +198,8 @@ service Sentry {
// Subscribe to notifications about connected or lost peers.
rpc PeerEvents(PeerEventsRequest) returns (stream PeerEvent);

rpc AddPeer(AddPeerRequest) returns (AddPeerReply);

// NodeInfo returns a collection of metadata known about the host.
rpc NodeInfo(google.protobuf.Empty) returns(types.NodeInfoReply);
}
10 changes: 10 additions & 0 deletions remote/ethbackend.proto
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ service ETHBACKEND {
// Peers collects and returns peers information from all running sentry instances.
rpc Peers(google.protobuf.Empty) returns (PeersReply);

rpc AddPeer(AddPeerRequest) returns (AddPeerReply);

rpc PendingBlock(google.protobuf.Empty) returns (PendingBlockReply);
}

Expand Down Expand Up @@ -204,6 +206,10 @@ message NodesInfoRequest {
uint32 limit = 1;
}

message AddPeerRequest {
string url = 1;
}

message NodesInfoReply {
repeated types.NodeInfoReply nodes_info = 1;
}
Expand All @@ -212,6 +218,10 @@ message PeersReply {
repeated types.PeerInfo peers = 1;
}

message AddPeerReply {
bool success = 1;
}

message PendingBlockReply {
bytes block_rlp = 1;
}
Expand Down

0 comments on commit 9393a05

Please sign in to comment.