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

Commit

Permalink
Merge commit '2f82ce89fcbebced73126885cf2feeda3463c73d' into develop
Browse files Browse the repository at this point in the history
zhaohong committed Mar 19, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents 68b5a48 + 2f82ce8 commit 936b701
Showing 2 changed files with 63 additions and 0 deletions.
62 changes: 62 additions & 0 deletions core/Message.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
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 P2pMessageCode {
HELLO = 0;
DISCONNECT = 1;
PING = 2;
PONG = 3;
GET_PEERS = 4;
PEERS = 5;
USER = 6;
}

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;
}
1 change: 1 addition & 0 deletions core/Tron.proto
Original file line number Diff line number Diff line change
@@ -102,6 +102,7 @@ message Transaction {
bytes data = 10;
repeated Contract contract = 11;
bytes scripts = 16;
int64 timestamp = 17;
}

raw raw_data = 1;

0 comments on commit 936b701

Please sign in to comment.