docs: update

This commit is contained in:
Nex Zhu
2021-07-20 09:36:57 +08:00
parent 9d77f65495
commit 345adce56e
9 changed files with 444 additions and 224 deletions

View File

@@ -83,7 +83,7 @@
| transaction_count | [uint32](#uint32) | | 区块包含的事务数量 |
| transactions_root | [bytes](#bytes) | | 区块的事务默克尔树根 |
| transactions | [Transaction](#bdware.bdledger.api.Transaction) | repeated | 事务对象的数组,或为空 |
| transaction_hashes | [bytes](#bytes) | repeated | 20字节的交易哈希的数组,或为空 |
| transaction_hashes | [bytes](#bytes) | repeated | 20字节的事务哈希的数组,或为空 |
@@ -247,7 +247,7 @@ A message type used to describe a single invalid field.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| name | [string](#string) | | |
| name | [string](#string) | | 账本名称 |
@@ -262,7 +262,7 @@ A message type used to describe a single invalid field.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| ok | [bool](#bool) | | |
| ok | [bool](#bool) | | 是否创建成功 |
@@ -277,7 +277,7 @@ A message type used to describe a single invalid field.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| ledgers | [string](#string) | repeated | |
| ledgers | [string](#string) | repeated | 帐本名称列表 |
@@ -292,8 +292,8 @@ A message type used to describe a single invalid field.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| ledger | [string](#string) | | |
| transaction | [SendTransactionRequest.Transaction](#bdware.bdledger.api.SendTransactionRequest.Transaction) | | |
| ledger | [string](#string) | | 账本名称 |
| transaction | [SendTransactionRequest.Transaction](#bdware.bdledger.api.SendTransactionRequest.Transaction) | | 事务信息 |
@@ -308,11 +308,11 @@ A message type used to describe a single invalid field.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| type | [TransactionType](#bdware.bdledger.api.TransactionType) | | |
| from | [bytes](#bytes) | | |
| nonce | [uint64](#uint64) | | |
| to | [bytes](#bytes) | | |
| data | [bytes](#bytes) | | |
| type | [TransactionType](#bdware.bdledger.api.TransactionType) | | 事务类型目前仅支持通用数据记录即type为RECORD (0) |
| from | [bytes](#bytes) | | 任意20字节的地址用于区分使用同一节点的事务发起者 |
| nonce | [uint64](#uint64) | | 正整数同一from每个nonce应只使用一次防止重复的事务可以每次发送事务+1 |
| to | [bytes](#bytes) | | 对于通用数据记录不需传递,无意义 |
| data | [bytes](#bytes) | | 事务数据内容,字节数组 |
@@ -327,7 +327,7 @@ A message type used to describe a single invalid field.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| hash | [bytes](#bytes) | | |
| hash | [bytes](#bytes) | | 事务哈希 |
@@ -406,7 +406,7 @@ A message type used to describe a single invalid field.
<a name="bdware.bdledger.api.BlockFilter"></a>
### BlockFilter
暂不支持
| Field | Type | Label | Description |
@@ -427,11 +427,11 @@ A message type used to describe a single invalid field.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| ledger | [string](#string) | | |
| start_timestamp | [int64](#int64) | | |
| end_timestamp | [int64](#int64) | | |
| filters | [BlockFilter](#bdware.bdledger.api.BlockFilter) | repeated | |
| include_transactions | [IncludeTransactions](#bdware.bdledger.api.IncludeTransactions) | | |
| ledger | [string](#string) | | 账本名称 |
| start_timestamp | [int64](#int64) | | 查询范围开始时间戳 |
| end_timestamp | [int64](#int64) | | 查询范围结束时间戳 |
| filters | [BlockFilter](#bdware.bdledger.api.BlockFilter) | repeated | 暂不支持 |
| include_transactions | [IncludeTransactions](#bdware.bdledger.api.IncludeTransactions) | | 包含事务信息详细程度 |
@@ -446,9 +446,9 @@ A message type used to describe a single invalid field.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| count | [uint64](#uint64) | | |
| start_timestamp | [int64](#int64) | | |
| end_timestamp | [int64](#int64) | | |
| count | [uint64](#uint64) | | 区块数量 |
| start_timestamp | [int64](#int64) | | 本次查询有效的查询范围开始时间戳 |
| end_timestamp | [int64](#int64) | | 本次查询有效的查询范围结束时间戳 |
@@ -463,9 +463,9 @@ A message type used to describe a single invalid field.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| count | [uint64](#uint64) | | |
| start_timestamp | [int64](#int64) | | |
| end_timestamp | [int64](#int64) | | |
| count | [uint64](#uint64) | | 事务数量 |
| start_timestamp | [int64](#int64) | | 本次查询有效的查询范围开始时间戳 |
| end_timestamp | [int64](#int64) | | 本次查询有效的查询范围结束时间戳 |
@@ -480,9 +480,9 @@ A message type used to describe a single invalid field.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| ledger | [string](#string) | | |
| hash | [bytes](#bytes) | | |
| full_transactions | [bool](#bool) | | |
| ledger | [string](#string) | | 账本名称 |
| hash | [bytes](#bytes) | | 区块哈希 |
| full_transactions | [bool](#bool) | | 是否返回完整事务列表,而不是事务哈希列表 |
@@ -497,7 +497,7 @@ A message type used to describe a single invalid field.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| block | [Block](#bdware.bdledger.api.Block) | | |
| block | [Block](#bdware.bdledger.api.Block) | | 区块信息 |
@@ -512,9 +512,9 @@ A message type used to describe a single invalid field.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| blocks | [Block](#bdware.bdledger.api.Block) | repeated | |
| start_timestamp | [int64](#int64) | | |
| end_timestamp | [int64](#int64) | | |
| blocks | [Block](#bdware.bdledger.api.Block) | repeated | 区块列表 |
| start_timestamp | [int64](#int64) | | 本次查询有效的查询范围开始时间戳 |
| end_timestamp | [int64](#int64) | | 本次查询有效的查询范围结束时间戳 |
@@ -529,9 +529,9 @@ A message type used to describe a single invalid field.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| ledger | [string](#string) | | |
| block_hash | [bytes](#bytes) | | |
| index | [uint32](#uint32) | | |
| ledger | [string](#string) | | 账本名称 |
| block_hash | [bytes](#bytes) | | 事务所属区块哈希 |
| index | [uint32](#uint32) | | 事务在区块中的位置 |
@@ -546,7 +546,7 @@ A message type used to describe a single invalid field.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| transaction | [Transaction](#bdware.bdledger.api.Transaction) | | |
| transaction | [Transaction](#bdware.bdledger.api.Transaction) | | 事务信息 |
@@ -561,8 +561,8 @@ A message type used to describe a single invalid field.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| ledger | [string](#string) | | |
| hash | [bytes](#bytes) | | |
| ledger | [string](#string) | | 账本名称 |
| hash | [bytes](#bytes) | | 事务哈希 |
@@ -577,7 +577,7 @@ A message type used to describe a single invalid field.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| transaction | [Transaction](#bdware.bdledger.api.Transaction) | | |
| transaction | [Transaction](#bdware.bdledger.api.Transaction) | | 事务信息 |
@@ -592,9 +592,9 @@ A message type used to describe a single invalid field.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| transactions | [Transaction](#bdware.bdledger.api.Transaction) | repeated | |
| start_timestamp | [int64](#int64) | | |
| end_timestamp | [int64](#int64) | | |
| transactions | [Transaction](#bdware.bdledger.api.Transaction) | repeated | 事务列表 |
| start_timestamp | [int64](#int64) | | 本次查询有效的查询范围开始时间戳 |
| end_timestamp | [int64](#int64) | | 本次查询有效的查询范围结束时间戳 |
@@ -609,9 +609,9 @@ A message type used to describe a single invalid field.
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| ledger | [string](#string) | | |
| count | [int64](#int64) | | |
| include_transactions | [IncludeTransactions](#bdware.bdledger.api.IncludeTransactions) | | |
| ledger | [string](#string) | | 账本名称 |
| count | [int64](#int64) | | 查询区块数量 |
| include_transactions | [IncludeTransactions](#bdware.bdledger.api.IncludeTransactions) | | 包含事务信息详细程度 |
@@ -644,10 +644,10 @@ repeated Transaction/BlockFilters are combined by &#34;&amp;&amp;&#34;(and) oper
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| ledger | [string](#string) | | |
| start_timestamp | [int64](#int64) | | required |
| end_timestamp | [int64](#int64) | | |
| filters | [TransactionFilter](#bdware.bdledger.api.TransactionFilter) | repeated | |
| ledger | [string](#string) | | 账本名称 |
| start_timestamp | [int64](#int64) | | 查询范围开始时间戳 |
| end_timestamp | [int64](#int64) | | 查询范围结束时间戳 |
| filters | [TransactionFilter](#bdware.bdledger.api.TransactionFilter) | repeated | 暂不支持 |
@@ -659,13 +659,13 @@ repeated Transaction/BlockFilters are combined by &#34;&amp;&amp;&#34;(and) oper
<a name="bdware.bdledger.api.IncludeTransactions"></a>
### IncludeTransactions
包含事务信息详细程度
| Name | Number | Description |
| ---- | ------ | ----------- |
| NONE | 0 | 不包含交易数据 |
| HASH | 1 | 包含交易哈希列表 |
| FULL | 2 | 包含完整交易列表 |
| NONE | 0 | 不包含事务数据 |
| HASH | 1 | 包含事务哈希列表 |
| FULL | 2 | 包含完整事务列表 |
@@ -681,13 +681,13 @@ repeated Transaction/BlockFilters are combined by &#34;&amp;&amp;&#34;(and) oper
| 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 查询帐本中的所有区块数量,或时间范围内的区块数量 |
| GetRecentBlocks | [RecentBlocksRequest](#bdware.bdledger.api.RecentBlocksRequest) | [GetBlocksResponse](#bdware.bdledger.api.GetBlocksResponse) | Get recent &#39;count&#39; blocks (Only support IncludeTransactions=NONE for now) 查询最新的n个区块 |
| GetBlocks | [BlocksRequest](#bdware.bdledger.api.BlocksRequest) | [GetBlocksResponse](#bdware.bdledger.api.GetBlocksResponse) | Get blocks in a timestamp range 查询时间范围内的区块 Requirement: start_timestamp &lt;= end_timestamp If neither &#39;start_timestamp&#39; nor &#39;end_timestamp&#39; is specified, then &#39;start_timestamp&#39; will be set to the genesis block&#39;s timestamp, and &#39;end_timestamp&#39; will be set to (start_timestamp &#43; query.maxDuration) (query.maxDuration is specified in go-bdledger&#39;s config file). If only &#39;end_timestamp&#39; is not specified, or (end_timestamp - start_timestamp &gt; query.maxDuration), then &#39;end_timestamp&#39; will be set to (start_timestamp &#43; query.maxDuration). If only &#39;start_timestamp&#39; is not specified, then &#39;start_timestamp&#39; will be set to (end_timestamp - query.maxDuration). In all cases, &#39;start_timestamp&#39; will never be earlier than the genesis block&#39;s timestamp, and &#39;end_timestamp&#39; will never be later than the current timestamp when the node process the query request. |
| CountBlocks | [BlocksRequest](#bdware.bdledger.api.BlocksRequest) | [CountBlocksResponse](#bdware.bdledger.api.CountBlocksResponse) | Count all blocks in a ledger, or blocks in a timestamp range 查询帐本中的所有区块数量,或时间范围内的区块数量 Requirement: start_timestamp &lt;= end_timestamp If neither &#39;start_timestamp&#39; nor &#39;end_timestamp&#39; is specified, then count all blocks in the specified ledger. If only &#39;end_timestamp&#39; is not specified, then count all blocks with timestamps later than &#39;start_timestamp&#39;. If only &#39;start_timestamp&#39; is not specified, then count all blocks with timestamps earlier than &#39;end_timestamp&#39;. In all cases, &#39;start_timestamp&#39; will never be earlier than the genesis block&#39;s timestamp, and &#39;end_timestamp&#39; will never be later than the current timestamp when the node process the query request. |
| GetRecentBlocks | [RecentBlocksRequest](#bdware.bdledger.api.RecentBlocksRequest) | [GetBlocksResponse](#bdware.bdledger.api.GetBlocksResponse) | Get recent &#39;count&#39; blocks (Only support IncludeTransactions=NONE for now) 查询最新的 &#39;count&#39; 个区块 |
| 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 |
| GetTransactions | [TransactionsRequest](#bdware.bdledger.api.TransactionsRequest) | [GetTransactionsResponse](#bdware.bdledger.api.GetTransactionsResponse) | Get transactions in a timestamp range 查询时间范围内的事务 &#39;start_timestamp&#39; and &#39;end_timestamp&#39; follow the same requirements and rules as in &#39;GetBlocks&#39;. |
| CountTransactions | [TransactionsRequest](#bdware.bdledger.api.TransactionsRequest) | [CountTransactionsResponse](#bdware.bdledger.api.CountTransactionsResponse) | Count all transactions in a ledger, or transactions in a timestamp range 查询帐本中的所有事务数量,或时间范围内的事务数量 &#39;start_timestamp&#39; and &#39;end_timestamp&#39; follow the same requirements and rules as in &#39;CountBlocks&#39;. |