From c331546099c10b66e130a44494c5a2a844e1e0c1 Mon Sep 17 00:00:00 2001
From: Nex 事务所在的区块的哈希,当事务处于待确认状态时为`null` 事务所在的区块产生时的 UNIX 时间戳,单位为秒
+
+
+
block_timestamp
+ int64
+
+
+
+ index
uint32
@@ -967,6 +978,13 @@ field. E.g., "field_violations.field" would identify this field.
+
+
nonce
+ uint64
+
+
+
@@ -1534,6 +1552,44 @@ field. E.g., "field_violations.field" would identify this field. to
bytes
@@ -1191,7 +1209,7 @@ field. E.g., "field_violations.field" would identify this field.
include_transactions
- BlocksRequest.IncludeTransactions
+ IncludeTransactions
Field | Type | Label | Description |
ledger | +string | ++ |
|
+
count | +int64 | ++ |
|
+
include_transactions | +IncludeTransactions | ++ |
|
+
repeated Transaction/BlockFilters are combined by "&&"(and) operator;
@@ -1626,7 +1682,7 @@ field. E.g., "field_violations.field" would identify this field. BlocksRequest.IncludeTransactions +GetRecentBlocks | +RecentBlocksRequest | +GetBlocksResponse | +Get recent 'count' blocks (Only support IncludeTransactions=NONE for now) +查询最新的n个区块 |
+
GetTransactionByHash | GetTransactionByHashRequest | diff --git a/docs/apis.json b/docs/apis.json index 6b021f6..50518f4 100644 --- a/docs/apis.json +++ b/docs/apis.json @@ -329,6 +329,16 @@ "ismap": false, "defaultValue": "" }, + { + "name": "block_timestamp", + "description": "事务所在的区块产生时的 UNIX 时间戳,单位为秒", + "label": "", + "type": "int64", + "longType": "int64", + "fullType": "int64", + "ismap": false, + "defaultValue": "" + }, { "name": "index", "description": "事务在区块中的位置 index,当事务处于待确认状态时为`null`", @@ -634,6 +644,16 @@ "ismap": false, "defaultValue": "" }, + { + "name": "nonce", + "description": "", + "label": "", + "type": "uint64", + "longType": "uint64", + "fullType": "uint64", + "ismap": false, + "defaultValue": "" + }, { "name": "to", "description": "", @@ -785,15 +805,15 @@ "name": "bdware/bdledger/api/query.proto", "description": "", "package": "bdware.bdledger.api", - "hasEnums": false, + "hasEnums": true, "hasExtensions": false, "hasMessages": true, "hasServices": true, "enums": [ { "name": "IncludeTransactions", - "longName": "BlocksRequest.IncludeTransactions", - "fullName": "bdware.bdledger.api.BlocksRequest.IncludeTransactions", + "longName": "IncludeTransactions", + "fullName": "bdware.bdledger.api.IncludeTransactions", "description": "", "values": [ { @@ -901,8 +921,8 @@ "description": "", "label": "", "type": "IncludeTransactions", - "longType": "BlocksRequest.IncludeTransactions", - "fullType": "bdware.bdledger.api.BlocksRequest.IncludeTransactions", + "longType": "IncludeTransactions", + "fullType": "bdware.bdledger.api.IncludeTransactions", "ismap": false, "defaultValue": "" } @@ -1248,6 +1268,47 @@ } ] }, + { + "name": "RecentBlocksRequest", + "longName": "RecentBlocksRequest", + "fullName": "bdware.bdledger.api.RecentBlocksRequest", + "description": "", + "hasExtensions": false, + "hasFields": true, + "extensions": [], + "fields": [ + { + "name": "ledger", + "description": "", + "label": "", + "type": "string", + "longType": "string", + "fullType": "string", + "ismap": false, + "defaultValue": "" + }, + { + "name": "count", + "description": "", + "label": "", + "type": "int64", + "longType": "int64", + "fullType": "int64", + "ismap": false, + "defaultValue": "" + }, + { + "name": "include_transactions", + "description": "", + "label": "", + "type": "IncludeTransactions", + "longType": "IncludeTransactions", + "fullType": "bdware.bdledger.api.IncludeTransactions", + "ismap": false, + "defaultValue": "" + } + ] + }, { "name": "TransactionFilter", "longName": "TransactionFilter", @@ -1394,6 +1455,18 @@ "responseFullType": "bdware.bdledger.api.CountBlocksResponse", "responseStreaming": false }, + { + "name": "GetRecentBlocks", + "description": "Get recent 'count' blocks (Only support IncludeTransactions=NONE for now)\n查询最新的n个区块", + "requestType": "RecentBlocksRequest", + "requestLongType": "RecentBlocksRequest", + "requestFullType": "bdware.bdledger.api.RecentBlocksRequest", + "requestStreaming": false, + "responseType": "GetBlocksResponse", + "responseLongType": "GetBlocksResponse", + "responseFullType": "bdware.bdledger.api.GetBlocksResponse", + "responseStreaming": false + }, { "name": "GetTransactionByHash", "description": "Get a transaction identified by its hash\n查询哈希所指定的事务", diff --git a/docs/apis.md b/docs/apis.md index a3ccdf3..8933005 100644 --- a/docs/apis.md +++ b/docs/apis.md @@ -56,10 +56,11 @@ - [GetTransactionByHashRequest](#bdware.bdledger.api.GetTransactionByHashRequest) - [GetTransactionByHashResponse](#bdware.bdledger.api.GetTransactionByHashResponse) - [GetTransactionsResponse](#bdware.bdledger.api.GetTransactionsResponse) + - [RecentBlocksRequest](#bdware.bdledger.api.RecentBlocksRequest) - [TransactionFilter](#bdware.bdledger.api.TransactionFilter) - [TransactionsRequest](#bdware.bdledger.api.TransactionsRequest) - - [BlocksRequest.IncludeTransactions](#bdware.bdledger.api.BlocksRequest.IncludeTransactions) + - [IncludeTransactions](#bdware.bdledger.api.IncludeTransactions) - [Query](#bdware.bdledger.api.Query) @@ -138,6 +139,7 @@ | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | block_hash | [bytes](#bytes) | | 事务所在的区块的哈希,当事务处于待确认状态时为`null` | +| block_timestamp | [int64](#int64) | | 事务所在的区块产生时的 UNIX 时间戳,单位为秒 | | index | [uint32](#uint32) | | 事务在区块中的位置 index,当事务处于待确认状态时为`null` | | hash | [bytes](#bytes) | | 事务的哈希 | | type | [TransactionType](#bdware.bdledger.api.TransactionType) | | 事务类型 | @@ -327,6 +329,7 @@ A message type used to describe a single invalid field. | ----- | ---- | ----- | ----------- | | type | [TransactionType](#bdware.bdledger.api.TransactionType) | | | | from | [bytes](#bytes) | | | +| nonce | [uint64](#uint64) | | | | to | [bytes](#bytes) | | | | data | [bytes](#bytes) | | | @@ -447,7 +450,7 @@ A message type used to describe a single invalid field. | start_timestamp | [int64](#int64) | | | | end_timestamp | [int64](#int64) | | | | filters | [BlockFilter](#bdware.bdledger.api.BlockFilter) | repeated | | -| include_transactions | [BlocksRequest.IncludeTransactions](#bdware.bdledger.api.BlocksRequest.IncludeTransactions) | | | +| include_transactions | [IncludeTransactions](#bdware.bdledger.api.IncludeTransactions) | | | @@ -617,6 +620,23 @@ A message type used to describe a single invalid field. + + +### RecentBlocksRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| ledger | [string](#string) | | | +| count | [int64](#int64) | | | +| include_transactions | [IncludeTransactions](#bdware.bdledger.api.IncludeTransactions) | | | + + + + + + ### TransactionFilter @@ -655,9 +675,9 @@ repeated Transaction/BlockFilters are combined by "&&"(and) oper - + -### BlocksRequest.IncludeTransactions +### IncludeTransactions | Name | Number | Description | @@ -682,6 +702,7 @@ repeated Transaction/BlockFilters are combined by "&&"(and) oper | 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 查询帐本中的所有区块数量,或时间范围内的区块数量 | +| GetRecentBlocks | [RecentBlocksRequest](#bdware.bdledger.api.RecentBlocksRequest) | [GetBlocksResponse](#bdware.bdledger.api.GetBlocksResponse) | Get recent 'count' blocks (Only support IncludeTransactions=NONE for now) 查询最新的n个区块 | | 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 查询时间范围内的事务 |