diff --git a/_autocrossref.yaml b/_autocrossref.yaml index 3c0e6b4d..a639086c 100644 --- a/_autocrossref.yaml +++ b/_autocrossref.yaml @@ -372,6 +372,8 @@ DIP8: '`getblockheader`': rpc getblockheader '`getblockheader` RPC': rpc getblockheader '`getblockheaders`': rpc getblockheaders +'`getblockstats`': rpc getblockstats +'`getblockstats` RPC': rpc getblockstats '`getblockheaders` RPC': rpc getblockheaders '`getblocktemplate`': rpc getblocktemplate '`getblocktemplate` RPC': rpc getblocktemplate diff --git a/_config.yml b/_config.yml index f42d73b0..edf20838 100644 --- a/_config.yml +++ b/_config.yml @@ -200,7 +200,7 @@ devsearches: - 'GetAddressUtxos': "/en/developer-reference#getaddressutxos" - 'GetBalance': "/en/developer-reference#getbalance" - 'GetBestBlockHash': "/en/developer-reference#getbestblockhash" - - 'GetBestChainLock': "/en/developer-reference#getbestchainlock" + - 'GetBestChainLock': "/en/developer-reference#getbestchainlock" - 'GetBlock': "/en/developer-reference#getblock" - 'GetBlockChainInfo': "/en/developer-reference#getblockchaininfo" - 'GetBlockCount': "/en/developer-reference#getblockcount" @@ -208,6 +208,7 @@ devsearches: - 'GetBlockHashes': "/en/developer-reference#getblockhashes" - 'GetBlockHeader': "/en/developer-reference#getblockheader" - 'GetBlockHeaders': "/en/developer-reference#getblockheaders" + - 'GetBlockStats': "/en/developer-reference#getblockstats" - 'GetBlockTemplate': "/en/developer-reference#getblocktemplate" - 'GetChainTips': "/en/developer-reference#getchaintips" - 'GetChainTxStats': "/en/developer-reference#getchaintxstats" diff --git a/_includes/devdoc/dash-core/rpcs/quick-reference.md b/_includes/devdoc/dash-core/rpcs/quick-reference.md index 2d1a0d13..14ceb62d 100644 --- a/_includes/devdoc/dash-core/rpcs/quick-reference.md +++ b/_includes/devdoc/dash-core/rpcs/quick-reference.md @@ -125,6 +125,7 @@ These RPCs are all Dash-specific and not found in Bitcoin Core * [GetBlockHashes][rpc getblockhashes]: {{summary_getBlockHashes}} {{DASH_NEW0_12_1}} * [GetBlockHeader][rpc getblockheader]: {{summary_getBlockHeader}} {{NEW0_12_0}} * [GetBlockHeaders][rpc getblockheaders]: {{summary_getBlockHeaders}} {{DASH_NEW0_12_1}} +* [GetBlockStats][rpc getblockstats]: {{summary_getBlockStats}} {{DASH_NEW0_14_1}} * [GetChainTips][rpc getchaintips]: {{summary_getChainTips}} {{DASH_UPDATED0_12_3}} * [GetChainTxStats][rpc getchaintxstats]: {{summary_getChainTxStats}} {{DASH_NEW0_14_1}} * [GetDifficulty][rpc getdifficulty]: {{summary_getDifficulty}} diff --git a/_includes/devdoc/dash-core/rpcs/rpcs/estimatesmartfee.md b/_includes/devdoc/dash-core/rpcs/rpcs/estimatesmartfee.md index f7dd3746..d92d7fec 100644 --- a/_includes/devdoc/dash-core/rpcs/rpcs/estimatesmartfee.md +++ b/_includes/devdoc/dash-core/rpcs/rpcs/estimatesmartfee.md @@ -4,6 +4,8 @@ http://opensource.org/licenses/MIT. {% endcomment %} {% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/estimatesmartfee.md" %} + + ##### EstimateSmartFee {% include helpers/subhead-links.md %} @@ -13,23 +15,23 @@ http://opensource.org/licenses/MIT. The `estimatesmartfee` RPC {{summary_estimateSmartFee}} -*Parameter #1---how many blocks the transaction may wait before being included* +*Parameter #1---how many confirmations the transaction may wait before being included* {% itemplate ntpd1 %} -- n: "Blocks" +- n: "conf_target" t: "number (int)" p: "Required
(exactly 1)" - d: "The maximum number of blocks a transaction should have to wait before it is predicted to be included in a block. Has to be between 1 and 25 blocks" + d: "Confirmation target in blocks (1 - 1008)" {% enditemplate %} -*Parameter #2---conservative* +*Parameter #2---estimate mode* {% itemplate ntpd1 %} -- n: "conservative" - t: "bool" - p: "Optional
Default=`true`" - d: "Whether to return a more conservative estimate which also satisfies a longer history. A conservative estimate potentially returns a higher feerate and is more likely to be sufficient for the desired target, but is not as responsive to short term drops in the prevailing fee market" +- n: "estimate_mode" + t: "string" + p: "Optional
Default=
`CONSERVATIVE`" + d: "The fee estimate mode. Whether to return a more conservative estimate which also satisfies a longer history. A conservative estimate potentially returns a higher feerate and is more likely to be sufficient for the desired target, but is not as responsive to short term drops in the prevailing fee market. Must be one of:
`UNSET` (defaults to `CONSERVATIVE`)
`ECONOMICAL`
`CONSERVATIVE`" {% enditemplate %} @@ -43,8 +45,13 @@ The `estimatesmartfee` RPC {{summary_estimateSmartFee}} - n: "→
`feerate`" t: "number (Dash)" - p: "Required
(exactly 1)" - d: "The estimated fee the transaction should pay in order to be included within the specified number of blocks. If the node doesn't have enough information to make an estimate, the value `-1` will be returned" + p: "Optional
(0 or 1)" + d: "The estimated fee the transaction should pay in order to be included within the specified number of blocks. If the node doesn't have enough information to make an estimate, this field will not be returned" + +- n: "→
`error`" + t: "JSON array (strings)" + p: "Optional
(0 or 1)" + d: "Errors encountered during processing" - n: "→
`blocks`" t: "number" @@ -52,7 +59,7 @@ The `estimatesmartfee` RPC {{summary_estimateSmartFee}} d: "Block number where the estimate was found" {% enditemplate %} -*Examples from Dash Core 0.12.2* +*Examples from Dash Core 0.14.1* {% highlight bash %} dash-cli estimatesmartfee 6 @@ -70,15 +77,17 @@ Result: Requesting data the node can't calculate (out of range): {% highlight bash %} -dash-cli estimatesmartfee 100 +dash-cli estimatesmartfee 2 {% endhighlight %} Result: {% highlight json %} { - "feerate": -1, - "blocks": 100 + "errors": [ + "Insufficient data or no feerate found" + ], + "blocks": 2 } {% endhighlight %} diff --git a/_includes/devdoc/dash-core/rpcs/rpcs/getblockstats.md b/_includes/devdoc/dash-core/rpcs/rpcs/getblockstats.md new file mode 100644 index 00000000..9aa33261 --- /dev/null +++ b/_includes/devdoc/dash-core/rpcs/rpcs/getblockstats.md @@ -0,0 +1,192 @@ +{% comment %} +This file is licensed under the MIT License (MIT) available on +http://opensource.org/licenses/MIT. +{% endcomment %} +{% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/getblockstats.md" %} + + +##### GetBlockStats +{% include helpers/subhead-links.md %} + +{% assign summary_getBlockStats="computes per block statistics for a given window." %} + +{% autocrossref %} + +The `getblockstats` RPC {{summary_getBlockStats}} + +All amounts are in duffs. + +It won't work for some heights with pruning. It won't work without `-txindex` for +`utxo_size_inc`, `*fee` or `*feerate` stats. + +*Parameter #1---hash_or_height* + +{% itemplate ntpd1 %} +- n: "hash_or_height" + t: "string or numeric" + p: "Required
(exactly 1)" + d: "The block hash or height of the target block" + +{% enditemplate %} + +*Parameter #2---stats* + +{% itemplate ntpd1 %} +- n: "stats" + t: "array" + p: "optional" + d: "Values to plot, by default all values (see result below)" + +{% enditemplate %} + +*Result---a JSON object containing the requested statistics* + +{% itemplate ntpd1 %} +- n: "`result`" + t: "object/null" + p: "Required
(exactly 1)" + d: "An object containing stats for the requested block, or JSON `null` if an error occurred" + +- n: "→
`avgfee`" + t: "numeric" + p: "Required
(exactly 1)" + d: "Average fee in the block" + +- n: "→
`avgfeerate`" + t: "numeric" + p: "Required
(exactly 1)" + d: "Average feerate (in duffs per byte)" + +- n: "→
`avgtxsize`" + t: "numeric" + p: "Required
(exactly 1)" + d: "Average transaction size" + +- n: "→
`blockhash`" + t: "string (hex)" + p: "Required
(exactly 1)" + d: "The block hash (to check for potential reorgs)" + +- n: "→
`height`" + t: "numeric" + p: "Required
(exactly 1)" + d: "The height of the block" + +- n: "→
`ins`" + t: "numeric" + p: "Required
(exactly 1)" + d: "The number of inputs (excluding coinbase)" + +- n: "→
`maxfee`" + t: "numeric" + p: "Required
(exactly 1)" + d: "Maximum fee in the block" + +- n: "→
`maxfeerate`" + t: "numeric" + p: "Required
(exactly 1)" + d: "Maximum feerate (in duffs per byte)" + +- n: "→
`maxtxsize`" + t: "numeric" + p: "Required
(exactly 1)" + d: "Maximum transaction size" + +- n: "→
`medianfee`" + t: "numeric" + p: "Required
(exactly 1)" + d: "Truncated median fee in the block" + +- n: "→
`medianfeerate`" + t: "numeric" + p: "Required
(exactly 1)" + d: "Truncated median feerate (in duffs per byte)" + +- n: "→
`mediantime`" + t: "numeric" + p: "Required
(exactly 1)" + d: "The block median time past" + +- n: "→
`mediantxsize`" + t: "numeric" + p: "Required
(exactly 1)" + d: "Truncated median transaction size" + +- n: "→
`minfee`" + t: "numeric" + p: "Required
(exactly 1)" + d: "Minimum fee in the block" + +- n: "→
`minfeerate`" + t: "numeric" + p: "Required
(exactly 1)" + d: "Minimum feerate (in duffs per byte)" + +- n: "→
`mintxsize`" + t: "numeric" + p: "Required
(exactly 1)" + +- n: "→
`outs`" + t: "numeric" + p: "Required
(exactly 1)" + d: "The number of outputs" + +- n: "→
`subsidy`" + t: "numeric" + p: "Required
(exactly 1)" + d: "The block subsidy" + +- n: "→
`time`" + t: "number (real)" + p: "Required
(exactly 1)" + d: "The block time" + +- n: "→
`total_out`" + t: "numeric" + p: "Required
(exactly 1)" + d: "Total amount in all outputs (excluding coinbase and thus reward [i.e. subsidy + totalfee])" + +- n: "→
`total_size`" + t: "numeric" + p: "Required
(exactly 1)" + d: "Total size of all non-coinbase transactions" + +- n: "→
`totalfee`" + t: "numeric" + p: "Required
(exactly 1)" + d: "The fee total" + +- n: "→
`txs`" + t: "numeric" + p: "Required
(exactly 1)" + d: "The number of transactions (excluding coinbase)" + +- n: "→
`utxo_increase`" + t: "numeric" + p: "Required
(exactly 1)" + d: "The increase/decrease in the number of unspent outputs" + +- n: "→
`utxo_size_inc`" + t: "numeric" + p: "Required
(exactly 1)" + d: "The increase/decrease in size for the utxo index (not discounting op_return and similar)" +{% enditemplate %} + +*Example from Dash Core 0.14.1* + +{% highlight bash %} +dash-cli getblockstats 1000 '["blockhash","subsidy", "txs"]' +{% endhighlight %} + +Result: +{% highlight json %} +{ + "blockhash": "000004e906762c8c70583418d46915b4271fa83c29d5b88544d05e09e3f3621d", + "subsidy": 50000000000, + "txs": 1 +} +{% endhighlight %} + +*See also: none* + +{% endautocrossref %} diff --git a/_includes/devdoc/dash-core/rpcs/rpcs/getmempoolentry.md b/_includes/devdoc/dash-core/rpcs/rpcs/getmempoolentry.md index 2fe12c89..3c8da3f4 100644 --- a/_includes/devdoc/dash-core/rpcs/rpcs/getmempoolentry.md +++ b/_includes/devdoc/dash-core/rpcs/rpcs/getmempoolentry.md @@ -13,7 +13,7 @@ http://opensource.org/licenses/MIT. {% autocrossref %} -*Added in Dash Core 0.12.3* +*Added in Dash Core 0.14.0* The `getmempoolentry` RPC {{summary_getMemPoolEntry}} diff --git a/_includes/devdoc/dash-core/rpcs/rpcs/signrawtransaction.md b/_includes/devdoc/dash-core/rpcs/rpcs/signrawtransaction.md index 1fabd99a..7058445e 100644 --- a/_includes/devdoc/dash-core/rpcs/rpcs/signrawtransaction.md +++ b/_includes/devdoc/dash-core/rpcs/rpcs/signrawtransaction.md @@ -4,6 +4,8 @@ http://opensource.org/licenses/MIT. {% endcomment %} {% assign filename="_includes/devdoc/dash-core/rpcs/rpcs/signrawtransaction.md" %} + + ##### SignRawTransaction {% include helpers/subhead-links.md %} @@ -56,6 +58,10 @@ The `signrawtransaction` RPC {{summary_signRawTransaction}} p: "Optional
(0 or 1)" d: "If the pubkey script was a script hash, this must be the corresponding redeem script" +- n: "→ →
`amount`" + t: "numeric" + p: "Required
(exactly 1)" + d: "The amount of Dash spent" {% enditemplate %} *Parameter #3---private keys for signing* diff --git a/_includes/helpers/summaries.md b/_includes/helpers/summaries.md index 2d1204e7..5a712812 100644 --- a/_includes/helpers/summaries.md +++ b/_includes/helpers/summaries.md @@ -44,6 +44,7 @@ This file is licensed under the terms of its source texts{%endcomment%} {% assign summary_getBlockHashes="returns array of hashes of blocks within the timestamp range provided (requires `timestampindex` to be enabled)." %} {% assign summary_getBlockHeader="gets a block header with a particular header hash from the local block database either as a JSON object or as a serialized block header." %} {% assign summary_getBlockHeaders="returns an array of items with information about the requested number of blockheaders starting from the requested hash." %} +{% assign summary_getBlockStats="computes per block statistics for a given window." %} {% assign summary_getBlockTemplate="gets a block template or proposal for use with mining software." %} {% assign summary_getChainTips="returns information about the highest-height block (tip) of each local block chain." %} {% assign summary_getChainTxStats="compute statistics about the total number and rate of transactions in the chain." %} diff --git a/_includes/layout/base/rpc-table.html b/_includes/layout/base/rpc-table.html index 820fbd10..a6bf7c2b 100644 --- a/_includes/layout/base/rpc-table.html +++ b/_includes/layout/base/rpc-table.html @@ -115,6 +115,12 @@ th.tg-sort-header::-moz-selection { background:transparent; }th.tg-sort-header:: Y 0.12.1 + + Blockchain + GetBlockStats + Y + Added in 0.14.1 + Blockchain GetChainTips diff --git a/_includes/references.md b/_includes/references.md index f6d62ef4..a6949306 100644 --- a/_includes/references.md +++ b/_includes/references.md @@ -111,6 +111,7 @@ http://opensource.org/licenses/MIT. [rpc getblockhashes]: /en/developer-reference#getblockhashes [rpc getblockheader]: /en/developer-reference#getblockheader [rpc getblockheaders]: /en/developer-reference#getblockheaders +[rpc getblockstats]: /en/developer-reference#getblockstats [rpc getblocktemplate]: /en/developer-reference#getblocktemplate [rpc getchaintips]: /en/developer-reference#getchaintips [rpc getchaintxstats]: /en/developer-reference#getchaintxstats diff --git a/en/developer-reference.md b/en/developer-reference.md index 85658c35..75ab1fc8 100644 --- a/en/developer-reference.md +++ b/en/developer-reference.md @@ -156,6 +156,8 @@ untrusted source. {% include devdoc/dash-core/rpcs/rpcs/getblockheaders.md %} +{% include devdoc/dash-core/rpcs/rpcs/getblockstats.md %} + {% include devdoc/dash-core/rpcs/rpcs/getblocktemplate.md %} {% include devdoc/dash-core/rpcs/rpcs/getchaintips.md %}