From 6ce31075db476d0da537b416fef72a4c75403761 Mon Sep 17 00:00:00 2001 From: Nex Date: Tue, 7 Apr 2020 21:56:57 +0800 Subject: [PATCH] Add API documentation --- docs/apis.html | 1932 ++++++++++++++++++++++ docs/apis.json | 1621 ++++++++++++++++++ docs/apis.md | 745 +++++++++ grpc/pb/bdware/bdledger/api/ledger.proto | 12 + grpc/pb/bdware/bdledger/api/node.proto | 4 + grpc/pb/bdware/bdledger/api/query.proto | 32 +- 6 files changed, 4345 insertions(+), 1 deletion(-) create mode 100644 docs/apis.html create mode 100644 docs/apis.json create mode 100644 docs/apis.md diff --git a/docs/apis.html b/docs/apis.html new file mode 100644 index 0000000..f5ddc6b --- /dev/null +++ b/docs/apis.html @@ -0,0 +1,1932 @@ + + + + + Protocol Documentation + + + + + + + + + + +

Protocol Documentation

+ +

Table of Contents

+ +
+ +
+ + + +
+

bdware/bdledger/api/common.proto

Top +
+

+ + +

Block

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeLabelDescription
hashbytes

区块的哈希,当区块处于待确认状态时为`null`

parent_hashesbytesrepeated

父区块的哈希

witnessesbytesrepeated

见证者账户地址

timestampint64

区块产生时的 UNIX 时间戳,单位为秒

sizeuint64

区块大小的字节数

transaction_countuint32

区块包含的事务数量

transactions_rootbytes

区块的事务默克尔树根

transactionsTransactionrepeated

事务对象的数组,或为空

transaction_hashesbytesrepeated

20字节的交易哈希的数组,或为空

+ + + + + +

Contract

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeLabelDescription
contractNamebytes

合约名称

randomNumuint32

合约执行的节点数量

operationbytes

合约方法

argbytes

合约方法参数

pathbytes

合约文件路径(合约在IDE工程的相对路径)

contentbytes

合约内容(可为合约文件相对路径/合约脚本)

pubkeybytes

用户公钥

+ + + + + +

Transaction

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeLabelDescription
block_hashbytes

事务所在的区块的哈希,当事务处于待确认状态时为`null`

indexuint32

事务在区块中的位置 index,当事务处于待确认状态时为`null`

hashbytes

事务的哈希

typeTransactionType

事务类型

frombytes

发送账户地址

nonceuint64

这条事务之前发送者所发送的事务数量

tobytes

接收账户地址,或者调用的合约地址,或者`null`如为合约创建

databytes

数据或合约代码

vbytes

ECDSA recovery id

rbytes

ECDSA signature r

sbytes

ECDSA signature s

+ + + + + + + +

Contract.ContractUnitRequestType

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameNumberDescription
START0

STOP1

EXECUTE2

REPLY3

REQUEST4

PREPREPARE5

PREPARE6

COMMIT7

ADDPEER8

DROPPEER9

STATESYNC10

+ +

TransactionType

+

事务类型

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameNumberDescription
RECORD0

通用数据记录

MESSAGE1

消息

CONTRACT_CREATION2

合约创建

CONTRACT_INVOCATION3

合约调用

CONTRACT_STATUS4

合约状态

+ + + + + + + +
+

bdware/bdledger/api/error_details.proto

Top +
+

+ + +

InvalidArgument

+

InvalidArgument indicates client specified an invalid argument.

Note that this differs from FailedPrecondition. It indicates arguments

that are problematic regardless of the state of the system

(e.g., a malformed file name).

+ + + + + + + + + + + + + + + + +
FieldTypeLabelDescription
field_violationsInvalidArgument.FieldViolationrepeated

Describes all violations in a client request.

+ + + + + +

InvalidArgument.FieldViolation

+

A message type used to describe a single invalid field.

+ + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeLabelDescription
fieldstring

A path leading to a field in the request body. The value will be a +sequence of dot-separated identifiers that identify a protocol buffer +field. E.g., "field_violations.field" would identify this field.

descriptionstring

A description of why the request element is bad.

+ + + + + + + + + + + + + +
+

bdware/bdledger/api/ledger.proto

Top +
+

+ + +

CreateLedgerRequest

+

+ + + + + + + + + + + + + + + + +
FieldTypeLabelDescription
namestring

+ + + + + +

CreateLedgerResponse

+

+ + + + + + + + + + + + + + + + +
FieldTypeLabelDescription
okbool

+ + + + + +

GetLedgersResponse

+

+ + + + + + + + + + + + + + + + +
FieldTypeLabelDescription
ledgersstringrepeated

+ + + + + +

SendTransactionRequest

+

+ + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeLabelDescription
ledgerstring

transactionSendTransactionRequest.Transaction

+ + + + + +

SendTransactionRequest.Transaction

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeLabelDescription
typeTransactionType

frombytes

tobytes

databytes

+ + + + + +

SendTransactionResponse

+

+ + + + + + + + + + + + + + + + +
FieldTypeLabelDescription
hashbytes

+ + + + + + + + + + + +

Ledger

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Method NameRequest TypeResponse TypeDescription
CreateLedgerCreateLedgerRequestCreateLedgerResponse

Create a new ledger +创建一个新账本

GetLedgers.google.protobuf.EmptyGetLedgersResponse

Get all ledgers +查询所有帐本列表

SendTransactionSendTransactionRequestSendTransactionResponse

Send a new transaction +发送一个新事务

+ + + + +
+

bdware/bdledger/api/node.proto

Top +
+

+ + +

ClientVersionResponse

+

+ + + + + + + + + + + + + + + + +
FieldTypeLabelDescription
versionstring

节点客户端版本

+ + + + + + + + + + + +

Node

+

+ + + + + + + + + + + + + + +
Method NameRequest TypeResponse TypeDescription
ClientVersion.google.protobuf.EmptyClientVersionResponse

Get BDLedger node version +查询BDLedger节点版本

+ + + + +
+

bdware/bdledger/api/query.proto

Top +
+

+ + +

BlockFilter

+

+ + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeLabelDescription
hashbytes

timestampint64

+ + + + + +

BlocksRequest

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeLabelDescription
ledgerstring

start_timestampint64

end_timestampint64

filtersBlockFilterrepeated

include_transactionsBlocksRequest.IncludeTransactions

+ + + + + +

CountBlocksResponse

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeLabelDescription
countuint64

start_timestampint64

end_timestampint64

+ + + + + +

CountTransactionsResponse

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeLabelDescription
countuint64

start_timestampint64

end_timestampint64

+ + + + + +

GetBlockByHashRequest

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeLabelDescription
ledgerstring

hashbytes

full_transactionsbool

+ + + + + +

GetBlockByHashResponse

+

+ + + + + + + + + + + + + + + + +
FieldTypeLabelDescription
blockBlock

+ + + + + +

GetBlocksResponse

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeLabelDescription
blocksBlockrepeated

start_timestampint64

end_timestampint64

+ + + + + +

GetTransactionByBlockHashAndIndexRequest

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeLabelDescription
ledgerstring

block_hashbytes

indexuint32

+ + + + + +

GetTransactionByBlockHashAndIndexResponse

+

+ + + + + + + + + + + + + + + + +
FieldTypeLabelDescription
transactionTransaction

+ + + + + +

GetTransactionByHashRequest

+

+ + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeLabelDescription
ledgerstring

hashbytes

+ + + + + +

GetTransactionByHashResponse

+

+ + + + + + + + + + + + + + + + +
FieldTypeLabelDescription
transactionTransaction

+ + + + + +

GetTransactionsResponse

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeLabelDescription
transactionsTransactionrepeated

start_timestampint64

end_timestampint64

+ + + + + +

TransactionFilter

+

repeated Transaction/BlockFilters are combined by "&&"(and) operator;

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeLabelDescription
hashbytes

frombytes

tobytes

timestampbytes

+ + + + + +

TransactionsRequest

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FieldTypeLabelDescription
ledgerstring

start_timestampint64

required

end_timestampint64

filtersTransactionFilterrepeated

+ + + + + + + +

BlocksRequest.IncludeTransactions

+

+ + + + + + + + + + + + + + + + + + + + + + + + + +
NameNumberDescription
NONE0

不包含交易数据

HASH1

包含交易哈希列表

FULL2

包含完整交易列表

+ + + + + +

Query

+

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Method NameRequest TypeResponse TypeDescription
GetBlockByHashGetBlockByHashRequestGetBlockByHashResponse

Get a block identified by its hash +查询哈希所指定的区块

GetBlocksBlocksRequestGetBlocksResponse

Get blocks in a timestamp range +查询时间范围内的区块 +start_timestamp is required

CountBlocksBlocksRequestCountBlocksResponse

Count all blocks in a ledger, or blocks in a timestamp range +查询帐本中的所有区块数量,或时间范围内的区块数量

GetTransactionByHashGetTransactionByHashRequestGetTransactionByHashResponse

Get a transaction identified by its hash +查询哈希所指定的事务

GetTransactionByBlockHashAndIndexGetTransactionByBlockHashAndIndexRequestGetTransactionByBlockHashAndIndexResponse

Get a transaction identified by hash of the block it belongs to and its index inside the block +查询所在区块的哈希与其在区块中的index所指定的事务

GetTransactionsTransactionsRequestGetTransactionsResponse

Get transactions in a timestamp range +查询时间范围内的事务

CountTransactionsTransactionsRequestCountTransactionsResponse

Count all transactions in a ledger, or transactions in a timestamp range +查询帐本中的所有事务数量,或时间范围内的事务数量 +start_timestamp is required

+ + + + +
+

google/protobuf/empty.proto

Top +
+

+ + +

Empty

+

A generic empty message that you can re-use to avoid defining duplicated

empty messages in your APIs. A typical example is to use it as the request

or the response type of an API method. For instance:

service Foo {

rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);

}

The JSON representation for `Empty` is empty JSON object `{}`.

+ + + + + + + + + + + + + +

Scalar Value Types

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
.proto TypeNotesC++JavaPythonGoC#PHPRuby
doubledoubledoublefloatfloat64doublefloatFloat
floatfloatfloatfloatfloat32floatfloatFloat
int32Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead.int32intintint32intintegerBignum or Fixnum (as required)
int64Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead.int64longint/longint64longinteger/stringBignum
uint32Uses variable-length encoding.uint32intint/longuint32uintintegerBignum or Fixnum (as required)
uint64Uses variable-length encoding.uint64longint/longuint64ulonginteger/stringBignum or Fixnum (as required)
sint32Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s.int32intintint32intintegerBignum or Fixnum (as required)
sint64Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s.int64longint/longint64longinteger/stringBignum
fixed32Always four bytes. More efficient than uint32 if values are often greater than 2^28.uint32intintuint32uintintegerBignum or Fixnum (as required)
fixed64Always eight bytes. More efficient than uint64 if values are often greater than 2^56.uint64longint/longuint64ulonginteger/stringBignum
sfixed32Always four bytes.int32intintint32intintegerBignum or Fixnum (as required)
sfixed64Always eight bytes.int64longint/longint64longinteger/stringBignum
boolboolbooleanbooleanboolboolbooleanTrueClass/FalseClass
stringA string must always contain UTF-8 encoded or 7-bit ASCII text.stringStringstr/unicodestringstringstringString (UTF-8)
bytesMay contain any arbitrary sequence of bytes.stringByteStringstr[]byteByteStringstringString (ASCII-8BIT)
+ + + diff --git a/docs/apis.json b/docs/apis.json new file mode 100644 index 0000000..7bb1113 --- /dev/null +++ b/docs/apis.json @@ -0,0 +1,1621 @@ +{ + "files": [ + { + "name": "bdware/bdledger/api/common.proto", + "description": "", + "package": "bdware.bdledger.api", + "hasEnums": true, + "hasExtensions": false, + "hasMessages": true, + "hasServices": false, + "enums": [ + { + "name": "ContractUnitRequestType", + "longName": "Contract.ContractUnitRequestType", + "fullName": "bdware.bdledger.api.Contract.ContractUnitRequestType", + "description": "", + "values": [ + { + "name": "START", + "number": "0", + "description": "" + }, + { + "name": "STOP", + "number": "1", + "description": "" + }, + { + "name": "EXECUTE", + "number": "2", + "description": "" + }, + { + "name": "REPLY", + "number": "3", + "description": "" + }, + { + "name": "REQUEST", + "number": "4", + "description": "" + }, + { + "name": "PREPREPARE", + "number": "5", + "description": "" + }, + { + "name": "PREPARE", + "number": "6", + "description": "" + }, + { + "name": "COMMIT", + "number": "7", + "description": "" + }, + { + "name": "ADDPEER", + "number": "8", + "description": "" + }, + { + "name": "DROPPEER", + "number": "9", + "description": "" + }, + { + "name": "STATESYNC", + "number": "10", + "description": "" + } + ] + }, + { + "name": "TransactionType", + "longName": "TransactionType", + "fullName": "bdware.bdledger.api.TransactionType", + "description": "事务类型", + "values": [ + { + "name": "RECORD", + "number": "0", + "description": "通用数据记录" + }, + { + "name": "MESSAGE", + "number": "1", + "description": "消息" + }, + { + "name": "CONTRACT_CREATION", + "number": "2", + "description": "合约创建" + }, + { + "name": "CONTRACT_INVOCATION", + "number": "3", + "description": "合约调用" + }, + { + "name": "CONTRACT_STATUS", + "number": "4", + "description": "合约状态" + } + ] + } + ], + "extensions": [], + "messages": [ + { + "name": "Block", + "longName": "Block", + "fullName": "bdware.bdledger.api.Block", + "description": "", + "hasExtensions": false, + "hasFields": true, + "extensions": [], + "fields": [ + { + "name": "hash", + "description": "区块的哈希,当区块处于待确认状态时为`null`", + "label": "", + "type": "bytes", + "longType": "bytes", + "fullType": "bytes", + "ismap": false, + "defaultValue": "" + }, + { + "name": "parent_hashes", + "description": "父区块的哈希", + "label": "repeated", + "type": "bytes", + "longType": "bytes", + "fullType": "bytes", + "ismap": false, + "defaultValue": "" + }, + { + "name": "witnesses", + "description": "见证者账户地址", + "label": "repeated", + "type": "bytes", + "longType": "bytes", + "fullType": "bytes", + "ismap": false, + "defaultValue": "" + }, + { + "name": "timestamp", + "description": "区块产生时的 UNIX 时间戳,单位为秒", + "label": "", + "type": "int64", + "longType": "int64", + "fullType": "int64", + "ismap": false, + "defaultValue": "" + }, + { + "name": "size", + "description": "区块大小的字节数", + "label": "", + "type": "uint64", + "longType": "uint64", + "fullType": "uint64", + "ismap": false, + "defaultValue": "" + }, + { + "name": "transaction_count", + "description": "区块包含的事务数量", + "label": "", + "type": "uint32", + "longType": "uint32", + "fullType": "uint32", + "ismap": false, + "defaultValue": "" + }, + { + "name": "transactions_root", + "description": "区块的事务默克尔树根", + "label": "", + "type": "bytes", + "longType": "bytes", + "fullType": "bytes", + "ismap": false, + "defaultValue": "" + }, + { + "name": "transactions", + "description": "事务对象的数组,或为空", + "label": "repeated", + "type": "Transaction", + "longType": "Transaction", + "fullType": "bdware.bdledger.api.Transaction", + "ismap": false, + "defaultValue": "" + }, + { + "name": "transaction_hashes", + "description": "20字节的交易哈希的数组,或为空", + "label": "repeated", + "type": "bytes", + "longType": "bytes", + "fullType": "bytes", + "ismap": false, + "defaultValue": "" + } + ] + }, + { + "name": "Contract", + "longName": "Contract", + "fullName": "bdware.bdledger.api.Contract", + "description": "", + "hasExtensions": false, + "hasFields": true, + "extensions": [], + "fields": [ + { + "name": "contractName", + "description": "合约名称", + "label": "", + "type": "bytes", + "longType": "bytes", + "fullType": "bytes", + "ismap": false, + "defaultValue": "" + }, + { + "name": "randomNum", + "description": "合约执行的节点数量", + "label": "", + "type": "uint32", + "longType": "uint32", + "fullType": "uint32", + "ismap": false, + "defaultValue": "" + }, + { + "name": "operation", + "description": "合约方法", + "label": "", + "type": "bytes", + "longType": "bytes", + "fullType": "bytes", + "ismap": false, + "defaultValue": "" + }, + { + "name": "arg", + "description": "合约方法参数", + "label": "", + "type": "bytes", + "longType": "bytes", + "fullType": "bytes", + "ismap": false, + "defaultValue": "" + }, + { + "name": "path", + "description": "合约文件路径(合约在IDE工程的相对路径)", + "label": "", + "type": "bytes", + "longType": "bytes", + "fullType": "bytes", + "ismap": false, + "defaultValue": "" + }, + { + "name": "content", + "description": "合约内容(可为合约文件相对路径/合约脚本)", + "label": "", + "type": "bytes", + "longType": "bytes", + "fullType": "bytes", + "ismap": false, + "defaultValue": "" + }, + { + "name": "pubkey", + "description": "用户公钥", + "label": "", + "type": "bytes", + "longType": "bytes", + "fullType": "bytes", + "ismap": false, + "defaultValue": "" + } + ] + }, + { + "name": "Transaction", + "longName": "Transaction", + "fullName": "bdware.bdledger.api.Transaction", + "description": "", + "hasExtensions": false, + "hasFields": true, + "extensions": [], + "fields": [ + { + "name": "block_hash", + "description": "事务所在的区块的哈希,当事务处于待确认状态时为`null`", + "label": "", + "type": "bytes", + "longType": "bytes", + "fullType": "bytes", + "ismap": false, + "defaultValue": "" + }, + { + "name": "index", + "description": "事务在区块中的位置 index,当事务处于待确认状态时为`null`", + "label": "", + "type": "uint32", + "longType": "uint32", + "fullType": "uint32", + "ismap": false, + "defaultValue": "" + }, + { + "name": "hash", + "description": "事务的哈希", + "label": "", + "type": "bytes", + "longType": "bytes", + "fullType": "bytes", + "ismap": false, + "defaultValue": "" + }, + { + "name": "type", + "description": "事务类型", + "label": "", + "type": "TransactionType", + "longType": "TransactionType", + "fullType": "bdware.bdledger.api.TransactionType", + "ismap": false, + "defaultValue": "" + }, + { + "name": "from", + "description": "发送账户地址", + "label": "", + "type": "bytes", + "longType": "bytes", + "fullType": "bytes", + "ismap": false, + "defaultValue": "" + }, + { + "name": "nonce", + "description": "这条事务之前发送者所发送的事务数量", + "label": "", + "type": "uint64", + "longType": "uint64", + "fullType": "uint64", + "ismap": false, + "defaultValue": "" + }, + { + "name": "to", + "description": "接收账户地址,或者调用的合约地址,或者`null`如为合约创建", + "label": "", + "type": "bytes", + "longType": "bytes", + "fullType": "bytes", + "ismap": false, + "defaultValue": "" + }, + { + "name": "data", + "description": "数据或合约代码", + "label": "", + "type": "bytes", + "longType": "bytes", + "fullType": "bytes", + "ismap": false, + "defaultValue": "" + }, + { + "name": "v", + "description": "ECDSA recovery id", + "label": "", + "type": "bytes", + "longType": "bytes", + "fullType": "bytes", + "ismap": false, + "defaultValue": "" + }, + { + "name": "r", + "description": "ECDSA signature r", + "label": "", + "type": "bytes", + "longType": "bytes", + "fullType": "bytes", + "ismap": false, + "defaultValue": "" + }, + { + "name": "s", + "description": "ECDSA signature s", + "label": "", + "type": "bytes", + "longType": "bytes", + "fullType": "bytes", + "ismap": false, + "defaultValue": "" + } + ] + } + ], + "services": [] + }, + { + "name": "bdware/bdledger/api/error_details.proto", + "description": "", + "package": "bdware.bdledger.api", + "hasEnums": false, + "hasExtensions": false, + "hasMessages": true, + "hasServices": false, + "enums": [], + "extensions": [], + "messages": [ + { + "name": "InvalidArgument", + "longName": "InvalidArgument", + "fullName": "bdware.bdledger.api.InvalidArgument", + "description": "InvalidArgument indicates client specified an invalid argument.\nNote that this differs from FailedPrecondition. It indicates arguments\nthat are problematic regardless of the state of the system\n(e.g., a malformed file name).", + "hasExtensions": false, + "hasFields": true, + "extensions": [], + "fields": [ + { + "name": "field_violations", + "description": "Describes all violations in a client request.", + "label": "repeated", + "type": "FieldViolation", + "longType": "InvalidArgument.FieldViolation", + "fullType": "bdware.bdledger.api.InvalidArgument.FieldViolation", + "ismap": false, + "defaultValue": "" + } + ] + }, + { + "name": "FieldViolation", + "longName": "InvalidArgument.FieldViolation", + "fullName": "bdware.bdledger.api.InvalidArgument.FieldViolation", + "description": "A message type used to describe a single invalid field.", + "hasExtensions": false, + "hasFields": true, + "extensions": [], + "fields": [ + { + "name": "field", + "description": "A path leading to a field in the request body. The value will be a\nsequence of dot-separated identifiers that identify a protocol buffer\nfield. E.g., \"field_violations.field\" would identify this field.", + "label": "", + "type": "string", + "longType": "string", + "fullType": "string", + "ismap": false, + "defaultValue": "" + }, + { + "name": "description", + "description": "A description of why the request element is bad.", + "label": "", + "type": "string", + "longType": "string", + "fullType": "string", + "ismap": false, + "defaultValue": "" + } + ] + } + ], + "services": [] + }, + { + "name": "bdware/bdledger/api/ledger.proto", + "description": "", + "package": "bdware.bdledger.api", + "hasEnums": false, + "hasExtensions": false, + "hasMessages": true, + "hasServices": true, + "enums": [], + "extensions": [], + "messages": [ + { + "name": "CreateLedgerRequest", + "longName": "CreateLedgerRequest", + "fullName": "bdware.bdledger.api.CreateLedgerRequest", + "description": "", + "hasExtensions": false, + "hasFields": true, + "extensions": [], + "fields": [ + { + "name": "name", + "description": "", + "label": "", + "type": "string", + "longType": "string", + "fullType": "string", + "ismap": false, + "defaultValue": "" + } + ] + }, + { + "name": "CreateLedgerResponse", + "longName": "CreateLedgerResponse", + "fullName": "bdware.bdledger.api.CreateLedgerResponse", + "description": "", + "hasExtensions": false, + "hasFields": true, + "extensions": [], + "fields": [ + { + "name": "ok", + "description": "", + "label": "", + "type": "bool", + "longType": "bool", + "fullType": "bool", + "ismap": false, + "defaultValue": "" + } + ] + }, + { + "name": "GetLedgersResponse", + "longName": "GetLedgersResponse", + "fullName": "bdware.bdledger.api.GetLedgersResponse", + "description": "", + "hasExtensions": false, + "hasFields": true, + "extensions": [], + "fields": [ + { + "name": "ledgers", + "description": "", + "label": "repeated", + "type": "string", + "longType": "string", + "fullType": "string", + "ismap": false, + "defaultValue": "" + } + ] + }, + { + "name": "SendTransactionRequest", + "longName": "SendTransactionRequest", + "fullName": "bdware.bdledger.api.SendTransactionRequest", + "description": "", + "hasExtensions": false, + "hasFields": true, + "extensions": [], + "fields": [ + { + "name": "ledger", + "description": "", + "label": "", + "type": "string", + "longType": "string", + "fullType": "string", + "ismap": false, + "defaultValue": "" + }, + { + "name": "transaction", + "description": "", + "label": "", + "type": "Transaction", + "longType": "SendTransactionRequest.Transaction", + "fullType": "bdware.bdledger.api.SendTransactionRequest.Transaction", + "ismap": false, + "defaultValue": "" + } + ] + }, + { + "name": "Transaction", + "longName": "SendTransactionRequest.Transaction", + "fullName": "bdware.bdledger.api.SendTransactionRequest.Transaction", + "description": "", + "hasExtensions": false, + "hasFields": true, + "extensions": [], + "fields": [ + { + "name": "type", + "description": "", + "label": "", + "type": "TransactionType", + "longType": "TransactionType", + "fullType": "bdware.bdledger.api.TransactionType", + "ismap": false, + "defaultValue": "" + }, + { + "name": "from", + "description": "", + "label": "", + "type": "bytes", + "longType": "bytes", + "fullType": "bytes", + "ismap": false, + "defaultValue": "" + }, + { + "name": "to", + "description": "", + "label": "", + "type": "bytes", + "longType": "bytes", + "fullType": "bytes", + "ismap": false, + "defaultValue": "" + }, + { + "name": "data", + "description": "", + "label": "", + "type": "bytes", + "longType": "bytes", + "fullType": "bytes", + "ismap": false, + "defaultValue": "" + } + ] + }, + { + "name": "SendTransactionResponse", + "longName": "SendTransactionResponse", + "fullName": "bdware.bdledger.api.SendTransactionResponse", + "description": "", + "hasExtensions": false, + "hasFields": true, + "extensions": [], + "fields": [ + { + "name": "hash", + "description": "", + "label": "", + "type": "bytes", + "longType": "bytes", + "fullType": "bytes", + "ismap": false, + "defaultValue": "" + } + ] + } + ], + "services": [ + { + "name": "Ledger", + "longName": "Ledger", + "fullName": "bdware.bdledger.api.Ledger", + "description": "", + "methods": [ + { + "name": "CreateLedger", + "description": "Create a new ledger\n创建一个新账本", + "requestType": "CreateLedgerRequest", + "requestLongType": "CreateLedgerRequest", + "requestFullType": "bdware.bdledger.api.CreateLedgerRequest", + "requestStreaming": false, + "responseType": "CreateLedgerResponse", + "responseLongType": "CreateLedgerResponse", + "responseFullType": "bdware.bdledger.api.CreateLedgerResponse", + "responseStreaming": false + }, + { + "name": "GetLedgers", + "description": "Get all ledgers\n查询所有帐本列表", + "requestType": "Empty", + "requestLongType": ".google.protobuf.Empty", + "requestFullType": "google.protobuf.Empty", + "requestStreaming": false, + "responseType": "GetLedgersResponse", + "responseLongType": "GetLedgersResponse", + "responseFullType": "bdware.bdledger.api.GetLedgersResponse", + "responseStreaming": false + }, + { + "name": "SendTransaction", + "description": "Send a new transaction\n发送一个新事务", + "requestType": "SendTransactionRequest", + "requestLongType": "SendTransactionRequest", + "requestFullType": "bdware.bdledger.api.SendTransactionRequest", + "requestStreaming": false, + "responseType": "SendTransactionResponse", + "responseLongType": "SendTransactionResponse", + "responseFullType": "bdware.bdledger.api.SendTransactionResponse", + "responseStreaming": false + } + ] + } + ] + }, + { + "name": "bdware/bdledger/api/node.proto", + "description": "", + "package": "bdware.bdledger.api", + "hasEnums": false, + "hasExtensions": false, + "hasMessages": true, + "hasServices": true, + "enums": [], + "extensions": [], + "messages": [ + { + "name": "ClientVersionResponse", + "longName": "ClientVersionResponse", + "fullName": "bdware.bdledger.api.ClientVersionResponse", + "description": "", + "hasExtensions": false, + "hasFields": true, + "extensions": [], + "fields": [ + { + "name": "version", + "description": "节点客户端版本", + "label": "", + "type": "string", + "longType": "string", + "fullType": "string", + "ismap": false, + "defaultValue": "" + } + ] + } + ], + "services": [ + { + "name": "Node", + "longName": "Node", + "fullName": "bdware.bdledger.api.Node", + "description": "", + "methods": [ + { + "name": "ClientVersion", + "description": "Get BDLedger node version\n查询BDLedger节点版本", + "requestType": "Empty", + "requestLongType": ".google.protobuf.Empty", + "requestFullType": "google.protobuf.Empty", + "requestStreaming": false, + "responseType": "ClientVersionResponse", + "responseLongType": "ClientVersionResponse", + "responseFullType": "bdware.bdledger.api.ClientVersionResponse", + "responseStreaming": false + } + ] + } + ] + }, + { + "name": "bdware/bdledger/api/query.proto", + "description": "", + "package": "bdware.bdledger.api", + "hasEnums": false, + "hasExtensions": false, + "hasMessages": true, + "hasServices": true, + "enums": [ + { + "name": "IncludeTransactions", + "longName": "BlocksRequest.IncludeTransactions", + "fullName": "bdware.bdledger.api.BlocksRequest.IncludeTransactions", + "description": "", + "values": [ + { + "name": "NONE", + "number": "0", + "description": "不包含交易数据" + }, + { + "name": "HASH", + "number": "1", + "description": "包含交易哈希列表" + }, + { + "name": "FULL", + "number": "2", + "description": "包含完整交易列表" + } + ] + } + ], + "extensions": [], + "messages": [ + { + "name": "BlockFilter", + "longName": "BlockFilter", + "fullName": "bdware.bdledger.api.BlockFilter", + "description": "", + "hasExtensions": false, + "hasFields": true, + "extensions": [], + "fields": [ + { + "name": "hash", + "description": "", + "label": "", + "type": "bytes", + "longType": "bytes", + "fullType": "bytes", + "ismap": false, + "defaultValue": "" + }, + { + "name": "timestamp", + "description": "", + "label": "", + "type": "int64", + "longType": "int64", + "fullType": "int64", + "ismap": false, + "defaultValue": "" + } + ] + }, + { + "name": "BlocksRequest", + "longName": "BlocksRequest", + "fullName": "bdware.bdledger.api.BlocksRequest", + "description": "", + "hasExtensions": false, + "hasFields": true, + "extensions": [], + "fields": [ + { + "name": "ledger", + "description": "", + "label": "", + "type": "string", + "longType": "string", + "fullType": "string", + "ismap": false, + "defaultValue": "" + }, + { + "name": "start_timestamp", + "description": "", + "label": "", + "type": "int64", + "longType": "int64", + "fullType": "int64", + "ismap": false, + "defaultValue": "" + }, + { + "name": "end_timestamp", + "description": "", + "label": "", + "type": "int64", + "longType": "int64", + "fullType": "int64", + "ismap": false, + "defaultValue": "" + }, + { + "name": "filters", + "description": "", + "label": "repeated", + "type": "BlockFilter", + "longType": "BlockFilter", + "fullType": "bdware.bdledger.api.BlockFilter", + "ismap": false, + "defaultValue": "" + }, + { + "name": "include_transactions", + "description": "", + "label": "", + "type": "IncludeTransactions", + "longType": "BlocksRequest.IncludeTransactions", + "fullType": "bdware.bdledger.api.BlocksRequest.IncludeTransactions", + "ismap": false, + "defaultValue": "" + } + ] + }, + { + "name": "CountBlocksResponse", + "longName": "CountBlocksResponse", + "fullName": "bdware.bdledger.api.CountBlocksResponse", + "description": "", + "hasExtensions": false, + "hasFields": true, + "extensions": [], + "fields": [ + { + "name": "count", + "description": "", + "label": "", + "type": "uint64", + "longType": "uint64", + "fullType": "uint64", + "ismap": false, + "defaultValue": "" + }, + { + "name": "start_timestamp", + "description": "", + "label": "", + "type": "int64", + "longType": "int64", + "fullType": "int64", + "ismap": false, + "defaultValue": "" + }, + { + "name": "end_timestamp", + "description": "", + "label": "", + "type": "int64", + "longType": "int64", + "fullType": "int64", + "ismap": false, + "defaultValue": "" + } + ] + }, + { + "name": "CountTransactionsResponse", + "longName": "CountTransactionsResponse", + "fullName": "bdware.bdledger.api.CountTransactionsResponse", + "description": "", + "hasExtensions": false, + "hasFields": true, + "extensions": [], + "fields": [ + { + "name": "count", + "description": "", + "label": "", + "type": "uint64", + "longType": "uint64", + "fullType": "uint64", + "ismap": false, + "defaultValue": "" + }, + { + "name": "start_timestamp", + "description": "", + "label": "", + "type": "int64", + "longType": "int64", + "fullType": "int64", + "ismap": false, + "defaultValue": "" + }, + { + "name": "end_timestamp", + "description": "", + "label": "", + "type": "int64", + "longType": "int64", + "fullType": "int64", + "ismap": false, + "defaultValue": "" + } + ] + }, + { + "name": "GetBlockByHashRequest", + "longName": "GetBlockByHashRequest", + "fullName": "bdware.bdledger.api.GetBlockByHashRequest", + "description": "", + "hasExtensions": false, + "hasFields": true, + "extensions": [], + "fields": [ + { + "name": "ledger", + "description": "", + "label": "", + "type": "string", + "longType": "string", + "fullType": "string", + "ismap": false, + "defaultValue": "" + }, + { + "name": "hash", + "description": "", + "label": "", + "type": "bytes", + "longType": "bytes", + "fullType": "bytes", + "ismap": false, + "defaultValue": "" + }, + { + "name": "full_transactions", + "description": "", + "label": "", + "type": "bool", + "longType": "bool", + "fullType": "bool", + "ismap": false, + "defaultValue": "" + } + ] + }, + { + "name": "GetBlockByHashResponse", + "longName": "GetBlockByHashResponse", + "fullName": "bdware.bdledger.api.GetBlockByHashResponse", + "description": "", + "hasExtensions": false, + "hasFields": true, + "extensions": [], + "fields": [ + { + "name": "block", + "description": "", + "label": "", + "type": "Block", + "longType": "Block", + "fullType": "bdware.bdledger.api.Block", + "ismap": false, + "defaultValue": "" + } + ] + }, + { + "name": "GetBlocksResponse", + "longName": "GetBlocksResponse", + "fullName": "bdware.bdledger.api.GetBlocksResponse", + "description": "", + "hasExtensions": false, + "hasFields": true, + "extensions": [], + "fields": [ + { + "name": "blocks", + "description": "", + "label": "repeated", + "type": "Block", + "longType": "Block", + "fullType": "bdware.bdledger.api.Block", + "ismap": false, + "defaultValue": "" + }, + { + "name": "start_timestamp", + "description": "", + "label": "", + "type": "int64", + "longType": "int64", + "fullType": "int64", + "ismap": false, + "defaultValue": "" + }, + { + "name": "end_timestamp", + "description": "", + "label": "", + "type": "int64", + "longType": "int64", + "fullType": "int64", + "ismap": false, + "defaultValue": "" + } + ] + }, + { + "name": "GetTransactionByBlockHashAndIndexRequest", + "longName": "GetTransactionByBlockHashAndIndexRequest", + "fullName": "bdware.bdledger.api.GetTransactionByBlockHashAndIndexRequest", + "description": "", + "hasExtensions": false, + "hasFields": true, + "extensions": [], + "fields": [ + { + "name": "ledger", + "description": "", + "label": "", + "type": "string", + "longType": "string", + "fullType": "string", + "ismap": false, + "defaultValue": "" + }, + { + "name": "block_hash", + "description": "", + "label": "", + "type": "bytes", + "longType": "bytes", + "fullType": "bytes", + "ismap": false, + "defaultValue": "" + }, + { + "name": "index", + "description": "", + "label": "", + "type": "uint32", + "longType": "uint32", + "fullType": "uint32", + "ismap": false, + "defaultValue": "" + } + ] + }, + { + "name": "GetTransactionByBlockHashAndIndexResponse", + "longName": "GetTransactionByBlockHashAndIndexResponse", + "fullName": "bdware.bdledger.api.GetTransactionByBlockHashAndIndexResponse", + "description": "", + "hasExtensions": false, + "hasFields": true, + "extensions": [], + "fields": [ + { + "name": "transaction", + "description": "", + "label": "", + "type": "Transaction", + "longType": "Transaction", + "fullType": "bdware.bdledger.api.Transaction", + "ismap": false, + "defaultValue": "" + } + ] + }, + { + "name": "GetTransactionByHashRequest", + "longName": "GetTransactionByHashRequest", + "fullName": "bdware.bdledger.api.GetTransactionByHashRequest", + "description": "", + "hasExtensions": false, + "hasFields": true, + "extensions": [], + "fields": [ + { + "name": "ledger", + "description": "", + "label": "", + "type": "string", + "longType": "string", + "fullType": "string", + "ismap": false, + "defaultValue": "" + }, + { + "name": "hash", + "description": "", + "label": "", + "type": "bytes", + "longType": "bytes", + "fullType": "bytes", + "ismap": false, + "defaultValue": "" + } + ] + }, + { + "name": "GetTransactionByHashResponse", + "longName": "GetTransactionByHashResponse", + "fullName": "bdware.bdledger.api.GetTransactionByHashResponse", + "description": "", + "hasExtensions": false, + "hasFields": true, + "extensions": [], + "fields": [ + { + "name": "transaction", + "description": "", + "label": "", + "type": "Transaction", + "longType": "Transaction", + "fullType": "bdware.bdledger.api.Transaction", + "ismap": false, + "defaultValue": "" + } + ] + }, + { + "name": "GetTransactionsResponse", + "longName": "GetTransactionsResponse", + "fullName": "bdware.bdledger.api.GetTransactionsResponse", + "description": "", + "hasExtensions": false, + "hasFields": true, + "extensions": [], + "fields": [ + { + "name": "transactions", + "description": "", + "label": "repeated", + "type": "Transaction", + "longType": "Transaction", + "fullType": "bdware.bdledger.api.Transaction", + "ismap": false, + "defaultValue": "" + }, + { + "name": "start_timestamp", + "description": "", + "label": "", + "type": "int64", + "longType": "int64", + "fullType": "int64", + "ismap": false, + "defaultValue": "" + }, + { + "name": "end_timestamp", + "description": "", + "label": "", + "type": "int64", + "longType": "int64", + "fullType": "int64", + "ismap": false, + "defaultValue": "" + } + ] + }, + { + "name": "TransactionFilter", + "longName": "TransactionFilter", + "fullName": "bdware.bdledger.api.TransactionFilter", + "description": "repeated Transaction/BlockFilters are combined by \"\u0026\u0026\"(and) operator;", + "hasExtensions": false, + "hasFields": true, + "extensions": [], + "fields": [ + { + "name": "hash", + "description": "", + "label": "", + "type": "bytes", + "longType": "bytes", + "fullType": "bytes", + "ismap": false, + "defaultValue": "" + }, + { + "name": "from", + "description": "", + "label": "", + "type": "bytes", + "longType": "bytes", + "fullType": "bytes", + "ismap": false, + "defaultValue": "" + }, + { + "name": "to", + "description": "", + "label": "", + "type": "bytes", + "longType": "bytes", + "fullType": "bytes", + "ismap": false, + "defaultValue": "" + }, + { + "name": "timestamp", + "description": "", + "label": "", + "type": "bytes", + "longType": "bytes", + "fullType": "bytes", + "ismap": false, + "defaultValue": "" + } + ] + }, + { + "name": "TransactionsRequest", + "longName": "TransactionsRequest", + "fullName": "bdware.bdledger.api.TransactionsRequest", + "description": "", + "hasExtensions": false, + "hasFields": true, + "extensions": [], + "fields": [ + { + "name": "ledger", + "description": "", + "label": "", + "type": "string", + "longType": "string", + "fullType": "string", + "ismap": false, + "defaultValue": "" + }, + { + "name": "start_timestamp", + "description": "required", + "label": "", + "type": "int64", + "longType": "int64", + "fullType": "int64", + "ismap": false, + "defaultValue": "" + }, + { + "name": "end_timestamp", + "description": "", + "label": "", + "type": "int64", + "longType": "int64", + "fullType": "int64", + "ismap": false, + "defaultValue": "" + }, + { + "name": "filters", + "description": "", + "label": "repeated", + "type": "TransactionFilter", + "longType": "TransactionFilter", + "fullType": "bdware.bdledger.api.TransactionFilter", + "ismap": false, + "defaultValue": "" + } + ] + } + ], + "services": [ + { + "name": "Query", + "longName": "Query", + "fullName": "bdware.bdledger.api.Query", + "description": "", + "methods": [ + { + "name": "GetBlockByHash", + "description": "Get a block identified by its hash\n查询哈希所指定的区块", + "requestType": "GetBlockByHashRequest", + "requestLongType": "GetBlockByHashRequest", + "requestFullType": "bdware.bdledger.api.GetBlockByHashRequest", + "requestStreaming": false, + "responseType": "GetBlockByHashResponse", + "responseLongType": "GetBlockByHashResponse", + "responseFullType": "bdware.bdledger.api.GetBlockByHashResponse", + "responseStreaming": false + }, + { + "name": "GetBlocks", + "description": "Get blocks in a timestamp range\n查询时间范围内的区块\nstart_timestamp is required", + "requestType": "BlocksRequest", + "requestLongType": "BlocksRequest", + "requestFullType": "bdware.bdledger.api.BlocksRequest", + "requestStreaming": false, + "responseType": "GetBlocksResponse", + "responseLongType": "GetBlocksResponse", + "responseFullType": "bdware.bdledger.api.GetBlocksResponse", + "responseStreaming": false + }, + { + "name": "CountBlocks", + "description": "Count all blocks in a ledger, or blocks in a timestamp range\n查询帐本中的所有区块数量,或时间范围内的区块数量", + "requestType": "BlocksRequest", + "requestLongType": "BlocksRequest", + "requestFullType": "bdware.bdledger.api.BlocksRequest", + "requestStreaming": false, + "responseType": "CountBlocksResponse", + "responseLongType": "CountBlocksResponse", + "responseFullType": "bdware.bdledger.api.CountBlocksResponse", + "responseStreaming": false + }, + { + "name": "GetTransactionByHash", + "description": "Get a transaction identified by its hash\n查询哈希所指定的事务", + "requestType": "GetTransactionByHashRequest", + "requestLongType": "GetTransactionByHashRequest", + "requestFullType": "bdware.bdledger.api.GetTransactionByHashRequest", + "requestStreaming": false, + "responseType": "GetTransactionByHashResponse", + "responseLongType": "GetTransactionByHashResponse", + "responseFullType": "bdware.bdledger.api.GetTransactionByHashResponse", + "responseStreaming": false + }, + { + "name": "GetTransactionByBlockHashAndIndex", + "description": "Get a transaction identified by hash of the block it belongs to and its index inside the block\n查询所在区块的哈希与其在区块中的index所指定的事务", + "requestType": "GetTransactionByBlockHashAndIndexRequest", + "requestLongType": "GetTransactionByBlockHashAndIndexRequest", + "requestFullType": "bdware.bdledger.api.GetTransactionByBlockHashAndIndexRequest", + "requestStreaming": false, + "responseType": "GetTransactionByBlockHashAndIndexResponse", + "responseLongType": "GetTransactionByBlockHashAndIndexResponse", + "responseFullType": "bdware.bdledger.api.GetTransactionByBlockHashAndIndexResponse", + "responseStreaming": false + }, + { + "name": "GetTransactions", + "description": "Get transactions in a timestamp range\n查询时间范围内的事务", + "requestType": "TransactionsRequest", + "requestLongType": "TransactionsRequest", + "requestFullType": "bdware.bdledger.api.TransactionsRequest", + "requestStreaming": false, + "responseType": "GetTransactionsResponse", + "responseLongType": "GetTransactionsResponse", + "responseFullType": "bdware.bdledger.api.GetTransactionsResponse", + "responseStreaming": false + }, + { + "name": "CountTransactions", + "description": "Count all transactions in a ledger, or transactions in a timestamp range\n查询帐本中的所有事务数量,或时间范围内的事务数量\nstart_timestamp is required", + "requestType": "TransactionsRequest", + "requestLongType": "TransactionsRequest", + "requestFullType": "bdware.bdledger.api.TransactionsRequest", + "requestStreaming": false, + "responseType": "CountTransactionsResponse", + "responseLongType": "CountTransactionsResponse", + "responseFullType": "bdware.bdledger.api.CountTransactionsResponse", + "responseStreaming": false + } + ] + } + ] + }, + { + "name": "google/protobuf/empty.proto", + "description": "", + "package": "google.protobuf", + "hasEnums": false, + "hasExtensions": false, + "hasMessages": true, + "hasServices": false, + "enums": [], + "extensions": [], + "messages": [ + { + "name": "Empty", + "longName": "Empty", + "fullName": "google.protobuf.Empty", + "description": "A generic empty message that you can re-use to avoid defining duplicated\nempty messages in your APIs. A typical example is to use it as the request\nor the response type of an API method. For instance:\n\n service Foo {\n rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);\n }\n\nThe JSON representation for `Empty` is empty JSON object `{}`.", + "hasExtensions": false, + "hasFields": false, + "extensions": [], + "fields": [] + } + ], + "services": [] + } + ], + "scalarValueTypes": [ + { + "protoType": "double", + "notes": "", + "cppType": "double", + "csType": "double", + "goType": "float64", + "javaType": "double", + "phpType": "float", + "pythonType": "float", + "rubyType": "Float" + }, + { + "protoType": "float", + "notes": "", + "cppType": "float", + "csType": "float", + "goType": "float32", + "javaType": "float", + "phpType": "float", + "pythonType": "float", + "rubyType": "Float" + }, + { + "protoType": "int32", + "notes": "Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead.", + "cppType": "int32", + "csType": "int", + "goType": "int32", + "javaType": "int", + "phpType": "integer", + "pythonType": "int", + "rubyType": "Bignum or Fixnum (as required)" + }, + { + "protoType": "int64", + "notes": "Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead.", + "cppType": "int64", + "csType": "long", + "goType": "int64", + "javaType": "long", + "phpType": "integer/string", + "pythonType": "int/long", + "rubyType": "Bignum" + }, + { + "protoType": "uint32", + "notes": "Uses variable-length encoding.", + "cppType": "uint32", + "csType": "uint", + "goType": "uint32", + "javaType": "int", + "phpType": "integer", + "pythonType": "int/long", + "rubyType": "Bignum or Fixnum (as required)" + }, + { + "protoType": "uint64", + "notes": "Uses variable-length encoding.", + "cppType": "uint64", + "csType": "ulong", + "goType": "uint64", + "javaType": "long", + "phpType": "integer/string", + "pythonType": "int/long", + "rubyType": "Bignum or Fixnum (as required)" + }, + { + "protoType": "sint32", + "notes": "Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s.", + "cppType": "int32", + "csType": "int", + "goType": "int32", + "javaType": "int", + "phpType": "integer", + "pythonType": "int", + "rubyType": "Bignum or Fixnum (as required)" + }, + { + "protoType": "sint64", + "notes": "Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s.", + "cppType": "int64", + "csType": "long", + "goType": "int64", + "javaType": "long", + "phpType": "integer/string", + "pythonType": "int/long", + "rubyType": "Bignum" + }, + { + "protoType": "fixed32", + "notes": "Always four bytes. More efficient than uint32 if values are often greater than 2^28.", + "cppType": "uint32", + "csType": "uint", + "goType": "uint32", + "javaType": "int", + "phpType": "integer", + "pythonType": "int", + "rubyType": "Bignum or Fixnum (as required)" + }, + { + "protoType": "fixed64", + "notes": "Always eight bytes. More efficient than uint64 if values are often greater than 2^56.", + "cppType": "uint64", + "csType": "ulong", + "goType": "uint64", + "javaType": "long", + "phpType": "integer/string", + "pythonType": "int/long", + "rubyType": "Bignum" + }, + { + "protoType": "sfixed32", + "notes": "Always four bytes.", + "cppType": "int32", + "csType": "int", + "goType": "int32", + "javaType": "int", + "phpType": "integer", + "pythonType": "int", + "rubyType": "Bignum or Fixnum (as required)" + }, + { + "protoType": "sfixed64", + "notes": "Always eight bytes.", + "cppType": "int64", + "csType": "long", + "goType": "int64", + "javaType": "long", + "phpType": "integer/string", + "pythonType": "int/long", + "rubyType": "Bignum" + }, + { + "protoType": "bool", + "notes": "", + "cppType": "bool", + "csType": "bool", + "goType": "bool", + "javaType": "boolean", + "phpType": "boolean", + "pythonType": "boolean", + "rubyType": "TrueClass/FalseClass" + }, + { + "protoType": "string", + "notes": "A string must always contain UTF-8 encoded or 7-bit ASCII text.", + "cppType": "string", + "csType": "string", + "goType": "string", + "javaType": "String", + "phpType": "string", + "pythonType": "str/unicode", + "rubyType": "String (UTF-8)" + }, + { + "protoType": "bytes", + "notes": "May contain any arbitrary sequence of bytes.", + "cppType": "string", + "csType": "ByteString", + "goType": "[]byte", + "javaType": "ByteString", + "phpType": "string", + "pythonType": "str", + "rubyType": "String (ASCII-8BIT)" + } + ] +} \ No newline at end of file diff --git a/docs/apis.md b/docs/apis.md new file mode 100644 index 0000000..9171b6a --- /dev/null +++ b/docs/apis.md @@ -0,0 +1,745 @@ +# Protocol Documentation + + +## Table of Contents + +- [bdware/bdledger/api/common.proto](#bdware/bdledger/api/common.proto) + - [Block](#bdware.bdledger.api.Block) + - [Contract](#bdware.bdledger.api.Contract) + - [Transaction](#bdware.bdledger.api.Transaction) + + - [Contract.ContractUnitRequestType](#bdware.bdledger.api.Contract.ContractUnitRequestType) + - [TransactionType](#bdware.bdledger.api.TransactionType) + + + + +- [bdware/bdledger/api/error_details.proto](#bdware/bdledger/api/error_details.proto) + - [InvalidArgument](#bdware.bdledger.api.InvalidArgument) + - [InvalidArgument.FieldViolation](#bdware.bdledger.api.InvalidArgument.FieldViolation) + + + + + +- [bdware/bdledger/api/ledger.proto](#bdware/bdledger/api/ledger.proto) + - [CreateLedgerRequest](#bdware.bdledger.api.CreateLedgerRequest) + - [CreateLedgerResponse](#bdware.bdledger.api.CreateLedgerResponse) + - [GetLedgersResponse](#bdware.bdledger.api.GetLedgersResponse) + - [SendTransactionRequest](#bdware.bdledger.api.SendTransactionRequest) + - [SendTransactionRequest.Transaction](#bdware.bdledger.api.SendTransactionRequest.Transaction) + - [SendTransactionResponse](#bdware.bdledger.api.SendTransactionResponse) + + + + - [Ledger](#bdware.bdledger.api.Ledger) + + +- [bdware/bdledger/api/node.proto](#bdware/bdledger/api/node.proto) + - [ClientVersionResponse](#bdware.bdledger.api.ClientVersionResponse) + + + + - [Node](#bdware.bdledger.api.Node) + + +- [bdware/bdledger/api/query.proto](#bdware/bdledger/api/query.proto) + - [BlockFilter](#bdware.bdledger.api.BlockFilter) + - [BlocksRequest](#bdware.bdledger.api.BlocksRequest) + - [CountBlocksResponse](#bdware.bdledger.api.CountBlocksResponse) + - [CountTransactionsResponse](#bdware.bdledger.api.CountTransactionsResponse) + - [GetBlockByHashRequest](#bdware.bdledger.api.GetBlockByHashRequest) + - [GetBlockByHashResponse](#bdware.bdledger.api.GetBlockByHashResponse) + - [GetBlocksResponse](#bdware.bdledger.api.GetBlocksResponse) + - [GetTransactionByBlockHashAndIndexRequest](#bdware.bdledger.api.GetTransactionByBlockHashAndIndexRequest) + - [GetTransactionByBlockHashAndIndexResponse](#bdware.bdledger.api.GetTransactionByBlockHashAndIndexResponse) + - [GetTransactionByHashRequest](#bdware.bdledger.api.GetTransactionByHashRequest) + - [GetTransactionByHashResponse](#bdware.bdledger.api.GetTransactionByHashResponse) + - [GetTransactionsResponse](#bdware.bdledger.api.GetTransactionsResponse) + - [TransactionFilter](#bdware.bdledger.api.TransactionFilter) + - [TransactionsRequest](#bdware.bdledger.api.TransactionsRequest) + + - [BlocksRequest.IncludeTransactions](#bdware.bdledger.api.BlocksRequest.IncludeTransactions) + + + - [Query](#bdware.bdledger.api.Query) + + +- [google/protobuf/empty.proto](#google/protobuf/empty.proto) + - [Empty](#google.protobuf.Empty) + + + + + +- [Scalar Value Types](#scalar-value-types) + + + + +

Top

+ +## bdware/bdledger/api/common.proto + + + + + +### Block + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| hash | [bytes](#bytes) | | 区块的哈希,当区块处于待确认状态时为`null` | +| parent_hashes | [bytes](#bytes) | repeated | 父区块的哈希 | +| witnesses | [bytes](#bytes) | repeated | 见证者账户地址 | +| timestamp | [int64](#int64) | | 区块产生时的 UNIX 时间戳,单位为秒 | +| size | [uint64](#uint64) | | 区块大小的字节数 | +| transaction_count | [uint32](#uint32) | | 区块包含的事务数量 | +| transactions_root | [bytes](#bytes) | | 区块的事务默克尔树根 | +| transactions | [Transaction](#bdware.bdledger.api.Transaction) | repeated | 事务对象的数组,或为空 | +| transaction_hashes | [bytes](#bytes) | repeated | 20字节的交易哈希的数组,或为空 | + + + + + + + + +### Contract + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| contractName | [bytes](#bytes) | | 合约名称 | +| randomNum | [uint32](#uint32) | | 合约执行的节点数量 | +| operation | [bytes](#bytes) | | 合约方法 | +| arg | [bytes](#bytes) | | 合约方法参数 | +| path | [bytes](#bytes) | | 合约文件路径(合约在IDE工程的相对路径) | +| content | [bytes](#bytes) | | 合约内容(可为合约文件相对路径/合约脚本) | +| pubkey | [bytes](#bytes) | | 用户公钥 | + + + + + + + + +### Transaction + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| block_hash | [bytes](#bytes) | | 事务所在的区块的哈希,当事务处于待确认状态时为`null` | +| index | [uint32](#uint32) | | 事务在区块中的位置 index,当事务处于待确认状态时为`null` | +| hash | [bytes](#bytes) | | 事务的哈希 | +| type | [TransactionType](#bdware.bdledger.api.TransactionType) | | 事务类型 | +| from | [bytes](#bytes) | | 发送账户地址 | +| nonce | [uint64](#uint64) | | 这条事务之前发送者所发送的事务数量 | +| to | [bytes](#bytes) | | 接收账户地址,或者调用的合约地址,或者`null`如为合约创建 | +| data | [bytes](#bytes) | | 数据或合约代码 | +| v | [bytes](#bytes) | | ECDSA recovery id | +| r | [bytes](#bytes) | | ECDSA signature r | +| s | [bytes](#bytes) | | ECDSA signature s | + + + + + + + + + + +### Contract.ContractUnitRequestType + + +| Name | Number | Description | +| ---- | ------ | ----------- | +| START | 0 | | +| STOP | 1 | | +| EXECUTE | 2 | | +| REPLY | 3 | | +| REQUEST | 4 | | +| PREPREPARE | 5 | | +| PREPARE | 6 | | +| COMMIT | 7 | | +| ADDPEER | 8 | | +| DROPPEER | 9 | | +| STATESYNC | 10 | | + + + + + +### TransactionType +事务类型 + +| Name | Number | Description | +| ---- | ------ | ----------- | +| RECORD | 0 | 通用数据记录 | +| MESSAGE | 1 | 消息 | +| CONTRACT_CREATION | 2 | 合约创建 | +| CONTRACT_INVOCATION | 3 | 合约调用 | +| CONTRACT_STATUS | 4 | 合约状态 | + + + + + + + + + + + +

Top

+ +## bdware/bdledger/api/error_details.proto + + + + + +### InvalidArgument +InvalidArgument indicates client specified an invalid argument. +Note that this differs from FailedPrecondition. It indicates arguments +that are problematic regardless of the state of the system +(e.g., a malformed file name). + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| field_violations | [InvalidArgument.FieldViolation](#bdware.bdledger.api.InvalidArgument.FieldViolation) | repeated | Describes all violations in a client request. | + + + + + + + + +### InvalidArgument.FieldViolation +A message type used to describe a single invalid field. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| field | [string](#string) | | A path leading to a field in the request body. The value will be a sequence of dot-separated identifiers that identify a protocol buffer field. E.g., "field_violations.field" would identify this field. | +| description | [string](#string) | | A description of why the request element is bad. | + + + + + + + + + + + + + + + + +

Top

+ +## bdware/bdledger/api/ledger.proto + + + + + +### CreateLedgerRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| name | [string](#string) | | | + + + + + + + + +### CreateLedgerResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| ok | [bool](#bool) | | | + + + + + + + + +### GetLedgersResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| ledgers | [string](#string) | repeated | | + + + + + + + + +### SendTransactionRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| ledger | [string](#string) | | | +| transaction | [SendTransactionRequest.Transaction](#bdware.bdledger.api.SendTransactionRequest.Transaction) | | | + + + + + + + + +### SendTransactionRequest.Transaction + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| type | [TransactionType](#bdware.bdledger.api.TransactionType) | | | +| from | [bytes](#bytes) | | | +| to | [bytes](#bytes) | | | +| data | [bytes](#bytes) | | | + + + + + + + + +### SendTransactionResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| hash | [bytes](#bytes) | | | + + + + + + + + + + + + + + +### Ledger + + +| Method Name | Request Type | Response Type | Description | +| ----------- | ------------ | ------------- | ------------| +| CreateLedger | [CreateLedgerRequest](#bdware.bdledger.api.CreateLedgerRequest) | [CreateLedgerResponse](#bdware.bdledger.api.CreateLedgerResponse) | Create a new ledger 创建一个新账本 | +| GetLedgers | [.google.protobuf.Empty](#google.protobuf.Empty) | [GetLedgersResponse](#bdware.bdledger.api.GetLedgersResponse) | Get all ledgers 查询所有帐本列表 | +| SendTransaction | [SendTransactionRequest](#bdware.bdledger.api.SendTransactionRequest) | [SendTransactionResponse](#bdware.bdledger.api.SendTransactionResponse) | Send a new transaction 发送一个新事务 | + + + + + + +

Top

+ +## bdware/bdledger/api/node.proto + + + + + +### ClientVersionResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| version | [string](#string) | | 节点客户端版本 | + + + + + + + + + + + + + + +### Node + + +| Method Name | Request Type | Response Type | Description | +| ----------- | ------------ | ------------- | ------------| +| ClientVersion | [.google.protobuf.Empty](#google.protobuf.Empty) | [ClientVersionResponse](#bdware.bdledger.api.ClientVersionResponse) | Get BDLedger node version 查询BDLedger节点版本 | + + + + + + +

Top

+ +## bdware/bdledger/api/query.proto + + + + + +### BlockFilter + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| hash | [bytes](#bytes) | | | +| timestamp | [int64](#int64) | | | + + + + + + + + +### BlocksRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| ledger | [string](#string) | | | +| start_timestamp | [int64](#int64) | | | +| end_timestamp | [int64](#int64) | | | +| filters | [BlockFilter](#bdware.bdledger.api.BlockFilter) | repeated | | +| include_transactions | [BlocksRequest.IncludeTransactions](#bdware.bdledger.api.BlocksRequest.IncludeTransactions) | | | + + + + + + + + +### CountBlocksResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| count | [uint64](#uint64) | | | +| start_timestamp | [int64](#int64) | | | +| end_timestamp | [int64](#int64) | | | + + + + + + + + +### CountTransactionsResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| count | [uint64](#uint64) | | | +| start_timestamp | [int64](#int64) | | | +| end_timestamp | [int64](#int64) | | | + + + + + + + + +### GetBlockByHashRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| ledger | [string](#string) | | | +| hash | [bytes](#bytes) | | | +| full_transactions | [bool](#bool) | | | + + + + + + + + +### GetBlockByHashResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| block | [Block](#bdware.bdledger.api.Block) | | | + + + + + + + + +### GetBlocksResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| blocks | [Block](#bdware.bdledger.api.Block) | repeated | | +| start_timestamp | [int64](#int64) | | | +| end_timestamp | [int64](#int64) | | | + + + + + + + + +### GetTransactionByBlockHashAndIndexRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| ledger | [string](#string) | | | +| block_hash | [bytes](#bytes) | | | +| index | [uint32](#uint32) | | | + + + + + + + + +### GetTransactionByBlockHashAndIndexResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| transaction | [Transaction](#bdware.bdledger.api.Transaction) | | | + + + + + + + + +### GetTransactionByHashRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| ledger | [string](#string) | | | +| hash | [bytes](#bytes) | | | + + + + + + + + +### GetTransactionByHashResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| transaction | [Transaction](#bdware.bdledger.api.Transaction) | | | + + + + + + + + +### GetTransactionsResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| transactions | [Transaction](#bdware.bdledger.api.Transaction) | repeated | | +| start_timestamp | [int64](#int64) | | | +| end_timestamp | [int64](#int64) | | | + + + + + + + + +### TransactionFilter +repeated Transaction/BlockFilters are combined by "&&"(and) operator; + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| hash | [bytes](#bytes) | | | +| from | [bytes](#bytes) | | | +| to | [bytes](#bytes) | | | +| timestamp | [bytes](#bytes) | | | + + + + + + + + +### TransactionsRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| ledger | [string](#string) | | | +| start_timestamp | [int64](#int64) | | required | +| end_timestamp | [int64](#int64) | | | +| filters | [TransactionFilter](#bdware.bdledger.api.TransactionFilter) | repeated | | + + + + + + + + + + +### BlocksRequest.IncludeTransactions + + +| Name | Number | Description | +| ---- | ------ | ----------- | +| NONE | 0 | 不包含交易数据 | +| HASH | 1 | 包含交易哈希列表 | +| FULL | 2 | 包含完整交易列表 | + + + + + + + + + +### Query + + +| Method Name | Request Type | Response Type | Description | +| ----------- | ------------ | ------------- | ------------| +| GetBlockByHash | [GetBlockByHashRequest](#bdware.bdledger.api.GetBlockByHashRequest) | [GetBlockByHashResponse](#bdware.bdledger.api.GetBlockByHashResponse) | Get a block identified by its hash 查询哈希所指定的区块 | +| GetBlocks | [BlocksRequest](#bdware.bdledger.api.BlocksRequest) | [GetBlocksResponse](#bdware.bdledger.api.GetBlocksResponse) | Get blocks in a timestamp range 查询时间范围内的区块 start_timestamp is required | +| CountBlocks | [BlocksRequest](#bdware.bdledger.api.BlocksRequest) | [CountBlocksResponse](#bdware.bdledger.api.CountBlocksResponse) | Count all blocks in a ledger, or blocks in a timestamp range 查询帐本中的所有区块数量,或时间范围内的区块数量 | +| GetTransactionByHash | [GetTransactionByHashRequest](#bdware.bdledger.api.GetTransactionByHashRequest) | [GetTransactionByHashResponse](#bdware.bdledger.api.GetTransactionByHashResponse) | Get a transaction identified by its hash 查询哈希所指定的事务 | +| GetTransactionByBlockHashAndIndex | [GetTransactionByBlockHashAndIndexRequest](#bdware.bdledger.api.GetTransactionByBlockHashAndIndexRequest) | [GetTransactionByBlockHashAndIndexResponse](#bdware.bdledger.api.GetTransactionByBlockHashAndIndexResponse) | Get a transaction identified by hash of the block it belongs to and its index inside the block 查询所在区块的哈希与其在区块中的index所指定的事务 | +| GetTransactions | [TransactionsRequest](#bdware.bdledger.api.TransactionsRequest) | [GetTransactionsResponse](#bdware.bdledger.api.GetTransactionsResponse) | Get transactions in a timestamp range 查询时间范围内的事务 | +| CountTransactions | [TransactionsRequest](#bdware.bdledger.api.TransactionsRequest) | [CountTransactionsResponse](#bdware.bdledger.api.CountTransactionsResponse) | Count all transactions in a ledger, or transactions in a timestamp range 查询帐本中的所有事务数量,或时间范围内的事务数量 start_timestamp is required | + + + + + + +

Top

+ +## google/protobuf/empty.proto + + + + + +### Empty +A generic empty message that you can re-use to avoid defining duplicated +empty messages in your APIs. A typical example is to use it as the request +or the response type of an API method. For instance: + + service Foo { + rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); + } + +The JSON representation for `Empty` is empty JSON object `{}`. + + + + + + + + + + + + + + + +## Scalar Value Types + +| .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby | +| ----------- | ----- | --- | ---- | ------ | -- | -- | --- | ---- | +| double | | double | double | float | float64 | double | float | Float | +| float | | float | float | float | float32 | float | float | Float | +| int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| uint32 | Uses variable-length encoding. | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) | +| uint64 | Uses variable-length encoding. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) | +| sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | uint32 | int | int | uint32 | uint | integer | Bignum or Fixnum (as required) | +| fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum | +| sfixed32 | Always four bytes. | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) | +| sfixed64 | Always eight bytes. | int64 | long | int/long | int64 | long | integer/string | Bignum | +| bool | | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass | +| string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | string | String | str/unicode | string | string | string | String (UTF-8) | +| bytes | May contain any arbitrary sequence of bytes. | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) | + diff --git a/grpc/pb/bdware/bdledger/api/ledger.proto b/grpc/pb/bdware/bdledger/api/ledger.proto index e2e8340..35a9b09 100644 --- a/grpc/pb/bdware/bdledger/api/ledger.proto +++ b/grpc/pb/bdware/bdledger/api/ledger.proto @@ -9,8 +9,20 @@ option go_package = "bdware.org/bdledger/api/grpc/pb"; option java_package = "org.bdware.bdledger.api.grpc.pb"; service Ledger { + /** + * Create a new ledger + * 创建一个新账本 + */ rpc CreateLedger (CreateLedgerRequest) returns (CreateLedgerResponse); + /** + * Get all ledgers + * 查询所有帐本列表 + */ rpc GetLedgers (google.protobuf.Empty) returns (GetLedgersResponse); + /** + * Send a new transaction + * 发送一个新事务 + */ rpc SendTransaction (SendTransactionRequest) returns (SendTransactionResponse); } diff --git a/grpc/pb/bdware/bdledger/api/node.proto b/grpc/pb/bdware/bdledger/api/node.proto index 970c5dc..e5e2daf 100644 --- a/grpc/pb/bdware/bdledger/api/node.proto +++ b/grpc/pb/bdware/bdledger/api/node.proto @@ -8,6 +8,10 @@ option go_package = "bdware.org/bdledger/api/grpc/pb"; option java_package = "org.bdware.bdledger.api.grpc.pb"; service Node { + /** + * Get BDLedger node version + * 查询BDLedger节点版本 + */ rpc ClientVersion (google.protobuf.Empty) returns (ClientVersionResponse); } diff --git a/grpc/pb/bdware/bdledger/api/query.proto b/grpc/pb/bdware/bdledger/api/query.proto index 1f71e32..0aa449c 100644 --- a/grpc/pb/bdware/bdledger/api/query.proto +++ b/grpc/pb/bdware/bdledger/api/query.proto @@ -8,12 +8,42 @@ option go_package = "bdware.org/bdledger/api/grpc/pb"; option java_package = "org.bdware.bdledger.api.grpc.pb"; service Query { + /** + * Get a block identified by its hash + * 查询哈希所指定的区块 + */ rpc GetBlockByHash (GetBlockByHashRequest) returns (GetBlockByHashResponse); - rpc GetBlocks (BlocksRequest) returns (GetBlocksResponse); // start_timestamp is required + /** + * Get blocks in a timestamp range + * 查询时间范围内的区块 + * start_timestamp is required + */ + rpc GetBlocks (BlocksRequest) returns (GetBlocksResponse); + /** + * Count all blocks in a ledger, or blocks in a timestamp range + * 查询帐本中的所有区块数量,或时间范围内的区块数量 + */ rpc CountBlocks (BlocksRequest) returns (CountBlocksResponse); + /** + * Get a transaction identified by its hash + * 查询哈希所指定的事务 + */ rpc GetTransactionByHash (GetTransactionByHashRequest) returns (GetTransactionByHashResponse); + /** + * Get a transaction identified by hash of the block it belongs to and its index inside the block + * 查询所在区块的哈希与其在区块中的index所指定的事务 + */ rpc GetTransactionByBlockHashAndIndex (GetTransactionByBlockHashAndIndexRequest) returns (GetTransactionByBlockHashAndIndexResponse); + /** + * Get transactions in a timestamp range + * 查询时间范围内的事务 + */ rpc GetTransactions (TransactionsRequest) returns (GetTransactionsResponse); + /** + * Count all transactions in a ledger, or transactions in a timestamp range + * 查询帐本中的所有事务数量,或时间范围内的事务数量 + * start_timestamp is required + */ rpc CountTransactions (TransactionsRequest) returns (CountTransactionsResponse); }