From 652b633e7195e1ab4cccf2d1b841757b0d8a2e69 Mon Sep 17 00:00:00 2001 From: Nex Date: Tue, 21 Apr 2020 00:46:04 +0800 Subject: [PATCH] Add Block.Creator and Block.Nonce --- docs/apis.html | 14 ++++++++++++++ docs/apis.json | 20 ++++++++++++++++++++ docs/apis.md | 2 ++ grpc/pb/bdware/bdledger/api/common.proto | 20 +++++++++++--------- 4 files changed, 47 insertions(+), 9 deletions(-) diff --git a/docs/apis.html b/docs/apis.html index f5ddc6b..43e1afb 100644 --- a/docs/apis.html +++ b/docs/apis.html @@ -400,6 +400,20 @@

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

+ + creator + bytes + +

产块者账户地址

+ + + + nonce + uint64 + +

这个区块之前产块者产生的区块数量

+ + parent_hashes bytes diff --git a/docs/apis.json b/docs/apis.json index 7bb1113..6b021f6 100644 --- a/docs/apis.json +++ b/docs/apis.json @@ -127,6 +127,26 @@ "ismap": false, "defaultValue": "" }, + { + "name": "creator", + "description": "产块者账户地址", + "label": "", + "type": "bytes", + "longType": "bytes", + "fullType": "bytes", + "ismap": false, + "defaultValue": "" + }, + { + "name": "nonce", + "description": "这个区块之前产块者产生的区块数量", + "label": "", + "type": "uint64", + "longType": "uint64", + "fullType": "uint64", + "ismap": false, + "defaultValue": "" + }, { "name": "parent_hashes", "description": "父区块的哈希", diff --git a/docs/apis.md b/docs/apis.md index 9171b6a..a3ccdf3 100644 --- a/docs/apis.md +++ b/docs/apis.md @@ -92,6 +92,8 @@ | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | | hash | [bytes](#bytes) | | 区块的哈希,当区块处于待确认状态时为`null` | +| creator | [bytes](#bytes) | | 产块者账户地址 | +| nonce | [uint64](#uint64) | | 这个区块之前产块者产生的区块数量 | | parent_hashes | [bytes](#bytes) | repeated | 父区块的哈希 | | witnesses | [bytes](#bytes) | repeated | 见证者账户地址 | | timestamp | [int64](#int64) | | 区块产生时的 UNIX 时间戳,单位为秒 | diff --git a/grpc/pb/bdware/bdledger/api/common.proto b/grpc/pb/bdware/bdledger/api/common.proto index 5a2df87..7976e1a 100644 --- a/grpc/pb/bdware/bdledger/api/common.proto +++ b/grpc/pb/bdware/bdledger/api/common.proto @@ -29,15 +29,17 @@ message Transaction { } message Block { - bytes hash = 1; // 区块的哈希,当区块处于待确认状态时为`null` - repeated bytes parent_hashes = 2; // 父区块的哈希 - repeated bytes witnesses = 3; // 见证者账户地址 - int64 timestamp = 4; // 区块产生时的 UNIX 时间戳,单位为秒 - uint64 size = 5; // 区块大小的字节数 - uint32 transaction_count = 6; // 区块包含的事务数量 - bytes transactions_root = 7; // 区块的事务默克尔树根 - repeated Transaction transactions = 8; // 事务对象的数组,或为空 - repeated bytes transaction_hashes = 9; // 20字节的交易哈希的数组,或为空 + bytes hash = 1; // 区块的哈希,当区块处于待确认状态时为`null` + bytes creator = 2; // 产块者账户地址 + uint64 nonce = 3; // 这个区块之前产块者产生的区块数量 + repeated bytes parent_hashes = 4; // 父区块的哈希 + repeated bytes witnesses = 5; // 见证者账户地址 + int64 timestamp = 6; // 区块产生时的 UNIX 时间戳,单位为秒 + uint64 size = 7; // 区块大小的字节数 + uint32 transaction_count = 8; // 区块包含的事务数量 + bytes transactions_root = 9; // 区块的事务默克尔树根 + repeated Transaction transactions = 10; // 事务对象的数组,或为空 + repeated bytes transaction_hashes = 11; // 20字节的交易哈希的数组,或为空 } message Contract {