bdledger-apis/bdledger/api/tx_ledger.proto

63 lines
1.5 KiB
Protocol Buffer
Raw Normal View History

2018-09-06 10:36:06 +00:00
syntax = "proto3";
2018-09-07 02:28:07 +00:00
2019-09-26 10:06:06 +00:00
package bdledger.api.txledger;
2018-09-06 10:36:06 +00:00
2018-09-07 05:22:14 +00:00
import "google/protobuf/empty.proto";
2019-09-26 10:06:06 +00:00
import "bdledger/api/common.proto";
2018-09-07 04:53:15 +00:00
2019-09-26 10:06:06 +00:00
option go_package = "bdware.org/bdledger/sdk/api/grpc/txledger";
option java_package = "bdledger.api.grpc.txledger";
2018-09-11 13:56:25 +00:00
option java_outer_classname = "TransactionLedgerProto";
2018-09-07 04:53:15 +00:00
option java_multiple_files = true;
2018-09-06 10:36:06 +00:00
2018-09-09 11:13:05 +00:00
service TransactionLedger {
2019-04-23 07:22:19 +00:00
rpc ClientVersion (google.protobuf.Empty) returns (common.ClientVersionResponse);
2018-10-08 13:38:12 +00:00
rpc CreateLedger (CreateLedgerRequest) returns (CreateLedgerResponse);
rpc GetLedgers (google.protobuf.Empty) returns (GetLedgersResponse);
rpc BlockCount (BlockCountRequest) returns (BlockCountResponse);
rpc GetBlocks (GetBlocksRequest) returns (GetBlocksResponse);
2018-10-08 13:38:12 +00:00
rpc SendTransaction (SendTransactionRequest) returns (SendTransactionResponse);
2018-09-06 10:36:06 +00:00
}
message CreateLedgerRequest {
2018-10-08 13:38:12 +00:00
string name = 1;
2018-09-06 10:36:06 +00:00
}
message CreateLedgerResponse {
bool ok = 1;
2018-09-06 10:36:06 +00:00
}
message GetLedgersResponse {
repeated string ledgers = 1;
2018-09-06 10:36:06 +00:00
}
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;
}
2018-09-09 11:13:05 +00:00
message SendTransactionRequest {
2018-10-08 13:38:12 +00:00
string ledger = 1;
message Transaction {
2019-04-23 07:22:19 +00:00
common.TransactionType type = 1;
2018-10-08 13:38:12 +00:00
bytes from = 2;
bytes to = 3;
bytes data = 4;
}
Transaction transaction = 2;
2018-09-06 10:36:06 +00:00
}
2018-09-09 11:13:05 +00:00
message SendTransactionResponse {
bytes hash = 1;
2018-09-06 10:36:06 +00:00
}