bdledger-apis/bdchain/api/tx_ledger.proto
2018-10-08 20:56:03 +08:00

46 lines
1.1 KiB
Protocol Buffer

syntax = "proto3";
package bdchain.api;
import "google/protobuf/empty.proto";
import "bdchain/api/common.proto";
option go_package = "bdchain/api/grpc/txledger";
option java_package = "bdchain.api.grpc";
option java_outer_classname = "TransactionLedgerProto";
option java_multiple_files = true;
service TransactionLedger {
rpc ClientVersion (google.protobuf.Empty) returns (ClientVersionResponse);
rpc CreateLedger (CreateLedgerRequest) returns (CreateLedgerResponse);
rpc GetLedgers (google.protobuf.Empty) returns (GetLedgersResponse);
rpc SendTransaction (SendTransactionRequest) returns (SendTransactionResponse);
}
message CreateLedgerRequest {
string name = 1;
}
message CreateLedgerResponse {
Error error = 1;
}
message GetLedgersResponse {
Error error = 1;
repeated string ledgers = 2;
}
message SendTransactionRequest {
string ledger = 1;
message Transaction {
TransactionType type = 1;
bytes from = 2;
bytes to = 3;
bytes data = 4;
}
Transaction transaction = 2;
}
message SendTransactionResponse {
Error error = 1;
bytes hash = 2;
}