From 87107ad3dbfe52be9d794723d18ff058890c7c63 Mon Sep 17 00:00:00 2001 From: Nex Date: Thu, 2 Apr 2020 17:23:36 +0800 Subject: [PATCH 1/2] Add timestamps to count* API responses --- bdledger/api/query.proto | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bdledger/api/query.proto b/bdledger/api/query.proto index 286fe9a..3730fd1 100644 --- a/bdledger/api/query.proto +++ b/bdledger/api/query.proto @@ -54,6 +54,8 @@ message GetBlocksResponse { } message CountBlocksResponse { uint64 count = 1; + int64 start_timestamp = 2; + int64 end_timestamp = 3; } message GetTransactionByHashRequest { @@ -86,4 +88,6 @@ message GetTransactionsResponse { } message CountTransactionsResponse { uint64 count = 1; + int64 start_timestamp = 2; + int64 end_timestamp = 3; } From 9f8985cd332f568ce4047c2776f1c4de21425326 Mon Sep 17 00:00:00 2001 From: Nex Date: Thu, 2 Apr 2020 17:24:11 +0800 Subject: [PATCH 2/2] Add include_transactions option to getBlocks API --- bdledger/api/query.proto | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bdledger/api/query.proto b/bdledger/api/query.proto index 3730fd1..f443c0c 100644 --- a/bdledger/api/query.proto +++ b/bdledger/api/query.proto @@ -46,6 +46,12 @@ message BlocksRequest { int64 start_timestamp = 2; int64 end_timestamp = 3; repeated BlockFilter filters = 4; + enum IncludeTransactions { + NONE = 0; // 不包含交易数据 + HASH = 1; // 包含交易哈希列表 + FULL = 2; // 包含完整交易列表 + } + IncludeTransactions include_transactions = 5; } message GetBlocksResponse { repeated Block blocks = 1;