Update existing Mining RPCs

- GetMiningInfo, GetNetworkHashPs, PrioritiseTransaction, SubmitBlock
This commit is contained in:
thephez 2017-10-11 16:43:30 -04:00
parent 64a160198b
commit 52910cecdd
6 changed files with 72 additions and 43 deletions

View file

@ -18,7 +18,30 @@ information, please see the following resources:
* [BIP22][]
* [BIP23][]
*Parameters: none*
*Parameter #1---a JSON request object*
{% itemplate ntpd1 %}
- n: "Request"
t: "object"
p: "Optional<br>(exactly 1)"
d: "A JSON request object"
- n: "→<br>`mode`"
t: "string"
p: "Optional<br>(exactly 1)"
d: "This must be set to \"template\" or omitted"
- n: "→<br>`capabilities`"
t: "array (string)"
p: "Optional<br>(0 or more)"
d: "A list of strings"
- n: "→ →<br>Capability"
t: "string"
p: "Optional<br>(exactly 1)"
d: "Client side supported feature, `longpoll`, `coinbasetxn`, `coinbasevalue`, `proposal`, `serverlist`, `workid`"
{% enditemplate %}
*Result---block template*

View file

@ -51,7 +51,7 @@ The `getmininginfo` RPC {{summary_getMiningInfo}}
- n: "→<br>`genproclimit`"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "*Removed in Bitcoin Core 0.13.0*<br><br>The limit on the number of processors to use for generation. If generation was enabled since the last time this node was restarted, this is the number used in the second parameter of the `setgenerate` RPC (or the default). Otherwise, it is `-1`"
d: "The processor limit for generation (-1 if no generation - see getgenerate or setgenerate calls).<br><br>*Removed in Bitcoin Core 0.13.0*"
- n: "→<br>`networkhashps`"
t: "number (int)"
@ -66,7 +66,7 @@ The `getmininginfo` RPC {{summary_getMiningInfo}}
- n: "→<br>`testnet`"
t: "bool"
p: "Required<br>(exactly 1)"
d: "*Removed in Bitcoin Core 0.14.0*<br><br>Set to `true` if this node is running on testnet. Set to `false` if this node is on mainnet or a regtest"
d: "Set to `true` if this node is running on testnet. Set to `false` if this node is on mainnet or a regtest<br><br>*Removed in Bitcoin Core 0.14.0*"
- n: "→<br>`chain`"
t: "string"
@ -76,34 +76,31 @@ The `getmininginfo` RPC {{summary_getMiningInfo}}
- n: "→<br>`generate`"
t: "bool"
p: "Optional<br>(0 or 1)"
d: "*Removed in Bitcoin Core 0.13.0*<br><br>Set to `true` if generation is currently enabled; set to `false` if generation is currently disabled. Only returned if the node has wallet support enabled"
- n: "→<br>`hashespersec`"
t: "number (int)"
p: "Optional<br>(0 or 1)"
d: "*Removed in Bitcoin Core 0.11.0*<br><br>The approximate number of hashes per second this node is generating across all CPUs, if generation is enabled. Otherwise `0`. Only returned if the node has wallet support enabled"
d: "Set to `true` if generation is currently enabled; set to `false` if generation is currently disabled. Only returned if the node has wallet support enabled<br><br>*Removed in Bitcoin Core 0.13.0*"
{% enditemplate %}
*Example from Bitcoin Core 0.14.1*
*Example from Dash Core 0.12.2*
{% highlight bash %}
bitcoin-cli getmininginfo
dash-cli getmininginfo
{% endhighlight %}
Result:
{% highlight json %}
{
"blocks": 464545,
"blocks": 8036,
"currentblocksize": 0,
"currentblockweight": 0,
"currentblocktx": 0,
"difficulty": 521974519553.6282,
"difficulty": 0.8239043524175907,
"errors": "",
"networkhashps": 4.126888339085874e+18,
"pooledtx": 31241,
"chain": "main"
"genproclimit": 1,
"networkhashps": 22234635.4469006,
"pooledtx": 3,
"testnet": true,
"chain": "test",
"generate": false
}
{% endhighlight %}

View file

@ -7,7 +7,7 @@ http://opensource.org/licenses/MIT.
##### GetNetworkHashPS
{% include helpers/subhead-links.md %}
{% assign summary_getNetworkHashPS="returns the estimated current or historical network hashes per second based on the last *n* blocks." %}
{% assign summary_getNetworkHashPS="returns the estimated network hashes per second based on the last n blocks." %}
{% autocrossref %}
@ -16,7 +16,7 @@ The `getnetworkhashps` RPC {{summary_getNetworkHashPS}}
*Parameter #1---number of blocks to average*
{% itemplate ntpd1 %}
- n: "Blocks"
- n: "`blocks`"
t: "number (int)"
p: "Optional<br>(0 or 1)"
d: "The number of blocks to average together for calculating the estimated hashes per second. Default is `120`. Use `-1` to average all blocks produced since the last difficulty change"
@ -26,7 +26,7 @@ The `getnetworkhashps` RPC {{summary_getNetworkHashPS}}
*Parameter #2---block height*
{% itemplate ntpd1 %}
- n: "Height"
- n: "`height`"
t: "number (int)"
p: "Optional<br>(0 or 1)"
d: "The height of the last block to use for calculating the average. Defaults to `-1` for the highest-height block on the local best block chain. If the specified height is higher than the highest block on the local best block chain, it will be interpreted the same as `-1`"
@ -43,19 +43,19 @@ The `getnetworkhashps` RPC {{summary_getNetworkHashPS}}
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
*Example from Dash Core 0.12.2*
Get the average hashes per second for all the blocks since the last
difficulty change before block 227255.
difficulty change before block 6000.
{% highlight bash %}
bitcoin-cli -testnet getnetworkhashps -1 227255
dash-cli -testnet getnetworkhashps -1 6000
{% endhighlight %}
Result:
{% highlight json %}
79510076167
22214011.90821117
{% endhighlight %}
*See also*

View file

@ -39,7 +39,7 @@ The `prioritisetransaction` RPC {{summary_prioritiseTransaction}}
- n: "Fee"
t: "number (int)"
p: "Required<br>(exactly 1)"
d: "**Warning:** this value is in satoshis, not bitcoins<br><br>If positive, the virtual fee to add to the actual fee paid by the transaction; if negative, the virtual fee to subtract from the actual fee paid by the transaction. No change is made to the actual fee paid by the transaction"
d: "**Warning:** this value is in duffs, not Dash<br><br>If positive, the virtual fee to add to the actual fee paid by the transaction; if negative, the virtual fee to subtract from the actual fee paid by the transaction. No change is made to the actual fee paid by the transaction"
{% enditemplate %}
@ -53,11 +53,11 @@ The `prioritisetransaction` RPC {{summary_prioritiseTransaction}}
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
*Example from Dash Core 0.12.2*
{% highlight bash %}
bitcoin-cli -testnet prioritisetransaction \
fe0165147da737e16f5096ab6c1709825217377a95a882023ed089a89af4cff9 \
dash-cli -testnet prioritisetransaction \
f86c74f27fdd9c7e618d69b3606eeae1710b3f02fabede6ae8c88dd7bb756942 \
1234 456789
{% endhighlight %}

View file

@ -7,7 +7,7 @@ http://opensource.org/licenses/MIT.
##### SubmitBlock
{% include helpers/subhead-links.md %}
{% assign summary_submitBlock="accepts a block, verifies it is a valid addition to the block chain, and broadcasts it to the network. Extra parameters are ignored by Bitcoin Core but may be used by mining pools or other programs." %}
{% assign summary_submitBlock="accepts a block, verifies it is a valid addition to the block chain, and broadcasts it to the network. Extra parameters are ignored by Dash Core but may be used by mining pools or other programs." %}
{% autocrossref %}
@ -29,7 +29,7 @@ The `submitblock` RPC {{summary_submitBlock}}
- n: "Parameters"
t: "object"
p: "Optional<br>(0 or 1)"
d: "A JSON object containing extra parameters. Not used directly by Bitcoin Core and also not broadcast to the network. This is available for use by mining pools and other software. A common parameter is a `workid` string"
d: "A JSON object containing extra parameters. Not used directly by Dash Core and also not broadcast to the network. This is available for use by mining pools and other software. A common parameter is a `workid` string"
{% enditemplate %}
@ -43,18 +43,27 @@ The `submitblock` RPC {{summary_submitBlock}}
{% enditemplate %}
*Example from Bitcoin Core 0.10.0*
*Example from Dash Core 0.12.2*
Submit the following block with the workid, "test".
{% highlight bash %}
bitcoin-cli -testnet submitblock 02000000df11c014a8d798395b5059c\
722ebdf3171a4217ead71bf6e0e99f4c7000000004a6f6a2db225c81e77773f6\
f0457bcb05865a94900ed11356d0b75228efb38c7785d6053ffff001d005d437\
0010100000001000000000000000000000000000000000000000000000000000\
0000000000000ffffffff0d03b477030164062f503253482fffffffff0100f90\
29500000000232103adb7d8ef6b63de74313e0cd4e07670d09a169b13e4eda2d\
650f529332c47646dac00000000 \
dash-cli -testnet submitblock 0100002032e3965d5fdd7a883209d516599337eb4cb82f\
7aea22ecc114942c1f00000000244388a3bd2c38a85bf337755a1a165d0df2b335e3886058\
40e08a3cdf1ce1a4297ede598f6a011d027c1c300201000000010000000000000000000000\
000000000000000000000000000000000000000000ffffffff1202791f0e2f5032506f6f6c\
2d74444153482fffffffff044d75bb8b010000001976a914d4a5ea2641e9dd37f7a5ad5c92\
9df4743518769188acac2ea68f010000001976a9148d0934de58f969df3b53a72b4f47211d\
890ebf5588ac68b9ea03000000004341047559d13c3f81b1fadbd8dd03e4b5a1c73b05e2b9\
80e00d467aa9440b29c7de23664dde6428d75cafed22ae4f0d302e26c5c5a5dd4d3e1b796d\
7281bdc9430f35ac00000000000000002a6a28f47e935509fc85533dc78197e93e87d1c793\
43bda495429d8e3680069f6a22780000000002000000000000000100000001078e0c77e3b0\
4323d0834841f965543aaae2b275f684f55fbaf22e1c83bff97e010000006a473044022077\
6e96d202cc4f50f79d269d7cd36712c7486282dda0cb6eae583c916c98b34c022070941efb\
3201cf500cc6b879d6570fc477d4c3e6a8d91286e84465235f542c42012102dddbfc3fe06b\
96e3a36f3e815222cd1cb9586b3193c4a0de030477f621956d51feffffff02a00bd1000000\
00001976a914d7b47d4b40a23c389f5a17754d7f60f511c7d0ec88ac316168821300000019\
76a914c9190e507834b78a624d7578f1ad3819592ca1aa88ac771f0000 \
'{ "workid": "test" }'
{% endhighlight %}

View file

@ -54,7 +54,7 @@ This file is licensed under the terms of its source texts{%endcomment%}
{% assign summary_getMemoryInfo="returns information about memory usage." %}
{% assign summary_getMiningInfo="returns various mining-related information." %}
{% assign summary_getNetTotals="returns information about network traffic, including bytes in, bytes out, and the current time." %}
{% assign summary_getNetworkHashPS="returns the estimated current or historical network hashes per second based on the last *n* blocks." %}
{% assign summary_getNetworkHashPS="returns the estimated network hashes per second based on the last n blocks." %}
{% assign summary_getNetworkInfo="returns information about the node's connection to the network." %}
{% assign summary_getNewAddress="returns a new Bitcoin address for receiving payments. If an account is specified, payments received with the address will be credited to that account." %}
{% assign summary_getPeerInfo="returns data about each connected network node." %}