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

Commit

Permalink
Squashed 'protocol/' changes from 6ced950..e92f847
Browse files Browse the repository at this point in the history
e92f847 Merge pull request grpc-ecosystem#46 from tronprotocol/rate_limit
e191aed add grpc return type:server busy
c98bb68 Merge pull request grpc-ecosystem#45 from tronprotocol/add_expiration
5abd2c0 fix spell error
76d2ac1 Merge pull request grpc-ecosystem#44 from tronprotocol/add-reason-enum
cf23e93 Merge pull request grpc-ecosystem#42 from tronprotocol/add_witness_committee
e9b0876 add the reason code
cc24179 Merge pull request grpc-ecosystem#43 from tronprotocol/add_expiration
5f9e263 add transaction expiration erro
3913331 fix merge conflict
bb1f7e0 add message Vote
4e0f34e Merge pull request grpc-ecosystem#40 from tronprotocol/proxy
7134384 minor change
ab77170 add witness and committee in account
8f7655a add error code for broadcast.
4bc508c fix build error.
a568eb8 add response code for return of broad_cast && fix error.
4dc6857 add response code for return of broad_cast.
df2ea4b Merge pull request grpc-ecosystem#41 from tronprotocol/add-reason-enum
54dac0c fix-reason
200ba66 proxy support GET method
0e65a14 Merge pull request grpc-ecosystem#39 from tronprotocol/evan-rm-createaccount
d57ad8f remove createaccount api
e13211c Merge pull request grpc-ecosystem#38 from tronprotocol/evan-rm-transaction-type
8aeba00 rm transaction type
c7495f8 Merge pull request grpc-ecosystem#36 from tronprotocol/add-reason-enum
59333a3 add reason
9aa4212 Merge pull request grpc-ecosystem#35 from tronprotocol/add_fullNode_API
e4025ff feat: delete GetTransactionByLimitPrev.
07d94e4 Merge pull request grpc-ecosystem#34 from tronprotocol/add_fullNode_API
884b666 fix: add http option.
5d93c0c feat: add fullnode GRPC.
08b0663 Merge commit 'c3b07944ee8eb47d7461fd304520364db41671ad' into develop
c3b0794 Merge pull request grpc-ecosystem#33 from tronprotocol/add_frozen_allowance
b7224ed add bandwidth in account
3464107 Merge branch 'develop' of https://github.com/tronprotocol/java-tron into develop
9313380 Merge pull request grpc-ecosystem#32 from tronprotocol/add_frozen_allowance
88da776 minor change
f12e2cc minor change
d18ae9c minor change
e18bdf2 add frozen and allowance balance
479564d mdf channel
f5e7632 Merge commit '647650de48d27934e0eb018db1c0ff4242ee39a5' into develop
647650d Merge pull request grpc-ecosystem#31 from tronprotocol/tx-timestamp
b290aad add hello message timestamp
6eba349 fix the transfer exception.
01a4166 Merge pull request grpc-ecosystem#30 from tronprotocol/update_account
80c5fd4 Merge branch 'master' into update_account
6cb5e8c Merge pull request grpc-ecosystem#528 from tronprotocol/refactor_transaction
7fc51a7 refactor the transaction structure
221cf70 Merge pull request grpc-ecosystem#525 from tronprotocol/refactor_transaction
7308a22 refactor the transaction structure
3868626 merge develop
a68e403 Merge commit 'd49019ec76c606ab1aa743a97710bac8b291cbf5' into add_grpc_api_for_solidity
d49019e Merge pull request grpc-ecosystem#28 from tronprotocol/fix_return
ff425d8 fix: return type.
1435bef Merge pull request grpc-ecosystem#27 from tronprotocol/add-reason-enum
2ec383f add ReasonCode
4d6bbda modify use LatestBlockHeaderNumber compare
d139597 modify use LatestBlockHeaderNumber compare
bc9ca33 merge protocol
8c6167e Merge pull request #25 from tronprotocol/xd-reason-code
130f5a2 modify reason code
6f41dfa Merge pull request #22 from tronprotocol/feature/add_db_api
9498448 feature: merge master to this.
13d4b62 Merge remote-tracking branch 'origin/master' into feature/add_db_api
246cf61 Merge pull request #24 from tronprotocol/add_database_api
2f7ae0b feature:add Datebase api Service.
a5e544c fix:change go_package.
c003d39 Merge remote-tracking branch 'origin/master' into feature/add_db_api
2dbee3b add WalletSolidity api service.
acc5c20 add get AssetIssueList by Timestamp api.
87c23fb add get Transaction api.
1033d54 Merge branch 'develop' into remove_header
c56402e add solidity node impl
f549760 add go package setting
7f1d31a add go package setting
0ef1de2 Merge branch 'develop' of https://github.com/tronprotocol/java-tron into develop
303dd5d feat: add BlockReference api
ed93332 Merge commit '1fab36b414599a3b24e739da4f04ee57bb4c14a5' into develop
d4a93ed improve: modified the seq num and fix build error
7acdfaf improve: add ref_block_num and ref_block_hash
c7f7d3e feat: remove utxo support from protocol.
59a3f02 Merge remote-tracking branch 'origin/develop' into develop
ac5eed9 add comments about ParticipateAssetIssueContract.
b1f5964 Merge commit 'ce4933fbe83c734ca244ecb0e8f8a9f854aa8afe' into protocol
336711d Merge commit '0297ff5d8a027576b0a7943cf0174ca7fc789534' into develop
f7d6d7b Merge commit 'ba4df0279d39dc07b6f6e40ccb0a66f3f5631e67' into feature/add_total_trans
0ed107a Merge commit '9f390c30504fe635e9d968393c2869f14cdfe9a4' into develop
4842483 Merge commit '06d60bdde8214ae47fecd8625e31dcd54c0bb324' into p2p
95b951b Merge branch 'develop' into p2p
192b1df Revert "Revert "Feature/devfor evan""
4e5ce06 Merge commit '9ac2d9b122b1e5ce429b4cc607741c56fbe27d4c' into p2p
fcc01fe Revert "Feature/devfor evan"
222e9e0 Merge remote-tracking branch 'origin/feature/devforEvan' into feature/devforEvan
0e407b9 merage proto
abb7a8b Merge commit '4668a8e92da61efdcb12d1bc7275d02373a7e052' into feature/devforEvan
e0dd5af Merge commit 'ca59ee900e2611553abebbf3a9f8feacab52228e' into feature/devforEvan
3f78d1b merge
94005a1 Merge commit 'ca59ee900e2611553abebbf3a9f8feacab52228e' into p2p
2836bdd change getBalance to getAccount
a97cfd7 Merge commit 'f1a1e24144dcefa5b604aa4a5ed69ef3bb934c66' into p2p
473587b merage proto
b74432d Merge remote-tracking branch 'origin/feature/devforEvan' into feature/devforEvan
312121f merage proto
faabdc4 Merge commit '044a39a4666b0428785d0501067bf417ade820c1' into p2p
82ceb8d Merge commit '13f1658d0497ecf4b6ce3ae9ed199b35cf654e21' into feature/devforEvan
f6ecbb5 Merge commit '0d9e0fdb313a8d4d5d3baaaea22569b72645fc08' into feature/devforEvan
8d0790f Merge commit 'bbeed13b2b052ae0fc669fb4a4ce1d5ac2cc9092' into p2p
8140964 Merge commit 'd08db0e07224a7aac3f296fc3a2e930e24d06fb5' into p2p
0aaff3d mdf discover msg
cf487bb Merge commit 'f63eda3db1b4386128cbc6235c3b95a72fbf0ba0' into p2p
dc9c1bb Merge commit '79c9b333f22367d3792f3faa2970b8dbbcf646b0' into feature/devforEvan
7abfb54 Merge commit '0f3ab59dfcba7e39789cdb810f3bd69a4fabb44b' into feature/devforEvan
5b0f8ac add getBlock
8901f2c add discover message
936b701 Merge commit '2f82ce89fcbebced73126885cf2feeda3463c73d' into develop
bbd0ea3 Merge commit '050740d1801ad990f2ad3c9eeee3030c74e022f3' into p2p
61decfb Merge commit '2795379f4fee8b12715e8835967f67925a5d68e7' into p2p
b5ced2d Merge branch 'develop' into junit/config
68b5a48 Merge pull request grpc-ecosystem#251 from sdargutev/develop
6b70dfd Merge pull request grpc-ecosystem#245 from tronprotocol/feature/updatewitness
935fd4c merged
c9410d8 refactoring
a3c7257 Merge remote-tracking branch 'origin/develop' into junit/config
9df3d33 Merge commit 'ec85aa1c2f62dbb6a027cd713e5965311dee29e6' into feature/updatewitness
fee98bf Merge remote-tracking branch 'origin/syncBlockChain' into syncBlockChain
7f4f302 rm duplicate instance
f509ce3 Merge branch 'develop' of https://github.com/tronprotocol/java-tron into syncBlockChain
774cceb Merge pull request grpc-ecosystem#237 from tronprotocol/miss_confuse_db
164d8bd remove dupicated number refresh
a58bf8e Merge branch 'develop' into junit/config
bb3a578 improve code readability
6910ef4 fix: add Account setter() validator

git-subtree-dir: protocol
git-subtree-split: e92f847
  • Loading branch information
ithinker1991 committed May 11, 2018
1 parent bc147ed commit 7297a14
Show file tree
Hide file tree
Showing 3 changed files with 329 additions and 39 deletions.
237 changes: 221 additions & 16 deletions api/api.proto
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@ service Wallet {
option (google.api.http) = {
post: "/wallet/getaccount"
body: "*"
additional_bindings {
get: "/wallet/getaccount"
}
};

};

rpc CreateTransaction (TransferContract) returns (Transaction) {
Expand All @@ -36,22 +38,17 @@ service Wallet {

rpc ListAccounts (EmptyMessage) returns (AccountList) {
option (google.api.http) = {
post: "/wallet/listaccount"
body: "*"
};

};

rpc UpdateAccount (AccountUpdateContract) returns (Transaction) {
option (google.api.http) = {
post: "/wallet/updateaccount"
post: "/wallet/listaccount"
body: "*"
additional_bindings {
get: "/wallet/listaccount"
}
};
};

rpc CreateAccount (AccountCreateContract) returns (Transaction) {
rpc UpdateAccount (AccountUpdateContract) returns (Transaction) {
option (google.api.http) = {
post: "/wallet/createaccount"
post: "/wallet/updateaccount"
body: "*"
};
};
Expand All @@ -74,6 +71,9 @@ service Wallet {
option (google.api.http) = {
post: "/wallet/listwitnesses"
body: "*"
additional_bindings {
get: "/wallet/listwitnesses"
}
};
};

Expand Down Expand Up @@ -105,16 +105,43 @@ service Wallet {
};
}

rpc FreezeBalance (FreezeBalanceContract) returns (Transaction) {
option (google.api.http) = {
post: "/wallet/freezebalance"
body: "*"
};
}

rpc UnfreezeBalance (UnfreezeBalanceContract) returns (Transaction) {
option (google.api.http) = {
post: "/wallet/unfreezebalance"
body: "*"
};
}

rpc WithdrawBalance (WithdrawBalanceContract) returns (Transaction) {
option (google.api.http) = {
post: "/wallet/withdrawbalance"
body: "*"
};
}

rpc ListNodes (EmptyMessage) returns (NodeList) {
option (google.api.http) = {
post: "/wallet/listnodes"
body: "*"
additional_bindings {
get: "/wallet/listnodes"
}
};
}
rpc GetAssetIssueList (EmptyMessage) returns (AssetIssueList) {
option (google.api.http) = {
post: "/wallet/getassetissuelist"
body: "*"
additional_bindings {
get: "/wallet/getassetissuelist"
}
};
}
rpc GetAssetIssueByAccount (Account) returns (AssetIssueList) {
Expand All @@ -133,35 +160,195 @@ service Wallet {
option (google.api.http) = {
post: "/wallet/getnowblock"
body: "*"
additional_bindings {
get: "/wallet/getnowblock"
}
};
}
rpc GetBlockByNum (NumberMessage) returns (Block) {
option (google.api.http) = {
post: "/wallet/getblockbynum"
body: "*"
additional_bindings {
get: "/wallet/getblockbynum"
}
};
}
rpc TotalTransaction (EmptyMessage) returns (NumberMessage) {
option (google.api.http) = {
post: "/wallet/totaltransaction"
body: "*"
additional_bindings {
get: "/wallet/totaltransaction"
}
};
}
rpc GetBlockById (BytesMessage) returns (Block) {
option (google.api.http) = {
post: "/wallet/getblockbyid"
body: "*"
};
}
rpc GetBlockByLimitNext (BlockLimit) returns (BlockList) {
option (google.api.http) = {
post: "/wallet/getblockbylimitnext"
body: "*"
};
}
rpc GetBlockByLatestNum (NumberMessage) returns (BlockList) {
option (google.api.http) = {
post: "/wallet/getblockbylatestnum"
body: "*"
};
}
rpc GetTransactionById (BytesMessage) returns (Transaction) {
option (google.api.http) = {
post: "/wallet/gettransactionbyid"
body: "*"
};
}
};


service WalletSolidity {

rpc GetAccount (Account) returns (Account) {
option (google.api.http) = {
post: "/walletsolidity/getaccount"
body: "*"
};
};

rpc ListAccounts (EmptyMessage) returns (AccountList) {
option (google.api.http) = {
post: "/walletsolidity/listaccounts"
body: "*"
};
};

rpc ListWitnesses (EmptyMessage) returns (WitnessList) {
option (google.api.http) = {
post: "/walletsolidity/listwitnesses"
body: "*"
};
};
rpc GetAssetIssueList (EmptyMessage) returns (AssetIssueList) {
option (google.api.http) = {
post: "/walletsolidity/getassetissuelist"
body: "*"
};
}
rpc GetAssetIssueListByTimestamp (NumberMessage) returns (AssetIssueList) {
option (google.api.http) = {
post: "/walletsolidity/getassetissuelistbytimestamp"
body: "*"
};
}
rpc GetAssetIssueByAccount (Account) returns (AssetIssueList) {
option (google.api.http) = {
post: "/walletsolidity/getassetissuebyaccount"
body: "*"
};
}
rpc GetAssetIssueByName (BytesMessage) returns (AssetIssueContract) {
option (google.api.http) = {
post: "/walletsolidity/getassetissuebyname"
body: "*"
};
}
rpc GetNowBlock (EmptyMessage) returns (Block) {
option (google.api.http) = {
post: "/walletsolidity/getnowblock"
body: "*"
};
}
rpc GetBlockByNum (NumberMessage) returns (Block) {
option (google.api.http) = {
post: "/walletsolidity/getblockbynum"
body: "*"
};
}
//get transaction
rpc TotalTransaction (EmptyMessage) returns (NumberMessage) {
option (google.api.http) = {
post: "/walletsolidity/totaltransaction"
body: "*"
};
}
rpc GetTransactionById (BytesMessage) returns (Transaction) {
option (google.api.http) = {
post: "/walletsolidity/gettransactionbyid"
body: "*"
};
}
rpc GetTransactionsByTimestamp (TimeMessage) returns (TransactionList) {
option (google.api.http) = {
post: "/walletsolidity/gettransactionsbytimestamp"
body: "*"
};
}
rpc GetTransactionsFromThis (Account) returns (TransactionList) {
option (google.api.http) = {
post: "/walletsolidity/gettransactionsfromthis"
body: "*"
};
}
rpc GetTransactionsToThis (Account) returns (TransactionList) {
option (google.api.http) = {
post: "/walletsolidity/gettransactionstothis"
body: "*"
};
}
};

// the api of tron's db
service Database {
// for tapos
rpc getBlockReference (EmptyMessage) returns (BlockReference) {

}
rpc GetDynamicProperties (EmptyMessage) returns (DynamicProperties) {

}
rpc GetNowBlock (EmptyMessage) returns (Block) {

}
rpc GetBlockByNum (NumberMessage) returns (Block) {

}
};

message Return {
enum response_code {
SUCCESS = 0;
SIGERROR = 1; // error in signature
CONTRACT_VALIDATE_ERROR = 2;
CONTRACT_EXE_ERROR = 3;
BANDWITH_ERROR = 4;
DUP_TRANSACTION_ERROR = 5;
TAPOS_ERROR = 6;
TOO_BIG_TRANSACTION_ERROR = 7;
TRANSACTION_EXPIRATION_ERROR = 8;
SERVER_BUSY = 9;
OTHER_ERROR = 20;
}

bool result = 1;
response_code code = 2;
bytes message = 3;
}

message BlockReference {
int64 block_num = 1;
bytes block_hash = 2;
}

// the api of tron's network such as node list.
service Network {

};


message Return {
bool result = 1;
}

message AccountList {
repeated Account accounts = 1;
Expand All @@ -174,6 +361,12 @@ message WitnessList {
message AssetIssueList {
repeated AssetIssueContract assetIssue = 1;
}
message BlockList {
repeated Block block = 1;
}
message TransactionList {
repeated Transaction transaction = 1;
}

// Gossip node list
message NodeList {
Expand All @@ -198,4 +391,16 @@ message NumberMessage {
}
message BytesMessage {
bytes value = 1;
}
}
message TimeMessage {
int64 beginInMilliseconds = 1;
int64 endInMilliseconds = 2;
}
message BlockLimit {
int64 startNum = 1;
int64 endNum = 2;
}
message TransactionLimit {
bytes transactionId = 1;
int64 limitNum = 2;
}
13 changes: 13 additions & 0 deletions core/Contract.proto
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,16 @@ message DeployContract {
bytes script = 2;
}

message FreezeBalanceContract {
bytes owner_address = 1;
int64 frozen_balance = 2;
int64 frozen_duration = 3;
}

message UnfreezeBalanceContract {
bytes owner_address = 1;
}

message WithdrawBalanceContract {
bytes owner_address = 1;
}

0 comments on commit 7297a14

Please sign in to comment.