diff --git a/docs/apis.html b/docs/apis.html index c19c1f6..cdb2533 100644 --- a/docs/apis.html +++ b/docs/apis.html @@ -474,6 +474,20 @@

20字节的事务哈希的数组,或为空

+ + creator_signature + bytes + +

产块者签名

+ + + + witness_signatures + bytes + repeated +

见证者签名

+ + @@ -865,7 +879,8 @@ field. E.g., "field_violations.field" would identify this field.

name string -

账本名称

+

Ledger name +账本名称

@@ -889,7 +904,8 @@ field. E.g., "field_violations.field" would identify this field.

ok bool -

是否创建成功

+

Boolean value indicating if the ledger is successfully created +是否创建成功

@@ -913,7 +929,8 @@ field. E.g., "field_violations.field" would identify this field.

ledgers string repeated -

帐本名称列表

+

List of ledger names +帐本名称列表

@@ -937,14 +954,16 @@ field. E.g., "field_violations.field" would identify this field.

ledger string -

账本名称

+

Ledger name +账本名称

transaction SendTransactionRequest.Transaction -

事务信息

+

Transaction info +事务信息

@@ -1020,7 +1039,8 @@ field. E.g., "field_violations.field" would identify this field.

hash bytes -

事务哈希

+

Hash of the created transaction +事务哈希

@@ -1094,7 +1114,8 @@ field. E.g., "field_violations.field" would identify this field.

version string -

节点客户端版本

+

Client version +节点客户端版本

@@ -1569,6 +1590,13 @@ field. E.g., "field_violations.field" would identify this field.

账本名称

+ + offset + int64 + +

起始值

+ + count int64 diff --git a/docs/apis.json b/docs/apis.json index 9913879..96c5d2e 100644 --- a/docs/apis.json +++ b/docs/apis.json @@ -249,6 +249,30 @@ "isoneof": false, "oneofdecl": "", "defaultValue": "" + }, + { + "name": "creator_signature", + "description": "产块者签名", + "label": "", + "type": "bytes", + "longType": "bytes", + "fullType": "bytes", + "ismap": false, + "isoneof": false, + "oneofdecl": "", + "defaultValue": "" + }, + { + "name": "witness_signatures", + "description": "见证者签名", + "label": "repeated", + "type": "bytes", + "longType": "bytes", + "fullType": "bytes", + "ismap": false, + "isoneof": false, + "oneofdecl": "", + "defaultValue": "" } ] }, @@ -604,7 +628,7 @@ "fields": [ { "name": "name", - "description": "账本名称", + "description": "Ledger name\n账本名称", "label": "", "type": "string", "longType": "string", @@ -628,7 +652,7 @@ "fields": [ { "name": "ok", - "description": "是否创建成功", + "description": "Boolean value indicating if the ledger is successfully created\n是否创建成功", "label": "", "type": "bool", "longType": "bool", @@ -652,7 +676,7 @@ "fields": [ { "name": "ledgers", - "description": "帐本名称列表", + "description": "List of ledger names\n帐本名称列表", "label": "repeated", "type": "string", "longType": "string", @@ -676,7 +700,7 @@ "fields": [ { "name": "ledger", - "description": "账本名称", + "description": "Ledger name\n账本名称", "label": "", "type": "string", "longType": "string", @@ -688,7 +712,7 @@ }, { "name": "transaction", - "description": "事务信息", + "description": "Transaction info\n事务信息", "label": "", "type": "Transaction", "longType": "SendTransactionRequest.Transaction", @@ -784,7 +808,7 @@ "fields": [ { "name": "hash", - "description": "事务哈希", + "description": "Hash of the created transaction\n事务哈希", "label": "", "type": "bytes", "longType": "bytes", @@ -867,7 +891,7 @@ "fields": [ { "name": "version", - "description": "节点客户端版本", + "description": "Client version\n节点客户端版本", "label": "", "type": "string", "longType": "string", @@ -1464,6 +1488,18 @@ "oneofdecl": "", "defaultValue": "" }, + { + "name": "offset", + "description": "起始值", + "label": "", + "type": "int64", + "longType": "int64", + "fullType": "int64", + "ismap": false, + "isoneof": false, + "oneofdecl": "", + "defaultValue": "" + }, { "name": "count", "description": "查询区块数量", diff --git a/docs/apis.md b/docs/apis.md index a8bfcca..2aa1419 100644 --- a/docs/apis.md +++ b/docs/apis.md @@ -3,69 +3,69 @@ ## 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) +- [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) + - [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/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) +- [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) + - [Ledger](#bdware-bdledger-api-Ledger) -- [bdware/bdledger/api/node.proto](#bdware/bdledger/api/node.proto) - - [ClientVersionResponse](#bdware.bdledger.api.ClientVersionResponse) +- [bdware/bdledger/api/node.proto](#bdware_bdledger_api_node-proto) + - [ClientVersionResponse](#bdware-bdledger-api-ClientVersionResponse) - - [Node](#bdware.bdledger.api.Node) + - [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) - - [RecentBlocksRequest](#bdware.bdledger.api.RecentBlocksRequest) - - [TransactionFilter](#bdware.bdledger.api.TransactionFilter) - - [TransactionsRequest](#bdware.bdledger.api.TransactionsRequest) +- [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) + - [RecentBlocksRequest](#bdware-bdledger-api-RecentBlocksRequest) + - [TransactionFilter](#bdware-bdledger-api-TransactionFilter) + - [TransactionsRequest](#bdware-bdledger-api-TransactionsRequest) - - [IncludeTransactions](#bdware.bdledger.api.IncludeTransactions) + - [IncludeTransactions](#bdware-bdledger-api-IncludeTransactions) - - [Query](#bdware.bdledger.api.Query) + - [Query](#bdware-bdledger-api-Query) -- [google/protobuf/empty.proto](#google/protobuf/empty.proto) - - [Empty](#google.protobuf.Empty) +- [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 @@ -82,15 +82,17 @@ | size | [uint64](#uint64) | | 区块大小的字节数 | | transaction_count | [uint32](#uint32) | | 区块包含的事务数量 | | transactions_root | [bytes](#bytes) | | 区块的事务默克尔树根 | -| transactions | [Transaction](#bdware.bdledger.api.Transaction) | repeated | 事务对象的数组,或为空 | +| transactions | [Transaction](#bdware-bdledger-api-Transaction) | repeated | 事务对象的数组,或为空 | | transaction_hashes | [bytes](#bytes) | repeated | 20字节的事务哈希的数组,或为空 | +| creator_signature | [bytes](#bytes) | | 产块者签名 | +| witness_signatures | [bytes](#bytes) | repeated | 见证者签名 | - + ### Contract @@ -111,7 +113,7 @@ - + ### Transaction @@ -123,7 +125,7 @@ | block_timestamp | [int64](#int64) | | 事务所在的区块产生时的 UNIX 时间戳,单位为秒 | | index | [uint32](#uint32) | | 事务在区块中的位置 index,当事务处于待确认状态时为`null` | | hash | [bytes](#bytes) | | 事务的哈希 | -| type | [TransactionType](#bdware.bdledger.api.TransactionType) | | 事务类型 | +| type | [TransactionType](#bdware-bdledger-api-TransactionType) | | 事务类型 | | from | [bytes](#bytes) | | 发送账户地址 | | nonce | [uint64](#uint64) | | 这条事务之前发送者所发送的事务数量 | | to | [bytes](#bytes) | | 接收账户地址,或者调用的合约地址,或者`null`如为合约创建 | @@ -139,7 +141,7 @@ - + ### Contract.ContractUnitRequestType @@ -160,7 +162,7 @@ - + ### TransactionType 事务类型 @@ -182,14 +184,14 @@ - +

Top

## bdware/bdledger/api/error_details.proto - + ### InvalidArgument InvalidArgument indicates client specified an invalid argument. @@ -200,14 +202,14 @@ that are problematic regardless of the state of the system | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| field_violations | [InvalidArgument.FieldViolation](#bdware.bdledger.api.InvalidArgument.FieldViolation) | repeated | Describes all violations in a client request. | +| 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. @@ -232,14 +234,14 @@ A message type used to describe a single invalid field. - +

Top

## bdware/bdledger/api/ledger.proto - + ### CreateLedgerRequest @@ -247,14 +249,14 @@ A message type used to describe a single invalid field. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| name | [string](#string) | | 账本名称 | +| name | [string](#string) | | Ledger name 账本名称 | - + ### CreateLedgerResponse @@ -262,14 +264,14 @@ A message type used to describe a single invalid field. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| ok | [bool](#bool) | | 是否创建成功 | +| ok | [bool](#bool) | | Boolean value indicating if the ledger is successfully created 是否创建成功 | - + ### GetLedgersResponse @@ -277,14 +279,14 @@ A message type used to describe a single invalid field. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| ledgers | [string](#string) | repeated | 帐本名称列表 | +| ledgers | [string](#string) | repeated | List of ledger names 帐本名称列表 | - + ### SendTransactionRequest @@ -292,15 +294,15 @@ 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) | | Ledger name 账本名称 | +| transaction | [SendTransactionRequest.Transaction](#bdware-bdledger-api-SendTransactionRequest-Transaction) | | Transaction info 事务信息 | - + ### SendTransactionRequest.Transaction @@ -308,7 +310,7 @@ A message type used to describe a single invalid field. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| type | [TransactionType](#bdware.bdledger.api.TransactionType) | | 事务类型,目前仅支持通用数据记录,即type为RECORD (0) | +| type | [TransactionType](#bdware-bdledger-api-TransactionType) | | 事务类型,目前仅支持通用数据记录,即type为RECORD (0) | | from | [bytes](#bytes) | | 任意20字节的地址,用于区分使用同一节点的事务发起者 | | nonce | [uint64](#uint64) | | 正整数,同一from每个nonce应只使用一次,防止重复的事务(可以每次发送事务+1) | | to | [bytes](#bytes) | | 对于通用数据记录不需传递,无意义 | @@ -319,7 +321,7 @@ A message type used to describe a single invalid field. - + ### SendTransactionResponse @@ -327,7 +329,7 @@ A message type used to describe a single invalid field. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| hash | [bytes](#bytes) | | 事务哈希 | +| hash | [bytes](#bytes) | | Hash of the created transaction 事务哈希 | @@ -340,29 +342,29 @@ A message type used to describe a single invalid field. - + ### 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 发送一个新事务 | +| 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 @@ -370,7 +372,7 @@ A message type used to describe a single invalid field. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| version | [string](#string) | | 节点客户端版本 | +| version | [string](#string) | | Client version 节点客户端版本 | @@ -383,27 +385,27 @@ A message type used to describe a single invalid field. - + ### 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节点版本 | +| ClientVersion | [.google.protobuf.Empty](#google-protobuf-Empty) | [ClientVersionResponse](#bdware-bdledger-api-ClientVersionResponse) | Get BDLedger node version 查询BDLedger节点版本 | - +

Top

## bdware/bdledger/api/query.proto - + ### BlockFilter 暂不支持 @@ -419,7 +421,7 @@ A message type used to describe a single invalid field. - + ### BlocksRequest @@ -430,15 +432,15 @@ A message type used to describe a single invalid field. | 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) | | 包含事务信息详细程度 | +| filters | [BlockFilter](#bdware-bdledger-api-BlockFilter) | repeated | 暂不支持 | +| include_transactions | [IncludeTransactions](#bdware-bdledger-api-IncludeTransactions) | | 包含事务信息详细程度 | - + ### CountBlocksResponse @@ -455,7 +457,7 @@ A message type used to describe a single invalid field. - + ### CountTransactionsResponse @@ -472,7 +474,7 @@ A message type used to describe a single invalid field. - + ### GetBlockByHashRequest @@ -489,7 +491,7 @@ A message type used to describe a single invalid field. - + ### GetBlockByHashResponse @@ -497,14 +499,14 @@ 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) | | 区块信息 | - + ### GetBlocksResponse @@ -512,7 +514,7 @@ A message type used to describe a single invalid field. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| blocks | [Block](#bdware.bdledger.api.Block) | repeated | 区块列表 | +| blocks | [Block](#bdware-bdledger-api-Block) | repeated | 区块列表 | | start_timestamp | [int64](#int64) | | 本次查询有效的查询范围开始时间戳 | | end_timestamp | [int64](#int64) | | 本次查询有效的查询范围结束时间戳 | @@ -521,7 +523,7 @@ A message type used to describe a single invalid field. - + ### GetTransactionByBlockHashAndIndexRequest @@ -538,7 +540,7 @@ A message type used to describe a single invalid field. - + ### GetTransactionByBlockHashAndIndexResponse @@ -546,14 +548,14 @@ 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) | | 事务信息 | - + ### GetTransactionByHashRequest @@ -569,7 +571,7 @@ A message type used to describe a single invalid field. - + ### GetTransactionByHashResponse @@ -577,14 +579,14 @@ 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) | | 事务信息 | - + ### GetTransactionsResponse @@ -592,7 +594,7 @@ A message type used to describe a single invalid field. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| transactions | [Transaction](#bdware.bdledger.api.Transaction) | repeated | 事务列表 | +| transactions | [Transaction](#bdware-bdledger-api-Transaction) | repeated | 事务列表 | | start_timestamp | [int64](#int64) | | 本次查询有效的查询范围开始时间戳 | | end_timestamp | [int64](#int64) | | 本次查询有效的查询范围结束时间戳 | @@ -601,7 +603,7 @@ A message type used to describe a single invalid field. - + ### RecentBlocksRequest @@ -610,15 +612,16 @@ A message type used to describe a single invalid field. | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | ledger | [string](#string) | | 账本名称 | +| offset | [int64](#int64) | | 起始值 | | count | [int64](#int64) | | 查询区块数量 | -| include_transactions | [IncludeTransactions](#bdware.bdledger.api.IncludeTransactions) | | 包含事务信息详细程度 | +| include_transactions | [IncludeTransactions](#bdware-bdledger-api-IncludeTransactions) | | 包含事务信息详细程度 | - + ### TransactionFilter repeated Transaction/BlockFilters are combined by "&&"(and) operator; @@ -636,7 +639,7 @@ repeated Transaction/BlockFilters are combined by "&&"(and) oper - + ### TransactionsRequest @@ -647,7 +650,7 @@ repeated Transaction/BlockFilters are combined by "&&"(and) oper | ledger | [string](#string) | | 账本名称 | | start_timestamp | [int64](#int64) | | 查询范围开始时间戳 | | end_timestamp | [int64](#int64) | | 查询范围结束时间戳 | -| filters | [TransactionFilter](#bdware.bdledger.api.TransactionFilter) | repeated | 暂不支持 | +| filters | [TransactionFilter](#bdware-bdledger-api-TransactionFilter) | repeated | 暂不支持 | @@ -656,7 +659,7 @@ repeated Transaction/BlockFilters are combined by "&&"(and) oper - + ### IncludeTransactions 包含事务信息详细程度 @@ -673,34 +676,34 @@ repeated Transaction/BlockFilters are combined by "&&"(and) oper - + ### 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 查询时间范围内的区块 Requirement: start_timestamp <= end_timestamp If neither 'start_timestamp' nor 'end_timestamp' is specified, then 'start_timestamp' will be set to the genesis block's timestamp, and 'end_timestamp' will be set to (start_timestamp + query.maxDuration) (query.maxDuration is specified in go-bdledger's config file). If only 'end_timestamp' is not specified, or (end_timestamp - start_timestamp > query.maxDuration), then 'end_timestamp' will be set to (start_timestamp + query.maxDuration). If only 'start_timestamp' is not specified, then 'start_timestamp' will be set to (end_timestamp - query.maxDuration). In all cases, 'start_timestamp' will never be earlier than the genesis block's timestamp, and 'end_timestamp' 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 <= end_timestamp If neither 'start_timestamp' nor 'end_timestamp' is specified, then count all blocks in the specified ledger. If only 'end_timestamp' is not specified, then count all blocks with timestamps later than 'start_timestamp'. If only 'start_timestamp' is not specified, then count all blocks with timestamps earlier than 'end_timestamp'. In all cases, 'start_timestamp' will never be earlier than the genesis block's timestamp, and 'end_timestamp' 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 'count' blocks (Only support IncludeTransactions=NONE for now) 查询最新的 'count' 个区块 | -| 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 查询时间范围内的事务 'start_timestamp' and 'end_timestamp' follow the same requirements and rules as in 'GetBlocks'. | -| 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' and 'end_timestamp' follow the same requirements and rules as in 'CountBlocks'. | +| 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 查询时间范围内的区块 Requirement: start_timestamp <= end_timestamp If neither 'start_timestamp' nor 'end_timestamp' is specified, then 'start_timestamp' will be set to the genesis block's timestamp, and 'end_timestamp' will be set to (start_timestamp + query.maxDuration) (query.maxDuration is specified in go-bdledger's config file). If only 'end_timestamp' is not specified, or (end_timestamp - start_timestamp > query.maxDuration), then 'end_timestamp' will be set to (start_timestamp + query.maxDuration). If only 'start_timestamp' is not specified, then 'start_timestamp' will be set to (end_timestamp - query.maxDuration). In all cases, 'start_timestamp' will never be earlier than the genesis block's timestamp, and 'end_timestamp' 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 <= end_timestamp If neither 'start_timestamp' nor 'end_timestamp' is specified, then count all blocks in the specified ledger. If only 'end_timestamp' is not specified, then count all blocks with timestamps later than 'start_timestamp'. If only 'start_timestamp' is not specified, then count all blocks with timestamps earlier than 'end_timestamp'. In all cases, 'start_timestamp' will never be earlier than the genesis block's timestamp, and 'end_timestamp' 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 'count' blocks (Only support IncludeTransactions=NONE for now) 查询最新的 'count' 个区块 | +| 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 查询时间范围内的事务 'start_timestamp' and 'end_timestamp' follow the same requirements and rules as in 'GetBlocks'. | +| 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' and 'end_timestamp' follow the same requirements and rules as in 'CountBlocks'. | - +

Top

## google/protobuf/empty.proto - + ### Empty A generic empty message that you can re-use to avoid defining duplicated diff --git a/docs/openapiv2/bdware/bdledger/api/common.swagger.json b/docs/openapiv2/bdware/bdledger/api/common.swagger.json index cbb76fc..2e484c2 100644 --- a/docs/openapiv2/bdware/bdledger/api/common.swagger.json +++ b/docs/openapiv2/bdware/bdledger/api/common.swagger.json @@ -34,6 +34,7 @@ "details": { "type": "array", "items": { + "type": "object", "$ref": "#/definitions/protobufAny" } } diff --git a/docs/openapiv2/bdware/bdledger/api/error_details.swagger.json b/docs/openapiv2/bdware/bdledger/api/error_details.swagger.json index 9b051da..203f996 100644 --- a/docs/openapiv2/bdware/bdledger/api/error_details.swagger.json +++ b/docs/openapiv2/bdware/bdledger/api/error_details.swagger.json @@ -34,6 +34,7 @@ "details": { "type": "array", "items": { + "type": "object", "$ref": "#/definitions/protobufAny" } } diff --git a/docs/openapiv2/bdware/bdledger/api/ledger.swagger.json b/docs/openapiv2/bdware/bdledger/api/ledger.swagger.json index 7d63ef1..7380949 100644 --- a/docs/openapiv2/bdware/bdledger/api/ledger.swagger.json +++ b/docs/openapiv2/bdware/bdledger/api/ledger.swagger.json @@ -101,13 +101,7 @@ "in": "body", "required": true, "schema": { - "type": "object", - "properties": { - "transaction": { - "$ref": "#/definitions/apiSendTransactionRequestTransaction", - "title": "Transaction info\n事务信息" - } - } + "$ref": "#/definitions/LedgerSendTransactionBody" } } ], @@ -118,6 +112,15 @@ } }, "definitions": { + "LedgerSendTransactionBody": { + "type": "object", + "properties": { + "transaction": { + "$ref": "#/definitions/apiSendTransactionRequestTransaction", + "title": "Transaction info\n事务信息" + } + } + }, "apiCreateLedgerRequest": { "type": "object", "properties": { @@ -222,6 +225,7 @@ "details": { "type": "array", "items": { + "type": "object", "$ref": "#/definitions/protobufAny" } } diff --git a/docs/openapiv2/bdware/bdledger/api/node.swagger.json b/docs/openapiv2/bdware/bdledger/api/node.swagger.json index 9cf3775..967e93e 100644 --- a/docs/openapiv2/bdware/bdledger/api/node.swagger.json +++ b/docs/openapiv2/bdware/bdledger/api/node.swagger.json @@ -72,6 +72,7 @@ "details": { "type": "array", "items": { + "type": "object", "$ref": "#/definitions/protobufAny" } } diff --git a/docs/openapiv2/bdware/bdledger/api/query.swagger.json b/docs/openapiv2/bdware/bdledger/api/query.swagger.json index aa402d5..93706dd 100644 --- a/docs/openapiv2/bdware/bdledger/api/query.swagger.json +++ b/docs/openapiv2/bdware/bdledger/api/query.swagger.json @@ -142,30 +142,7 @@ "in": "body", "required": true, "schema": { - "type": "object", - "properties": { - "startTimestamp": { - "type": "string", - "format": "int64", - "title": "查询范围开始时间戳" - }, - "endTimestamp": { - "type": "string", - "format": "int64", - "title": "查询范围结束时间戳" - }, - "filters": { - "type": "array", - "items": { - "$ref": "#/definitions/apiBlockFilter" - }, - "title": "暂不支持" - }, - "includeTransactions": { - "$ref": "#/definitions/apiIncludeTransactions", - "title": "包含事务信息详细程度" - } - } + "$ref": "#/definitions/QueryCountBlocksBody" } } ], @@ -205,30 +182,7 @@ "in": "body", "required": true, "schema": { - "type": "object", - "properties": { - "startTimestamp": { - "type": "string", - "format": "int64", - "title": "查询范围开始时间戳" - }, - "endTimestamp": { - "type": "string", - "format": "int64", - "title": "查询范围结束时间戳" - }, - "filters": { - "type": "array", - "items": { - "$ref": "#/definitions/apiBlockFilter" - }, - "title": "暂不支持" - }, - "includeTransactions": { - "$ref": "#/definitions/apiIncludeTransactions", - "title": "包含事务信息详细程度" - } - } + "$ref": "#/definitions/QueryGetBlocksBody" } } ], @@ -369,26 +323,7 @@ "in": "body", "required": true, "schema": { - "type": "object", - "properties": { - "startTimestamp": { - "type": "string", - "format": "int64", - "title": "查询范围开始时间戳" - }, - "endTimestamp": { - "type": "string", - "format": "int64", - "title": "查询范围结束时间戳" - }, - "filters": { - "type": "array", - "items": { - "$ref": "#/definitions/apiTransactionFilter" - }, - "title": "暂不支持" - } - } + "$ref": "#/definitions/QueryCountTransactionsBody" } } ], @@ -428,26 +363,7 @@ "in": "body", "required": true, "schema": { - "type": "object", - "properties": { - "startTimestamp": { - "type": "string", - "format": "int64", - "title": "查询范围开始时间戳" - }, - "endTimestamp": { - "type": "string", - "format": "int64", - "title": "查询范围结束时间戳" - }, - "filters": { - "type": "array", - "items": { - "$ref": "#/definitions/apiTransactionFilter" - }, - "title": "暂不支持" - } - } + "$ref": "#/definitions/QueryGetTransactionsBody" } } ], @@ -458,6 +374,106 @@ } }, "definitions": { + "QueryCountBlocksBody": { + "type": "object", + "properties": { + "startTimestamp": { + "type": "string", + "format": "int64", + "title": "查询范围开始时间戳" + }, + "endTimestamp": { + "type": "string", + "format": "int64", + "title": "查询范围结束时间戳" + }, + "filters": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/apiBlockFilter" + }, + "title": "暂不支持" + }, + "includeTransactions": { + "$ref": "#/definitions/apiIncludeTransactions", + "title": "包含事务信息详细程度" + } + } + }, + "QueryCountTransactionsBody": { + "type": "object", + "properties": { + "startTimestamp": { + "type": "string", + "format": "int64", + "title": "查询范围开始时间戳" + }, + "endTimestamp": { + "type": "string", + "format": "int64", + "title": "查询范围结束时间戳" + }, + "filters": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/apiTransactionFilter" + }, + "title": "暂不支持" + } + } + }, + "QueryGetBlocksBody": { + "type": "object", + "properties": { + "startTimestamp": { + "type": "string", + "format": "int64", + "title": "查询范围开始时间戳" + }, + "endTimestamp": { + "type": "string", + "format": "int64", + "title": "查询范围结束时间戳" + }, + "filters": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/apiBlockFilter" + }, + "title": "暂不支持" + }, + "includeTransactions": { + "$ref": "#/definitions/apiIncludeTransactions", + "title": "包含事务信息详细程度" + } + } + }, + "QueryGetTransactionsBody": { + "type": "object", + "properties": { + "startTimestamp": { + "type": "string", + "format": "int64", + "title": "查询范围开始时间戳" + }, + "endTimestamp": { + "type": "string", + "format": "int64", + "title": "查询范围结束时间戳" + }, + "filters": { + "type": "array", + "items": { + "type": "object", + "$ref": "#/definitions/apiTransactionFilter" + }, + "title": "暂不支持" + } + } + }, "apiBlock": { "type": "object", "properties": { @@ -515,6 +531,7 @@ "transactions": { "type": "array", "items": { + "type": "object", "$ref": "#/definitions/bdledgerapiTransaction" }, "title": "事务对象的数组,或为空" @@ -533,8 +550,11 @@ "title": "产块者签名" }, "witnessSignatures": { - "type": "string", - "format": "byte", + "type": "array", + "items": { + "type": "string", + "format": "byte" + }, "title": "见证者签名" } } @@ -608,6 +628,7 @@ "blocks": { "type": "array", "items": { + "type": "object", "$ref": "#/definitions/apiBlock" }, "title": "区块列表" @@ -648,6 +669,7 @@ "transactions": { "type": "array", "items": { + "type": "object", "$ref": "#/definitions/bdledgerapiTransaction" }, "title": "事务列表" @@ -796,6 +818,7 @@ "details": { "type": "array", "items": { + "type": "object", "$ref": "#/definitions/protobufAny" } } diff --git a/grpc/README.md b/grpc/README.md index c087f5a..736cb62 100644 --- a/grpc/README.md +++ b/grpc/README.md @@ -10,52 +10,41 @@ See [API documentation](..\docs\apis.md) ##### Installling tools -Download the [Protocol Buffers compiler](https://github.com/protocolbuffers/protobuf/releases) (protoc-3.21.9-*)+ for +Download the [Protocol Buffers compiler](https://github.com/protocolbuffers/protobuf/releases) (protoc-25.3-*)+ for your platform and add `protoc` to `PATH` environment variable -For generating Go code, install `protoc-gen-go` (v1.28.1+): +For generating Go code, install `protoc-gen-go` (v1.33.0+): -```shell -GIT_TAG="v1.28.1" -go get -d -u google.golang.org/protobuf/cmd/protoc-gen-go -git -C "$(go env GOPATH)"/src/google.golang.org/protobuf checkout $GIT_TAG -go install google.golang.org/protobuf/cmd/protoc-gen-go +```sh +go install google.golang.org/protobuf/cmd/protoc-gen-go@latest ``` -Also install `protoc-gen-go-grpc` v1.2.0+: +Also install `protoc-gen-go-grpc` v1.3.0+: -```shell -go get -u google.golang.org/grpc/cmd/protoc-gen-go-grpc -``` - -Or install using [gobin](https://github.com/myitcv/gobin): - -```shell -gobin google.golang.org/protobuf/cmd/protoc-gen-go -gobin google.golang.org/grpc/cmd/protoc-gen-go-grpc +```sh +go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest ``` For generating HTTP JSON APIs with [grpc-gateway](https://grpc-ecosystem.github.io/grpc-gateway/) **v2.2.0**, follow the [documentation](https://github.com/grpc-ecosystem/grpc-gateway#installation). -For generating validators -install [go-proto-validators](https://github.com/mwitkow/go-proto-validators/tree/master/protoc-gen-govalidators): +For generating validators, install [go-proto-validators](https://github.com/mwitkow/go-proto-validators/tree/master/protoc-gen-govalidators) v0.3.2+: -```shell -go get github.com/mwitkow/go-proto-validators/protoc-gen-govalidators +```sh +go install github.com/mwitkow/go-proto-validators/protoc-gen-govalidators@latest ``` For generating Java code: From `bdledger-sdk-java` run `gradle generateProto` For generating Node.js code and/or TypeScript definitions), install Node.js then run: -```shell +```sh npm install ``` For frontend JavaScript: -```shell +```sh git clone https://github.com/grpc/grpc-web cd grpc-web sudo make install-plugin @@ -75,19 +64,19 @@ Run: For generating TypeScript client code with `ts-proto`, run: -```shell +```sh invoke gen -t ts ``` For generating TypeScript definitions to be used with `@grpc/proto-loader`, run: -```shell +```sh invoke gen -t types ``` Others: -```shell +```sh ./scripts/gen [-a, --async] [go] [gohttp] [nodejs] [docs] ``` @@ -96,11 +85,11 @@ Others: Use `-a` or `--async` to speed up generation by asynchronously and concurrently generating all code and documentation ( script will exit without waiting for completion) -#### Generateing documentation +#### Generating documentation Install Go then run: -```shell -go get -u github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc +```sh +go install github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc@latest ./scripts/gen [-a, --async] docs ```