change go_package path
Summary: change go_package path Test Plan: none Reviewers: nex, wuyi Reviewed By: nex Differential Revision: https://phabricator.internetapi.cn/D29
This commit is contained in:
@@ -1,15 +1,13 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package bdledger.api.common;
|
||||
package bdledger.api;
|
||||
|
||||
option go_package = "bdware.org/bdledger/sdk/api/grpc/common";
|
||||
option go_package = "bdware.org/bdledger/pkg/api/grpc/proto";
|
||||
option java_package = "bdledger.api.grpc.common";
|
||||
option java_outer_classname = "CommonProto";
|
||||
option java_multiple_files = true;
|
||||
|
||||
message ClientVersionResponse {
|
||||
string version = 1; // 节点客户端版本
|
||||
}
|
||||
|
||||
|
||||
/* 事务类型 */
|
||||
enum TransactionType {
|
||||
@@ -24,7 +22,7 @@ message Transaction {
|
||||
bytes block_hash = 1; // 事务所在的区块的哈希,当事务处于待确认状态时为`null`
|
||||
uint32 index = 2; // 事务在区块中的位置 index,当事务处于待确认状态时为`null`
|
||||
bytes hash = 3; // 事务的哈希
|
||||
common.TransactionType type = 4; // 事务类型
|
||||
TransactionType type = 4; // 事务类型
|
||||
bytes from = 5; // 发送账户地址
|
||||
uint64 nonce = 6; // 这条事务之前发送者所发送的事务数量
|
||||
bytes to = 7; // 接收账户地址,或者调用的合约地址,或者`null`如为合约创建
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package bdledger.api.common;
|
||||
package bdledger.api;
|
||||
|
||||
option go_package = "bdware.org/bdledger/sdk/api/grpc/errdetails";
|
||||
option go_package = "bdware.org/bdledger/pkg/api/grpc/proto";
|
||||
option java_package = "bdledger.api.grpc.common";
|
||||
option java_outer_classname = "ErrorDetailsProto";
|
||||
option java_multiple_files = true;
|
||||
|
||||
42
bdledger/api/ledger.proto
Normal file
42
bdledger/api/ledger.proto
Normal file
@@ -0,0 +1,42 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package bdledger.api;
|
||||
|
||||
import "google/protobuf/empty.proto";
|
||||
import "bdledger/api/common.proto";
|
||||
|
||||
option go_package = "bdware.org/bdledger/pkg/api/grpc/proto";
|
||||
option java_package = "bdledger.api.grpc.ledger";
|
||||
option java_outer_classname = "LedgerProto";
|
||||
option java_multiple_files = true;
|
||||
|
||||
service TransactionLedger {
|
||||
rpc CreateLedger (CreateLedgerRequest) returns (CreateLedgerResponse);
|
||||
rpc GetLedgers (google.protobuf.Empty) returns (GetLedgersResponse);
|
||||
rpc SendTransaction (SendTransactionRequest) returns (SendTransactionResponse);
|
||||
}
|
||||
|
||||
message CreateLedgerRequest {
|
||||
string name = 1;
|
||||
}
|
||||
message CreateLedgerResponse {
|
||||
bool ok = 1;
|
||||
}
|
||||
|
||||
message GetLedgersResponse {
|
||||
repeated string ledgers = 1;
|
||||
}
|
||||
|
||||
message SendTransactionRequest {
|
||||
string ledger = 1;
|
||||
message Transaction {
|
||||
TransactionType type = 1;
|
||||
bytes from = 2;
|
||||
bytes to = 3;
|
||||
bytes data = 4;
|
||||
}
|
||||
Transaction transaction = 2;
|
||||
}
|
||||
message SendTransactionResponse {
|
||||
bytes hash = 1;
|
||||
}
|
||||
18
bdledger/api/node.proto
Normal file
18
bdledger/api/node.proto
Normal file
@@ -0,0 +1,18 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package bdledger.api;
|
||||
|
||||
import "google/protobuf/empty.proto";
|
||||
|
||||
option go_package = "bdware.org/bdledger/pkg/api/grpc/proto";
|
||||
option java_package = "bdledger.api.grpc.node";
|
||||
option java_outer_classname = "NodeProto";
|
||||
option java_multiple_files = true;
|
||||
|
||||
service Node {
|
||||
rpc ClientVersion (google.protobuf.Empty) returns (ClientVersionResponse);
|
||||
}
|
||||
|
||||
message ClientVersionResponse {
|
||||
string version = 1; // 节点客户端版本
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package bdledger.api.queryservice;
|
||||
package bdledger.api;
|
||||
|
||||
import "bdledger/api/common.proto";
|
||||
|
||||
option go_package = "bdware.org/bdledger/sdk/api/grpc/queryservice";
|
||||
option java_package = "bdledger.api.grpc.queryservice";
|
||||
option java_outer_classname = "QueryServiceProto";
|
||||
option go_package = "bdware.org/bdledger/pkg/api/grpc/proto";
|
||||
option java_package = "bdledger.api.grpc.query";
|
||||
option java_outer_classname = "QueryProto";
|
||||
option java_multiple_files = true;
|
||||
|
||||
service Query {
|
||||
@@ -39,7 +39,7 @@ message BlocksRequest {
|
||||
int64 end_timestamp = 4;
|
||||
}
|
||||
message GetBlocksResponse {
|
||||
repeated common.Block blocks= 1;
|
||||
repeated Block blocks= 1;
|
||||
int64 start_timestamp = 2;
|
||||
int64 end_timestamp = 3;
|
||||
}
|
||||
@@ -54,7 +54,7 @@ message TransactionsRequest {
|
||||
int64 end_timestamp = 4;
|
||||
}
|
||||
message GetTransactionsResponse {
|
||||
repeated common.Transaction Transactions = 1;
|
||||
repeated Transaction transactions = 1;
|
||||
int64 start_timestamp = 2;
|
||||
int64 end_timestamp = 3;
|
||||
}
|
||||
@@ -68,7 +68,7 @@ message GetBlockByHashRequest {
|
||||
bool full_transaction = 3;
|
||||
}
|
||||
message GetBlockByHashResponse {
|
||||
common.Block block = 1;
|
||||
Block block = 1;
|
||||
}
|
||||
|
||||
message GetTransactionByHashRequest {
|
||||
@@ -76,7 +76,7 @@ message GetTransactionByHashRequest {
|
||||
bytes hash = 2;
|
||||
}
|
||||
message GetTransactionByHashResponse {
|
||||
common.Transaction transaction = 1;
|
||||
Transaction transaction = 1;
|
||||
}
|
||||
|
||||
message GetTransactionByBlockHashAndIndexRequest {
|
||||
@@ -85,5 +85,5 @@ message GetTransactionByBlockHashAndIndexRequest {
|
||||
uint32 index = 3;
|
||||
}
|
||||
message GetTransactionByBlockHashAndIndexResponse {
|
||||
common.Transaction transaction = 1;
|
||||
Transaction transaction = 1;
|
||||
}
|
||||
@@ -1,62 +0,0 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package bdledger.api.txledger;
|
||||
|
||||
import "google/protobuf/empty.proto";
|
||||
import "bdledger/api/common.proto";
|
||||
|
||||
option go_package = "bdware.org/bdledger/sdk/api/grpc/txledger";
|
||||
option java_package = "bdledger.api.grpc.txledger";
|
||||
option java_outer_classname = "TransactionLedgerProto";
|
||||
option java_multiple_files = true;
|
||||
|
||||
service TransactionLedger {
|
||||
rpc ClientVersion (google.protobuf.Empty) returns (common.ClientVersionResponse);
|
||||
rpc CreateLedger (CreateLedgerRequest) returns (CreateLedgerResponse);
|
||||
rpc GetLedgers (google.protobuf.Empty) returns (GetLedgersResponse);
|
||||
rpc BlockCount (BlockCountRequest) returns (BlockCountResponse);
|
||||
rpc GetBlocks (GetBlocksRequest) returns (GetBlocksResponse);
|
||||
rpc SendTransaction (SendTransactionRequest) returns (SendTransactionResponse);
|
||||
}
|
||||
|
||||
message CreateLedgerRequest {
|
||||
string name = 1;
|
||||
}
|
||||
message CreateLedgerResponse {
|
||||
bool ok = 1;
|
||||
}
|
||||
|
||||
message GetLedgersResponse {
|
||||
repeated string ledgers = 1;
|
||||
}
|
||||
|
||||
message BlockCountRequest {
|
||||
string ledger = 1;
|
||||
}
|
||||
message BlockCountResponse {
|
||||
uint64 block_count = 1;
|
||||
}
|
||||
|
||||
message GetBlocksRequest {
|
||||
string ledger = 1;
|
||||
uint64 from_index = 2;
|
||||
uint32 count = 3; // Optional, default to 10, max value is 10
|
||||
bool full_transaction = 4;
|
||||
}
|
||||
message GetBlocksResponse {
|
||||
repeated common.Block blocks = 1;
|
||||
}
|
||||
|
||||
message SendTransactionRequest {
|
||||
string ledger = 1;
|
||||
message Transaction {
|
||||
common.TransactionType type = 1;
|
||||
bytes from = 2;
|
||||
bytes to = 3;
|
||||
bytes data = 4;
|
||||
}
|
||||
Transaction transaction = 2;
|
||||
}
|
||||
message SendTransactionResponse {
|
||||
bytes hash = 1;
|
||||
}
|
||||
Reference in New Issue
Block a user