RPC - Update getblockchaininfo statistics format

This commit is contained in:
thephez 2019-08-22 10:52:29 -04:00
parent 80f10dacdf
commit 6e84e8fd59
3 changed files with 63 additions and 46 deletions

View file

@ -118,7 +118,7 @@ These RPCs are all Dash-specific and not found in Bitcoin Core
* [GetBestBlockHash][rpc getbestblockhash]: {{summary_getBestBlockHash}} * [GetBestBlockHash][rpc getbestblockhash]: {{summary_getBestBlockHash}}
* [GetBlock][rpc getblock]: {{summary_getBlock}} {{DASH_UPDATED0_14_0}} * [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}} * [GetBlockCount][rpc getblockcount]: {{summary_getBlockCount}}
* [GetBlockHash][rpc getblockhash]: {{summary_getBlockHash}} * [GetBlockHash][rpc getblockhash]: {{summary_getBlockHash}}
* [GetBlockHashes][rpc getblockhashes]: {{summary_getBlockHashes}} {{DASH_NEW0_12_1}} * [GetBlockHashes][rpc getblockhashes]: {{summary_getBlockHashes}} {{DASH_NEW0_12_1}}

View file

@ -82,7 +82,7 @@ The `getblockchaininfo` RPC {{summary_getBlockChainInfo}}
- n: "→ →<br>Softfork" - n: "→ →<br>Softfork"
t: "object" t: "object"
p: "Required<br>(3 or more)" p: "Required<br>(0 or more)"
d: "A specific softfork" d: "A specific softfork"
- n: "→ → →<br>`id`" - n: "→ → →<br>`id`"
@ -152,7 +152,7 @@ The `getblockchaininfo` RPC {{summary_getBlockChainInfo}}
- n: "→ →<br>Name" - n: "→ →<br>Name"
t: "string : object" t: "string : object"
p: "Required<br>(2 or more)" p: "Required<br>(0 or more)"
d: "A specific BIP9 softfork" d: "A specific BIP9 softfork"
- n: "→ → →<br>`status`" - n: "→ → →<br>`status`"
@ -165,31 +165,6 @@ The `getblockchaininfo` RPC {{summary_getBlockChainInfo}}
p: "Optional<br>(0 or 1)" p: "Optional<br>(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`" d: "The bit (0-28) in the block version field used to signal this softfork. Field is only shown when status is `started`"
- n: "→ → →<br>`period`"
t: "numeric<br>(int)"
p: "Optional<br>(0 or 1)"
d: "*Added in Dash Core 0.13.0*<br><br>The window size/period for this softfork. Field is only shown when status is `started`"
- n: "→ → →<br>`threshold`"
t: "numeric<br>(int)"
p: "Optional<br>(0 or 1)"
d: "*Added in Dash Core 0.13.0*<br><br>The threshold for this softfork. Field is only shown when status is `started`"
- n: "→ → →<br>`windowStart`"
t: "numeric<br>(int)"
p: "Optional<br>(0 or 1)"
d: "*Added in Dash Core 0.13.0*<br><br>The starting block height of the current window. Field is only shown when status is `started`"
- n: "→ → →<br>`windowBlocks`"
t: "numeric<br>(int)"
p: "Optional<br>(0 or 1)"
d: "*Added in Dash Core 0.13.0*<br><br>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: "→ → →<br>`windowProgress`"
t: "numeric<br>(int)"
p: "Optional<br>(0 or 1)"
d: "*Added in Dash Core 0.13.0*<br><br>The progress (between 0 and 1) for activation of this softfork. Field is only shown when status is `started`"
- n: "→ → →<br>`startTime`" - n: "→ → →<br>`startTime`"
t: "numeric<br>(int)" t: "numeric<br>(int)"
p: "Required<br>(exactly 1)" p: "Required<br>(exactly 1)"
@ -204,9 +179,40 @@ The `getblockchaininfo` RPC {{summary_getBlockChainInfo}}
t: "numeric<br>(int)" t: "numeric<br>(int)"
p: "Required<br>(exactly 1)" p: "Required<br>(exactly 1)"
d: "*Added in Bitcoin Core 0.14.0*<br><br>The height of the first block to which the status applies" d: "*Added in Bitcoin Core 0.14.0*<br><br>The height of the first block to which the status applies"
- n: "→ → →<br>`statistics`"
t: "string : object"
p: "Required<br>(exactly 1)"
d: "*Added in Dash Core 0.14.1*<br><br>Numeric statistics about BIP9 signaling for a softfork (only for \"started\" status)"
- n: "→ → → →<br>`period`"
t: "numeric<br>(int)"
p: "Optional<br>(0 or 1)"
d: "*Added in Dash Core 0.14.1*<br><br>The length in blocks of the BIP9 signaling period. Field is only shown when status is `started`"
- n: "→ → → →<br>`threshold`"
t: "numeric<br>(int)"
p: "Optional<br>(0 or 1)"
d: "*Added in Dash Core 0.14.1*<br><br>The number of blocks with the version bit set required to activate the feature. Field is only shown when status is `started`"
- n: "→ → → →<br>`elapsed`"
t: "numeric<br>(int)"
p: "Optional<br>(0 or 1)"
d: "*Added in Dash Core 0.14.1*<br><br>The number of blocks elapsed since the beginning of the current period. Field is only shown when status is `started`"
- n: "→ → → →<br>`count`"
t: "numeric<br>(int)"
p: "Optional<br>(0 or 1)"
d: "*Added in Dash Core 0.14.1*<br><br>The number of blocks with the version bit set in the current period. Field is only shown when status is `started`"
- n: "→<br>`possible`"
t: "bool"
p: "Optional<br>(0 or 1)"
d: "*Added in Bitcoin Core 0.11.0*<br><br>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 %} {% enditemplate %}
*Example from Dash Core 0.12.3* *Example from Dash Core 0.14.1*
{% highlight bash %} {% highlight bash %}
dash-cli -testnet getblockchaininfo dash-cli -testnet getblockchaininfo
@ -217,13 +223,13 @@ Result:
{% highlight json %} {% highlight json %}
{ {
"chain": "test", "chain": "test",
"blocks": 82244, "blocks": 160508,
"headers": 82244, "headers": 160508,
"bestblockhash": "0000000004efcadbdb9d8b524e5ab982af3db039fdb585c2f1c1df56d42d4492", "bestblockhash": "0000000008ae87c2999faa79c74727ab2a15783fcab515cc940a6c14dfa921a8",
"difficulty": 47.4955836390814, "difficulty": 24.71182965485547,
"mediantime": 1519662782, "mediantime": 1566479773,
"verificationprogress": 0.9999999483744162, "verificationprogress": 0.9999986039171913,
"chainwork": "0000000000000000000000000000000000000000000000000021adf3af961831", "chainwork": "0000000000000000000000000000000000000000000000000077db2024e1810b",
"pruned": false, "pruned": false,
"softforks": [ "softforks": [
{ {
@ -251,25 +257,36 @@ Result:
"bip9_softforks": { "bip9_softforks": {
"csv": { "csv": {
"status": "active", "status": "active",
"startTime": 1506556800, "startTime": 1544655600,
"timeout": 1538092800, "timeout": 1576191600,
"since": 8064 "since": 8064
}, },
"dip0001": { "dip0001": {
"status": "active", "status": "active",
"startTime": 1505692800, "startTime": 1544655600,
"timeout": 1537228800, "timeout": 1576191600,
"since": 5600 "since": 4400
},
"dip0003": {
"status": "active",
"startTime": 1544655600,
"timeout": 1576191600,
"since": 7000
},
"dip0008": {
"status": "active",
"startTime": 1553126400,
"timeout": 1584748800,
"since": 78800
}, },
"bip147": { "bip147": {
"status": "active", "status": "active",
"startTime": 1517792400, "startTime": 1544655600,
"timeout": 1549328400, "timeout": 1576191600,
"since": 78800 "since": 4300
} }
} }
} }
{% endhighlight %} {% endhighlight %}
*See also* *See also*

View file

@ -77,7 +77,7 @@ th.tg-sort-header::-moz-selection { background:transparent; }th.tg-sort-header::
<td class="tg-yw4l">Blockchain</td> <td class="tg-yw4l">Blockchain</td>
<td class="tg-yw4l"><a href="#getblockchaininfo">GetBlockChainInfo</a></td> <td class="tg-yw4l"><a href="#getblockchaininfo">GetBlockChainInfo</a></td>
<td class="tg-baqh">Y</td> <td class="tg-baqh">Y</td>
<td class="tg-baqh">Updated in 0.13.0.0</td> <td class="tg-baqh">Updated in 0.14.1</td>
</tr> </tr>
<tr> <tr>
<td class="tg-b7b8">Blockchain</td> <td class="tg-b7b8">Blockchain</td>