docs: update

This commit is contained in:
Nex Zhu 2021-07-20 09:36:57 +08:00
parent 9d77f65495
commit 345adce56e
No known key found for this signature in database
GPG Key ID: 15C6254AD19362B4
9 changed files with 444 additions and 224 deletions

View File

@ -471,7 +471,7 @@
<td>transaction_hashes</td>
<td><a href="#bytes">bytes</a></td>
<td>repeated</td>
<td><p>20字节的交易哈希的数组,或为空 </p></td>
<td><p>20字节的事务哈希的数组,或为空 </p></td>
</tr>
</tbody>
@ -865,7 +865,7 @@ field. E.g., &#34;field_violations.field&#34; would identify this field. </p></t
<td>name</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p> </p></td>
<td><p>账本名称 </p></td>
</tr>
</tbody>
@ -889,7 +889,7 @@ field. E.g., &#34;field_violations.field&#34; would identify this field. </p></t
<td>ok</td>
<td><a href="#bool">bool</a></td>
<td></td>
<td><p> </p></td>
<td><p>是否创建成功 </p></td>
</tr>
</tbody>
@ -913,7 +913,7 @@ field. E.g., &#34;field_violations.field&#34; would identify this field. </p></t
<td>ledgers</td>
<td><a href="#string">string</a></td>
<td>repeated</td>
<td><p> </p></td>
<td><p>帐本名称列表 </p></td>
</tr>
</tbody>
@ -937,14 +937,14 @@ field. E.g., &#34;field_violations.field&#34; would identify this field. </p></t
<td>ledger</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p> </p></td>
<td><p>账本名称 </p></td>
</tr>
<tr>
<td>transaction</td>
<td><a href="#bdware.bdledger.api.SendTransactionRequest.Transaction">SendTransactionRequest.Transaction</a></td>
<td></td>
<td><p> </p></td>
<td><p>事务信息 </p></td>
</tr>
</tbody>
@ -968,35 +968,35 @@ field. E.g., &#34;field_violations.field&#34; would identify this field. </p></t
<td>type</td>
<td><a href="#bdware.bdledger.api.TransactionType">TransactionType</a></td>
<td></td>
<td><p> </p></td>
<td><p>事务类型目前仅支持通用数据记录即type为RECORD (0) </p></td>
</tr>
<tr>
<td>from</td>
<td><a href="#bytes">bytes</a></td>
<td></td>
<td><p> </p></td>
<td><p>任意20字节的地址用于区分使用同一节点的事务发起者 </p></td>
</tr>
<tr>
<td>nonce</td>
<td><a href="#uint64">uint64</a></td>
<td></td>
<td><p> </p></td>
<td><p>正整数同一from每个nonce应只使用一次防止重复的事务可以每次发送事务&#43;1 </p></td>
</tr>
<tr>
<td>to</td>
<td><a href="#bytes">bytes</a></td>
<td></td>
<td><p> </p></td>
<td><p>对于通用数据记录不需传递,无意义 </p></td>
</tr>
<tr>
<td>data</td>
<td><a href="#bytes">bytes</a></td>
<td></td>
<td><p> </p></td>
<td><p>事务数据内容,字节数组 </p></td>
</tr>
</tbody>
@ -1020,7 +1020,7 @@ field. E.g., &#34;field_violations.field&#34; would identify this field. </p></t
<td>hash</td>
<td><a href="#bytes">bytes</a></td>
<td></td>
<td><p> </p></td>
<td><p>事务哈希 </p></td>
</tr>
</tbody>
@ -1139,7 +1139,7 @@ field. E.g., &#34;field_violations.field&#34; would identify this field. </p></t
<h3 id="bdware.bdledger.api.BlockFilter">BlockFilter</h3>
<p></p>
<p>暂不支持</p>
<table class="field-table">
@ -1183,35 +1183,35 @@ field. E.g., &#34;field_violations.field&#34; would identify this field. </p></t
<td>ledger</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p> </p></td>
<td><p>账本名称 </p></td>
</tr>
<tr>
<td>start_timestamp</td>
<td><a href="#int64">int64</a></td>
<td></td>
<td><p> </p></td>
<td><p>查询范围开始时间戳 </p></td>
</tr>
<tr>
<td>end_timestamp</td>
<td><a href="#int64">int64</a></td>
<td></td>
<td><p> </p></td>
<td><p>查询范围结束时间戳 </p></td>
</tr>
<tr>
<td>filters</td>
<td><a href="#bdware.bdledger.api.BlockFilter">BlockFilter</a></td>
<td>repeated</td>
<td><p> </p></td>
<td><p>暂不支持 </p></td>
</tr>
<tr>
<td>include_transactions</td>
<td><a href="#bdware.bdledger.api.IncludeTransactions">IncludeTransactions</a></td>
<td></td>
<td><p> </p></td>
<td><p>包含事务信息详细程度 </p></td>
</tr>
</tbody>
@ -1235,21 +1235,21 @@ field. E.g., &#34;field_violations.field&#34; would identify this field. </p></t
<td>count</td>
<td><a href="#uint64">uint64</a></td>
<td></td>
<td><p> </p></td>
<td><p>区块数量 </p></td>
</tr>
<tr>
<td>start_timestamp</td>
<td><a href="#int64">int64</a></td>
<td></td>
<td><p> </p></td>
<td><p>本次查询有效的查询范围开始时间戳 </p></td>
</tr>
<tr>
<td>end_timestamp</td>
<td><a href="#int64">int64</a></td>
<td></td>
<td><p> </p></td>
<td><p>本次查询有效的查询范围结束时间戳 </p></td>
</tr>
</tbody>
@ -1273,21 +1273,21 @@ field. E.g., &#34;field_violations.field&#34; would identify this field. </p></t
<td>count</td>
<td><a href="#uint64">uint64</a></td>
<td></td>
<td><p> </p></td>
<td><p>事务数量 </p></td>
</tr>
<tr>
<td>start_timestamp</td>
<td><a href="#int64">int64</a></td>
<td></td>
<td><p> </p></td>
<td><p>本次查询有效的查询范围开始时间戳 </p></td>
</tr>
<tr>
<td>end_timestamp</td>
<td><a href="#int64">int64</a></td>
<td></td>
<td><p> </p></td>
<td><p>本次查询有效的查询范围结束时间戳 </p></td>
</tr>
</tbody>
@ -1311,21 +1311,21 @@ field. E.g., &#34;field_violations.field&#34; would identify this field. </p></t
<td>ledger</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p> </p></td>
<td><p>账本名称 </p></td>
</tr>
<tr>
<td>hash</td>
<td><a href="#bytes">bytes</a></td>
<td></td>
<td><p> </p></td>
<td><p>区块哈希 </p></td>
</tr>
<tr>
<td>full_transactions</td>
<td><a href="#bool">bool</a></td>
<td></td>
<td><p> </p></td>
<td><p>是否返回完整事务列表,而不是事务哈希列表 </p></td>
</tr>
</tbody>
@ -1349,7 +1349,7 @@ field. E.g., &#34;field_violations.field&#34; would identify this field. </p></t
<td>block</td>
<td><a href="#bdware.bdledger.api.Block">Block</a></td>
<td></td>
<td><p> </p></td>
<td><p>区块信息 </p></td>
</tr>
</tbody>
@ -1373,21 +1373,21 @@ field. E.g., &#34;field_violations.field&#34; would identify this field. </p></t
<td>blocks</td>
<td><a href="#bdware.bdledger.api.Block">Block</a></td>
<td>repeated</td>
<td><p> </p></td>
<td><p>区块列表 </p></td>
</tr>
<tr>
<td>start_timestamp</td>
<td><a href="#int64">int64</a></td>
<td></td>
<td><p> </p></td>
<td><p>本次查询有效的查询范围开始时间戳 </p></td>
</tr>
<tr>
<td>end_timestamp</td>
<td><a href="#int64">int64</a></td>
<td></td>
<td><p> </p></td>
<td><p>本次查询有效的查询范围结束时间戳 </p></td>
</tr>
</tbody>
@ -1411,21 +1411,21 @@ field. E.g., &#34;field_violations.field&#34; would identify this field. </p></t
<td>ledger</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p> </p></td>
<td><p>账本名称 </p></td>
</tr>
<tr>
<td>block_hash</td>
<td><a href="#bytes">bytes</a></td>
<td></td>
<td><p> </p></td>
<td><p>事务所属区块哈希 </p></td>
</tr>
<tr>
<td>index</td>
<td><a href="#uint32">uint32</a></td>
<td></td>
<td><p> </p></td>
<td><p>事务在区块中的位置 </p></td>
</tr>
</tbody>
@ -1449,7 +1449,7 @@ field. E.g., &#34;field_violations.field&#34; would identify this field. </p></t
<td>transaction</td>
<td><a href="#bdware.bdledger.api.Transaction">Transaction</a></td>
<td></td>
<td><p> </p></td>
<td><p>事务信息 </p></td>
</tr>
</tbody>
@ -1473,14 +1473,14 @@ field. E.g., &#34;field_violations.field&#34; would identify this field. </p></t
<td>ledger</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p> </p></td>
<td><p>账本名称 </p></td>
</tr>
<tr>
<td>hash</td>
<td><a href="#bytes">bytes</a></td>
<td></td>
<td><p> </p></td>
<td><p>事务哈希 </p></td>
</tr>
</tbody>
@ -1504,7 +1504,7 @@ field. E.g., &#34;field_violations.field&#34; would identify this field. </p></t
<td>transaction</td>
<td><a href="#bdware.bdledger.api.Transaction">Transaction</a></td>
<td></td>
<td><p> </p></td>
<td><p>事务信息 </p></td>
</tr>
</tbody>
@ -1528,21 +1528,21 @@ field. E.g., &#34;field_violations.field&#34; would identify this field. </p></t
<td>transactions</td>
<td><a href="#bdware.bdledger.api.Transaction">Transaction</a></td>
<td>repeated</td>
<td><p> </p></td>
<td><p>事务列表 </p></td>
</tr>
<tr>
<td>start_timestamp</td>
<td><a href="#int64">int64</a></td>
<td></td>
<td><p> </p></td>
<td><p>本次查询有效的查询范围开始时间戳 </p></td>
</tr>
<tr>
<td>end_timestamp</td>
<td><a href="#int64">int64</a></td>
<td></td>
<td><p> </p></td>
<td><p>本次查询有效的查询范围结束时间戳 </p></td>
</tr>
</tbody>
@ -1566,21 +1566,21 @@ field. E.g., &#34;field_violations.field&#34; would identify this field. </p></t
<td>ledger</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p> </p></td>
<td><p>账本名称 </p></td>
</tr>
<tr>
<td>count</td>
<td><a href="#int64">int64</a></td>
<td></td>
<td><p> </p></td>
<td><p>查询区块数量 </p></td>
</tr>
<tr>
<td>include_transactions</td>
<td><a href="#bdware.bdledger.api.IncludeTransactions">IncludeTransactions</a></td>
<td></td>
<td><p> </p></td>
<td><p>包含事务信息详细程度 </p></td>
</tr>
</tbody>
@ -1649,28 +1649,28 @@ field. E.g., &#34;field_violations.field&#34; would identify this field. </p></t
<td>ledger</td>
<td><a href="#string">string</a></td>
<td></td>
<td><p> </p></td>
<td><p>账本名称 </p></td>
</tr>
<tr>
<td>start_timestamp</td>
<td><a href="#int64">int64</a></td>
<td></td>
<td><p>required </p></td>
<td><p>查询范围开始时间戳 </p></td>
</tr>
<tr>
<td>end_timestamp</td>
<td><a href="#int64">int64</a></td>
<td></td>
<td><p> </p></td>
<td><p>查询范围结束时间戳 </p></td>
</tr>
<tr>
<td>filters</td>
<td><a href="#bdware.bdledger.api.TransactionFilter">TransactionFilter</a></td>
<td>repeated</td>
<td><p> </p></td>
<td><p>暂不支持 </p></td>
</tr>
</tbody>
@ -1683,7 +1683,7 @@ field. E.g., &#34;field_violations.field&#34; would identify this field. </p></t
<h3 id="bdware.bdledger.api.IncludeTransactions">IncludeTransactions</h3>
<p></p>
<p>包含事务信息详细程度</p>
<table class="enum-table">
<thead>
<tr><td>Name</td><td>Number</td><td>Description</td></tr>
@ -1693,19 +1693,19 @@ field. E.g., &#34;field_violations.field&#34; would identify this field. </p></t
<tr>
<td>NONE</td>
<td>0</td>
<td><p>不包含交易数据</p></td>
<td><p>不包含事务数据</p></td>
</tr>
<tr>
<td>HASH</td>
<td>1</td>
<td><p>包含交易哈希列表</p></td>
<td><p>包含事务哈希列表</p></td>
</tr>
<tr>
<td>FULL</td>
<td>2</td>
<td><p>包含完整交易列表</p></td>
<td><p>包含完整事务列表</p></td>
</tr>
</tbody>
@ -1737,7 +1737,15 @@ field. E.g., &#34;field_violations.field&#34; would identify this field. </p></t
<td><a href="#bdware.bdledger.api.GetBlocksResponse">GetBlocksResponse</a></td>
<td><p>Get blocks in a timestamp range
查询时间范围内的区块
start_timestamp is required</p></td>
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.</p></td>
</tr>
<tr>
@ -1745,7 +1753,13 @@ start_timestamp is required</p></td>
<td><a href="#bdware.bdledger.api.BlocksRequest">BlocksRequest</a></td>
<td><a href="#bdware.bdledger.api.CountBlocksResponse">CountBlocksResponse</a></td>
<td><p>Count all blocks in a ledger, or blocks in a timestamp range
查询帐本中的所有区块数量,或时间范围内的区块数量</p></td>
查询帐本中的所有区块数量,或时间范围内的区块数量
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.</p></td>
</tr>
<tr>
@ -1753,7 +1767,7 @@ start_timestamp is required</p></td>
<td><a href="#bdware.bdledger.api.RecentBlocksRequest">RecentBlocksRequest</a></td>
<td><a href="#bdware.bdledger.api.GetBlocksResponse">GetBlocksResponse</a></td>
<td><p>Get recent &#39;count&#39; blocks (Only support IncludeTransactions=NONE for now)
查询最新的n个区块</p></td>
查询最新的 &#39;count&#39; 个区块</p></td>
</tr>
<tr>
@ -1777,7 +1791,8 @@ start_timestamp is required</p></td>
<td><a href="#bdware.bdledger.api.TransactionsRequest">TransactionsRequest</a></td>
<td><a href="#bdware.bdledger.api.GetTransactionsResponse">GetTransactionsResponse</a></td>
<td><p>Get transactions in a timestamp range
查询时间范围内的事务</p></td>
查询时间范围内的事务
&#39;start_timestamp&#39; and &#39;end_timestamp&#39; follow the same requirements and rules as in &#39;GetBlocks&#39;.</p></td>
</tr>
<tr>
@ -1786,7 +1801,7 @@ start_timestamp is required</p></td>
<td><a href="#bdware.bdledger.api.CountTransactionsResponse">CountTransactionsResponse</a></td>
<td><p>Count all transactions in a ledger, or transactions in a timestamp range
查询帐本中的所有事务数量,或时间范围内的事务数量
start_timestamp is required</p></td>
&#39;start_timestamp&#39; and &#39;end_timestamp&#39; follow the same requirements and rules as in &#39;CountBlocks&#39;.</p></td>
</tr>
</tbody>

File diff suppressed because it is too large Load Diff

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应只使用一次防止重复的事务可以每次发送事务&#43;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;. |

View File

@ -96,4 +96,3 @@ Install Go then run:
go get -u github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc
./scripts/gen [-a, --async] docs
```

View File

@ -41,7 +41,7 @@ message Block {
uint32 transaction_count = 8; //
bytes transactions_root = 9; //
repeated Transaction transactions = 10; //
repeated bytes transaction_hashes = 11; // 20
repeated bytes transaction_hashes = 11; // 20
}
message Contract {

View File

@ -28,27 +28,27 @@ service Ledger {
}
message CreateLedgerRequest {
string name = 1;
string name = 1; //
}
message CreateLedgerResponse {
bool ok = 1;
bool ok = 1; //
}
message GetLedgersResponse {
repeated string ledgers = 1;
repeated string ledgers = 1; //
}
message SendTransactionRequest {
string ledger = 1;
string ledger = 1; //
message Transaction {
TransactionType type = 1;
bytes from = 2;
uint64 nonce = 3;
bytes to = 4;
bytes data = 5;
TransactionType type = 1; // type为RECORD (0)
bytes from = 2; // 20使
uint64 nonce = 3; // from每个nonce应只使用一次+1
bytes to = 4; //
bytes data = 5; //
}
Transaction transaction = 2;
Transaction transaction = 2; //
}
message SendTransactionResponse {
bytes hash = 1;
bytes hash = 1; //
}

View File

@ -68,12 +68,18 @@ service Query {
rpc CountTransactions (TransactionsRequest) returns (CountTransactionsResponse);
}
/**
*
*/
enum IncludeTransactions {
NONE = 0; //
HASH = 1; //
FULL = 2; //
NONE = 0; //
HASH = 1; //
FULL = 2; //
}
/**
*
*/
message BlockFilter {
bytes hash = 1;
int64 timestamp = 2;
@ -88,68 +94,68 @@ message TransactionFilter {
}
message GetBlockByHashRequest {
string ledger = 1;
bytes hash = 2;
bool full_transactions = 3;
string ledger = 1; //
bytes hash = 2; //
bool full_transactions = 3; //
}
message GetBlockByHashResponse {
Block block = 1;
Block block = 1; //
}
message BlocksRequest {
string ledger = 1;
int64 start_timestamp = 2;
int64 end_timestamp = 3;
repeated BlockFilter filters = 4;
IncludeTransactions include_transactions = 5;
string ledger = 1; //
int64 start_timestamp = 2; //
int64 end_timestamp = 3; //
repeated BlockFilter filters = 4; //
IncludeTransactions include_transactions = 5; //
}
message GetBlocksResponse {
repeated Block blocks = 1;
int64 start_timestamp = 2;
int64 end_timestamp = 3;
repeated Block blocks = 1; //
int64 start_timestamp = 2; //
int64 end_timestamp = 3; //
}
message CountBlocksResponse {
uint64 count = 1;
int64 start_timestamp = 2;
int64 end_timestamp = 3;
uint64 count = 1; //
int64 start_timestamp = 2; //
int64 end_timestamp = 3; //
}
message RecentBlocksRequest {
string ledger = 1;
int64 count = 2;
IncludeTransactions include_transactions = 3;
string ledger = 1; //
int64 count = 2; //
IncludeTransactions include_transactions = 3; //
}
message GetTransactionByHashRequest {
string ledger = 1;
bytes hash = 2;
string ledger = 1; //
bytes hash = 2; //
}
message GetTransactionByHashResponse {
Transaction transaction = 1;
Transaction transaction = 1; //
}
message GetTransactionByBlockHashAndIndexRequest {
string ledger = 1;
bytes block_hash = 2;
uint32 index = 3;
string ledger = 1; //
bytes block_hash = 2; //
uint32 index = 3; //
}
message GetTransactionByBlockHashAndIndexResponse {
Transaction transaction = 1;
Transaction transaction = 1; //
}
message TransactionsRequest {
string ledger = 1;
int64 start_timestamp = 2; // required
int64 end_timestamp = 3;
repeated TransactionFilter filters = 4;
string ledger = 1; //
int64 start_timestamp = 2; //
int64 end_timestamp = 3; //
repeated TransactionFilter filters = 4; //
}
message GetTransactionsResponse {
repeated Transaction transactions = 1;
int64 start_timestamp = 2;
int64 end_timestamp = 3;
repeated Transaction transactions = 1; //
int64 start_timestamp = 2; //
int64 end_timestamp = 3; //
}
message CountTransactionsResponse {
uint64 count = 1;
int64 start_timestamp = 2;
int64 end_timestamp = 3;
uint64 count = 1; //
int64 start_timestamp = 2; //
int64 end_timestamp = 3; //
}

View File

@ -58,7 +58,7 @@ for %%A in (%*) do (
@echo off
)
if "%%A"=="docs" (
set plugin=protoc-gen-ts
set plugin=protoc-gen-doc
where /q !plugin! || echo missing !plugin! && exit /B
set out=..\..\docs
if not exist !out! mkdir !out!

View File

@ -93,7 +93,7 @@ for aug in $@; do
$async_tag
fi
if [ $aug == "docs" ]; then
plugin=protoc-gen-ts
plugin=protoc-gen-doc
plugin_path=$(which $plugin)
if [ $? -ne 0 ]; then
echo "missing plugin: $plugin" && exit