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

Commit

Permalink
Merge commit '2795379f4fee8b12715e8835967f67925a5d68e7' into p2p
Browse files Browse the repository at this point in the history
  • Loading branch information
sasaxie committed Mar 17, 2018
2 parents b5ced2d + 2795379 commit 61decfb
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions core/Message.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
syntax = "proto3";

package protocol;


option java_package = "org.tron.protos"; //Specify the name of the package that generated the Java file
option java_outer_classname = "Message"; //Specify the class name of the generated Java file

message Capability {
string name = 1;
int32 version = 2;
}

enum ReasonCode {
REQUESTED = 0;
TCP_ERROR = 1;
BAD_PROTOCOL = 2;
USELESS_PEER = 3;
TOO_MANY_PEERS = 4;
DUPLICATE_PEER = 5;
INCOMPATIBLE_PROTOCOL = 6;
NULL_IDENTITY = 7;
PEER_QUITING = 8;
UNEXPECTED_IDENTITY = 9;
LOCAL_IDENTITY = 10;
PING_TIMEOUT = 11;
USER_REASON = 12;
UNKNOWN = 13;
}

message Peer {
bytes address = 1;
int32 port = 2;
string peerId = 3;
repeated Capability capabilities = 4;
}

message DisconnectMessage {
ReasonCode reason = 1;
}

message HelloMessage {
int32 p2pVersion = 1;
string clientId = 2;
repeated Capability capabilities = 3;
int32 listenPort = 4;
string peerId = 5;
}

message PeersMessage {
repeated Peer peers = 1;
}

0 comments on commit 61decfb

Please sign in to comment.