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

Commit

Permalink
add getBlock
Browse files Browse the repository at this point in the history
  • Loading branch information
zergweak committed Mar 20, 2018
2 parents 936b701 + b5a8dac commit 5b0f8ac
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 11 deletions.
25 changes: 24 additions & 1 deletion api/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ service Wallet {
rpc ListWitnesses (EmptyMessage) returns (WitnessList) {

};

rpc UpdateWitness (WitnessUpdateContract) returns (Transaction) {

};
Expand All @@ -48,8 +48,24 @@ service Wallet {

};

rpc TransferAssert (TransferAssertContract) returns (Transaction) {

}
rpc TransferTokenToAssert (TransferTokenToAssetContract) returns (Transaction) {

}

rpc ListNodes (EmptyMessage) returns (NodeList) {

}
rpc GetAssetIssueList (EmptyMessage) returns (AssetIssueList) {

}
rpc GetNowBlock (EmptyMessage) returns (Block) {

}
rpc GetBlockByNum (NumberMessage) returns (Block) {

}
};

Expand All @@ -65,6 +81,10 @@ message WitnessList {
repeated Witness witnesses = 1;
}

message AssetIssueList {
repeated AssetIssueContract witnesses = 1;
}

// Gossip node list
message NodeList {
repeated Node nodes = 1;
Expand All @@ -83,3 +103,6 @@ message Address {

message EmptyMessage {
}
message NumberMessage {
int64 num = 1;
}
7 changes: 7 additions & 0 deletions core/Contract.proto
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ message AssetIssueContract {
bytes url = 21;
}

message TransferTokenToAssetContract {
bytes owner_address = 1;
bytes to_address = 2;
bytes name = 3;
int32 trx_num = 4;
}

message DeployContract {
bytes owner_address = 1;
bytes script = 2;
Expand Down
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;
}
1 change: 1 addition & 0 deletions core/Tron.proto
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ message Transaction {
AssetIssueContract = 6;
DeployContract = 7;
WitnessUpdateContract = 8;
TransferTokenToAssetContract = 9;
}
ContractType type = 1;
google.protobuf.Any parameter = 2;
Expand Down

0 comments on commit 5b0f8ac

Please sign in to comment.