From 6e84e8fd593a58c4ea26d87b0a338805ec107081 Mon Sep 17 00:00:00 2001 From: thephez Date: Thu, 22 Aug 2019 10:52:29 -0400 Subject: [PATCH] RPC - Update getblockchaininfo statistics format --- .../devdoc/dash-core/rpcs/quick-reference.md | 2 +- .../dash-core/rpcs/rpcs/getblockchaininfo.md | 105 ++++++++++-------- _includes/layout/base/rpc-table.html | 2 +- 3 files changed, 63 insertions(+), 46 deletions(-) diff --git a/_includes/devdoc/dash-core/rpcs/quick-reference.md b/_includes/devdoc/dash-core/rpcs/quick-reference.md index 35c54918..008cd67b 100644 --- a/_includes/devdoc/dash-core/rpcs/quick-reference.md +++ b/_includes/devdoc/dash-core/rpcs/quick-reference.md @@ -118,7 +118,7 @@ These RPCs are all Dash-specific and not found in Bitcoin Core * [GetBestBlockHash][rpc getbestblockhash]: {{summary_getBestBlockHash}} * [GetBlock][rpc getblock]: {{summary_getBlock}} {{DASH_UPDATED0_14_0}} -* [GetBlockChainInfo][rpc getblockchaininfo]: {{summary_getBlockChainInfo}} {{DASH_UPDATED0_13_0}} {{UPDATED0_12_1}} +* [GetBlockChainInfo][rpc getblockchaininfo]: {{summary_getBlockChainInfo}} {{DASH_UPDATED0_14_1}} * [GetBlockCount][rpc getblockcount]: {{summary_getBlockCount}} * [GetBlockHash][rpc getblockhash]: {{summary_getBlockHash}} * [GetBlockHashes][rpc getblockhashes]: {{summary_getBlockHashes}} {{DASH_NEW0_12_1}} diff --git a/_includes/devdoc/dash-core/rpcs/rpcs/getblockchaininfo.md b/_includes/devdoc/dash-core/rpcs/rpcs/getblockchaininfo.md index 1d4e1f12..78d2622f 100644 --- a/_includes/devdoc/dash-core/rpcs/rpcs/getblockchaininfo.md +++ b/_includes/devdoc/dash-core/rpcs/rpcs/getblockchaininfo.md @@ -82,7 +82,7 @@ The `getblockchaininfo` RPC {{summary_getBlockChainInfo}} - n: "→ →
Softfork" t: "object" - p: "Required
(3 or more)" + p: "Required
(0 or more)" d: "A specific softfork" - n: "→ → →
`id`" @@ -152,7 +152,7 @@ The `getblockchaininfo` RPC {{summary_getBlockChainInfo}} - n: "→ →
Name" t: "string : object" - p: "Required
(2 or more)" + p: "Required
(0 or more)" d: "A specific BIP9 softfork" - n: "→ → →
`status`" @@ -165,31 +165,6 @@ The `getblockchaininfo` RPC {{summary_getBlockChainInfo}} p: "Optional
(0 or 1)" d: "The bit (0-28) in the block version field used to signal this softfork. Field is only shown when status is `started`" -- n: "→ → →
`period`" - t: "numeric
(int)" - p: "Optional
(0 or 1)" - d: "*Added in Dash Core 0.13.0*

The window size/period for this softfork. Field is only shown when status is `started`" - -- n: "→ → →
`threshold`" - t: "numeric
(int)" - p: "Optional
(0 or 1)" - d: "*Added in Dash Core 0.13.0*

The threshold for this softfork. Field is only shown when status is `started`" - -- n: "→ → →
`windowStart`" - t: "numeric
(int)" - p: "Optional
(0 or 1)" - d: "*Added in Dash Core 0.13.0*

The starting block height of the current window. Field is only shown when status is `started`" - -- n: "→ → →
`windowBlocks`" - t: "numeric
(int)" - p: "Optional
(0 or 1)" - d: "*Added in Dash Core 0.13.0*

The number of blocks in the current window that had the version bit set for this softfork. Field is only shown when status is `started`" - -- n: "→ → →
`windowProgress`" - t: "numeric
(int)" - p: "Optional
(0 or 1)" - d: "*Added in Dash Core 0.13.0*

The progress (between 0 and 1) for activation of this softfork. Field is only shown when status is `started`" - - n: "→ → →
`startTime`" t: "numeric
(int)" p: "Required
(exactly 1)" @@ -204,9 +179,40 @@ The `getblockchaininfo` RPC {{summary_getBlockChainInfo}} t: "numeric
(int)" p: "Required
(exactly 1)" d: "*Added in Bitcoin Core 0.14.0*

The height of the first block to which the status applies" + +- n: "→ → →
`statistics`" + t: "string : object" + p: "Required
(exactly 1)" + d: "*Added in Dash Core 0.14.1*

Numeric statistics about BIP9 signaling for a softfork (only for \"started\" status)" + +- n: "→ → → →
`period`" + t: "numeric
(int)" + p: "Optional
(0 or 1)" + d: "*Added in Dash Core 0.14.1*

The length in blocks of the BIP9 signaling period. Field is only shown when status is `started`" + +- n: "→ → → →
`threshold`" + t: "numeric
(int)" + p: "Optional
(0 or 1)" + d: "*Added in Dash Core 0.14.1*

The number of blocks with the version bit set required to activate the feature. Field is only shown when status is `started`" + +- n: "→ → → →
`elapsed`" + t: "numeric
(int)" + p: "Optional
(0 or 1)" + d: "*Added in Dash Core 0.14.1*

The number of blocks elapsed since the beginning of the current period. Field is only shown when status is `started`" + +- n: "→ → → →
`count`" + t: "numeric
(int)" + p: "Optional
(0 or 1)" + d: "*Added in Dash Core 0.14.1*

The number of blocks with the version bit set in the current period. Field is only shown when status is `started`" + +- n: "→
`possible`" + t: "bool" + p: "Optional
(0 or 1)" + d: "*Added in Bitcoin Core 0.11.0*

Returns false if there are not enough blocks left in this period to pass activation threshold. Field is only shown when status is `started`" + {% enditemplate %} -*Example from Dash Core 0.12.3* +*Example from Dash Core 0.14.1* {% highlight bash %} dash-cli -testnet getblockchaininfo @@ -217,13 +223,13 @@ Result: {% highlight json %} { "chain": "test", - "blocks": 82244, - "headers": 82244, - "bestblockhash": "0000000004efcadbdb9d8b524e5ab982af3db039fdb585c2f1c1df56d42d4492", - "difficulty": 47.4955836390814, - "mediantime": 1519662782, - "verificationprogress": 0.9999999483744162, - "chainwork": "0000000000000000000000000000000000000000000000000021adf3af961831", + "blocks": 160508, + "headers": 160508, + "bestblockhash": "0000000008ae87c2999faa79c74727ab2a15783fcab515cc940a6c14dfa921a8", + "difficulty": 24.71182965485547, + "mediantime": 1566479773, + "verificationprogress": 0.9999986039171913, + "chainwork": "0000000000000000000000000000000000000000000000000077db2024e1810b", "pruned": false, "softforks": [ { @@ -251,25 +257,36 @@ Result: "bip9_softforks": { "csv": { "status": "active", - "startTime": 1506556800, - "timeout": 1538092800, + "startTime": 1544655600, + "timeout": 1576191600, "since": 8064 }, "dip0001": { "status": "active", - "startTime": 1505692800, - "timeout": 1537228800, - "since": 5600 + "startTime": 1544655600, + "timeout": 1576191600, + "since": 4400 + }, + "dip0003": { + "status": "active", + "startTime": 1544655600, + "timeout": 1576191600, + "since": 7000 + }, + "dip0008": { + "status": "active", + "startTime": 1553126400, + "timeout": 1584748800, + "since": 78800 }, "bip147": { "status": "active", - "startTime": 1517792400, - "timeout": 1549328400, - "since": 78800 + "startTime": 1544655600, + "timeout": 1576191600, + "since": 4300 } } } - {% endhighlight %} *See also* diff --git a/_includes/layout/base/rpc-table.html b/_includes/layout/base/rpc-table.html index c98b3fc5..29c0bdcf 100644 --- a/_includes/layout/base/rpc-table.html +++ b/_includes/layout/base/rpc-table.html @@ -77,7 +77,7 @@ th.tg-sort-header::-moz-selection { background:transparent; }th.tg-sort-header:: Blockchain GetBlockChainInfo Y - Updated in 0.13.0.0 + Updated in 0.14.1 Blockchain