bdledger-apis/bdledger/api/tx_ledger.proto
huyingcong de035bd3bc add hash query
Summary:
add TransactionCount/GetTransactions
增加关于 transaction/block 相关的查询接口

Test Plan: none

Reviewers: nex, wuyi

Reviewed By: nex

Differential Revision: https://phabricator.internetapi.cn/D25
2019-11-25 21:28:03 +08:00

63 lines
1.5 KiB
Protocol Buffer

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;
}