mirror of
https://github.com/seigler/dash-docs
synced 2025-07-27 09:46:12 +00:00
RPC backports (#161)
* RPC - Update estimatesmartfee Change params, results, and example * RPC - Update signrawtransaction to include amount * RPC - Add getblockstats * Formatting corrections
This commit is contained in:
parent
471899ae2d
commit
4e64bcbf89
11 changed files with 237 additions and 16 deletions
|
@ -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}}
|
||||
|
|
|
@ -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<br>(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<br>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<br>Default=<br>`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:<br>`UNSET` (defaults to `CONSERVATIVE`)<br>`ECONOMICAL`<br>`CONSERVATIVE`"
|
||||
|
||||
{% enditemplate %}
|
||||
|
||||
|
@ -43,8 +45,13 @@ The `estimatesmartfee` RPC {{summary_estimateSmartFee}}
|
|||
|
||||
- n: "→<br>`feerate`"
|
||||
t: "number (Dash)"
|
||||
p: "Required<br>(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<br>(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: "→<br>`error`"
|
||||
t: "JSON array (strings)"
|
||||
p: "Optional<br>(0 or 1)"
|
||||
d: "Errors encountered during processing"
|
||||
|
||||
- n: "→<br>`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 %}
|
||||
|
||||
|
|
192
_includes/devdoc/dash-core/rpcs/rpcs/getblockstats.md
Normal file
192
_includes/devdoc/dash-core/rpcs/rpcs/getblockstats.md
Normal file
|
@ -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<br>(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<br>(exactly 1)"
|
||||
d: "An object containing stats for the requested block, or JSON `null` if an error occurred"
|
||||
|
||||
- n: "→<br>`avgfee`"
|
||||
t: "numeric"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "Average fee in the block"
|
||||
|
||||
- n: "→<br>`avgfeerate`"
|
||||
t: "numeric"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "Average feerate (in duffs per byte)"
|
||||
|
||||
- n: "→<br>`avgtxsize`"
|
||||
t: "numeric"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "Average transaction size"
|
||||
|
||||
- n: "→<br>`blockhash`"
|
||||
t: "string (hex)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The block hash (to check for potential reorgs)"
|
||||
|
||||
- n: "→<br>`height`"
|
||||
t: "numeric"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The height of the block"
|
||||
|
||||
- n: "→<br>`ins`"
|
||||
t: "numeric"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The number of inputs (excluding coinbase)"
|
||||
|
||||
- n: "→<br>`maxfee`"
|
||||
t: "numeric"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "Maximum fee in the block"
|
||||
|
||||
- n: "→<br>`maxfeerate`"
|
||||
t: "numeric"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "Maximum feerate (in duffs per byte)"
|
||||
|
||||
- n: "→<br>`maxtxsize`"
|
||||
t: "numeric"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "Maximum transaction size"
|
||||
|
||||
- n: "→<br>`medianfee`"
|
||||
t: "numeric"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "Truncated median fee in the block"
|
||||
|
||||
- n: "→<br>`medianfeerate`"
|
||||
t: "numeric"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "Truncated median feerate (in duffs per byte)"
|
||||
|
||||
- n: "→<br>`mediantime`"
|
||||
t: "numeric"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The block median time past"
|
||||
|
||||
- n: "→<br>`mediantxsize`"
|
||||
t: "numeric"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "Truncated median transaction size"
|
||||
|
||||
- n: "→<br>`minfee`"
|
||||
t: "numeric"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "Minimum fee in the block"
|
||||
|
||||
- n: "→<br>`minfeerate`"
|
||||
t: "numeric"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "Minimum feerate (in duffs per byte)"
|
||||
|
||||
- n: "→<br>`mintxsize`"
|
||||
t: "numeric"
|
||||
p: "Required<br>(exactly 1)"
|
||||
|
||||
- n: "→<br>`outs`"
|
||||
t: "numeric"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The number of outputs"
|
||||
|
||||
- n: "→<br>`subsidy`"
|
||||
t: "numeric"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The block subsidy"
|
||||
|
||||
- n: "→<br>`time`"
|
||||
t: "number (real)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The block time"
|
||||
|
||||
- n: "→<br>`total_out`"
|
||||
t: "numeric"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "Total amount in all outputs (excluding coinbase and thus reward [i.e. subsidy + totalfee])"
|
||||
|
||||
- n: "→<br>`total_size`"
|
||||
t: "numeric"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "Total size of all non-coinbase transactions"
|
||||
|
||||
- n: "→<br>`totalfee`"
|
||||
t: "numeric"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The fee total"
|
||||
|
||||
- n: "→<br>`txs`"
|
||||
t: "numeric"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The number of transactions (excluding coinbase)"
|
||||
|
||||
- n: "→<br>`utxo_increase`"
|
||||
t: "numeric"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The increase/decrease in the number of unspent outputs"
|
||||
|
||||
- n: "→<br>`utxo_size_inc`"
|
||||
t: "numeric"
|
||||
p: "Required<br>(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 %}
|
|
@ -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}}
|
||||
|
||||
|
|
|
@ -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<br>(0 or 1)"
|
||||
d: "If the pubkey script was a script hash, this must be the corresponding redeem script"
|
||||
|
||||
- n: "→ →<br>`amount`"
|
||||
t: "numeric"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The amount of Dash spent"
|
||||
{% enditemplate %}
|
||||
|
||||
*Parameter #3---private keys for signing*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue