Skip to content
This repository has been archived by the owner on Apr 24, 2023. It is now read-only.

Commit

Permalink
add discover message
Browse files Browse the repository at this point in the history
  • Loading branch information
sasaxie committed Mar 19, 2018
1 parent 8f2cca6 commit b5a8dac
Showing 1 changed file with 34 additions and 10 deletions.
44 changes: 34 additions & 10 deletions core/Message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,6 @@ message Capability {
int32 version = 2;
}

enum P2pMessageCode {
HELLO = 0;
DISCONNECT = 1;
PING = 2;
PONG = 3;
GET_PEERS = 4;
PEERS = 5;
USER = 6;
}

enum ReasonCode {
REQUESTED = 0;
TCP_ERROR = 1;
Expand Down Expand Up @@ -59,4 +49,38 @@ message HelloMessage {

message PeersMessage {
repeated Peer peers = 1;
}

message Endpoint {
bytes address = 1;
int32 udpPort = 2;
int32 tcpPort = 3;
}

message PingMessage {
int32 version = 1;
Endpoint from = 2;
Endpoint to = 3;
int32 timestamp = 4;
}

message PongMessage {
Endpoint to = 1;
int32 echo = 2;
int32 timestamp = 3;
}

message FindNeighbours {
bytes target = 1;
int32 timestamp = 2;
}

message Neighbour {
Endpoint endpoint = 1;
bytes nodeId = 2;
}

message Neighbours {
repeated Neighbour neighbours = 1;
int32 timestamp = 2;
}

0 comments on commit b5a8dac

Please sign in to comment.