mirror of
https://github.com/seigler/dash-docs
synced 2025-07-28 10:16:15 +00:00
Update Generating RPCs
- Added details back for GetGenerate/SetGenerate which were deprecated in Bitcoin
This commit is contained in:
parent
0c33d487a6
commit
252512bbf8
6 changed files with 101 additions and 35 deletions
|
@ -152,8 +152,8 @@ These RPCs are all Dash-specific and not found in Bitcoin Core
|
|||
{% autocrossref %}
|
||||
|
||||
* [Generate][rpc generate]: {{summary_generate}} {{NEW0_11_0}}, {{UPDATED0_13_0}}
|
||||
* [GetGenerate][rpc getgenerate]: {{summary_getgenerate}}
|
||||
* [SetGenerate][rpc setgenerate]: {{summary_setgenerate}}
|
||||
* [GetGenerate][rpc getgenerate]: {{summary_getGenerate}}
|
||||
* [SetGenerate][rpc setgenerate]: {{summary_setGenerate}}
|
||||
* {{DASH_NOT_IMPLEMENTED}} [GenerateToAddress][rpc generatetoaddress]: {{summary_generateToAddress}} {{NEW0_13_0}}
|
||||
|
||||
{% endautocrossref %}
|
||||
|
|
|
@ -7,31 +7,21 @@ http://opensource.org/licenses/MIT.
|
|||
##### Generate
|
||||
{% include helpers/subhead-links.md %}
|
||||
|
||||
{% assign summary_generate="nearly instantly generates blocks." %}
|
||||
{% assign summary_generate="mines blocks immediately (before the RPC call returns)." %}
|
||||
|
||||
{% autocrossref %}
|
||||
|
||||
*Requires wallet support.*
|
||||
*Requires wallet support. Can only be used on the regtest network.*
|
||||
|
||||
The `generate` RPC {{summary_generate}}
|
||||
|
||||
*Parameter #1---the number of blocks to generate*
|
||||
|
||||
{% itemplate ntpd1 %}
|
||||
- n: "Blocks"
|
||||
- n: "`numblocks`"
|
||||
t: "number (int)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The number of blocks to generate. The RPC call will not return until all blocks have been generated or the maxium number of iterations has been reached"
|
||||
|
||||
{% enditemplate %}
|
||||
|
||||
*Parameter #2---the maximum number of iterations to try*
|
||||
|
||||
{% itemplate ntpd1 %}
|
||||
- n: "Maxtries"
|
||||
t: "number (int)"
|
||||
p: "Optional<br>(0 or 1)"
|
||||
d: "The maximum number of iterations that are tried to create the requested number of blocks. Default is `1000000`"
|
||||
d: "The number of blocks to generate. The RPC call will not return until all blocks have been generated."
|
||||
|
||||
{% enditemplate %}
|
||||
|
||||
|
@ -49,27 +39,29 @@ The `generate` RPC {{summary_generate}}
|
|||
d: "The hashes of the headers of the blocks generated in regtest mode, as hex in RPC byte order"
|
||||
{% enditemplate %}
|
||||
|
||||
*Example from Bitcoin Core 0.13.1*
|
||||
*Example from Dash Core 0.12.2*
|
||||
|
||||
Using regtest mode (also works in normal mode), generate 2 blocks:
|
||||
Using regtest mode, generate 2 blocks:
|
||||
|
||||
{% highlight bash %}
|
||||
bitcoin-cli -regtest generate 2 500000
|
||||
dash-cli -regtest generate 2
|
||||
{% endhighlight %}
|
||||
|
||||
Result:
|
||||
|
||||
{% highlight json %}
|
||||
[
|
||||
"36252b5852a5921bdfca8701f936b39edeb1f8c39fffe73b0d8437921401f9af",
|
||||
"5f2956817db1e386759aa5794285977c70596b39ea093b9eab0aa4ba8cd50c06"
|
||||
"55a4c47da8151c0823eec22c41ebc6d690a0288302179625bae9eb6f36808266",
|
||||
"3f07b9aa4e3bcd5518610945c4a6b32699acac71b1762605ff79ba553111fc79"
|
||||
]
|
||||
{% endhighlight %}
|
||||
|
||||
*See also*
|
||||
|
||||
* [GenerateToAddress][rpc generatetoaddress]: {{summary_generateToAddress}}
|
||||
* [GetMiningInfo][rpc getmininginfo]: {{summary_getMiningInfo}}
|
||||
* [GetBlockTemplate][rpc getblocktemplate]: {{summary_getBlockTemplate}}
|
||||
* [GetGenerate][rpc getgenerate]: {{summary_getGenerate}}
|
||||
* [GetMiningInfo][rpc getmininginfo]: {{summary_getMiningInfo}}
|
||||
* [SetGenerate][rpc setgenerate]: {{summary_setGenerate}}
|
||||
|
||||
{% endautocrossref %}
|
||||
|
|
|
@ -13,6 +13,9 @@ http://opensource.org/licenses/MIT.
|
|||
|
||||
*Added in Bitcoin Core 0.13.0*
|
||||
|
||||
**_Not implemented in Dash Core (as of 0.12.2)_**
|
||||
|
||||
{% comment %}
|
||||
*Requires wallet support.*
|
||||
|
||||
The `generatetoaddress` RPC {{summary_generateToAddress}}
|
||||
|
@ -24,7 +27,7 @@ The `generatetoaddress` RPC {{summary_generateToAddress}}
|
|||
t: "number (int)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The number of blocks to generate. The RPC call will not return until all blocks have been generated or the maxium number of iterations has been reached"
|
||||
|
||||
|
||||
{% enditemplate %}
|
||||
|
||||
*Parameter #2---a transaction identifier (TXID)*
|
||||
|
@ -34,7 +37,7 @@ The `generatetoaddress` RPC {{summary_generateToAddress}}
|
|||
t: "string (base58)"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "The address to send the newly generated Bitcoin to"
|
||||
|
||||
|
||||
{% enditemplate %}
|
||||
|
||||
*Parameter #3---the maximum number of iterations to try*
|
||||
|
@ -85,4 +88,6 @@ Result:
|
|||
* [GetMiningInfo][rpc getmininginfo]: {{summary_getMiningInfo}}
|
||||
* [GetBlockTemplate][rpc getblocktemplate]: {{summary_getBlockTemplate}}
|
||||
|
||||
{% endcomment %}
|
||||
|
||||
{% endautocrossref %}
|
||||
|
|
|
@ -7,20 +7,45 @@ http://opensource.org/licenses/MIT.
|
|||
##### GetGenerate
|
||||
{% include helpers/subhead-links.md %}
|
||||
|
||||
{% assign summary_getGenerate="was removed in Bitcoin Core 0.13.0." %}
|
||||
{% assign summary_getGenerate="returns if the server is set to generate coins or not." %}
|
||||
|
||||
{% autocrossref %}
|
||||
|
||||
*Requires wallet support.*
|
||||
|
||||
The `getgenerate` RPC {{summary_getGenerate}} If you have an older
|
||||
version of Bitcoin Core, use `help getgenerate` to get help.
|
||||
*Removed in Bitcoin Core 0.13.0.*
|
||||
|
||||
The `getgenerate` RPC {{summary_getGenerate}}
|
||||
|
||||
*Parameters: none*
|
||||
|
||||
*Result---whether the server is set to generate blocks*
|
||||
|
||||
{% itemplate ntpd1 %}
|
||||
- n: "`result`"
|
||||
t: "bool"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "Set to `true` if the server is set to generate blocks; set to `false` if it is not"
|
||||
|
||||
{% enditemplate %}
|
||||
|
||||
*Example from Dash Core 0.12.2*
|
||||
|
||||
{% highlight bash %}
|
||||
dash-cli -regtest getgenerate
|
||||
{% endhighlight %}
|
||||
|
||||
Result:
|
||||
|
||||
{% highlight json %}
|
||||
false
|
||||
{% endhighlight %}
|
||||
|
||||
*See also*
|
||||
|
||||
* [Generate][rpc generate]: {{summary_generate}}
|
||||
* [GenerateToAddress][rpc generatetoaddress]: {{summary_generateToAddress}}
|
||||
* [GetMiningInfo][rpc getmininginfo]: {{summary_getMiningInfo}}
|
||||
|
||||
* [SetGenerate][rpc setgenerate]: {{summary_setGenerate}}
|
||||
|
||||
{% endautocrossref %}
|
||||
|
|
|
@ -7,16 +7,58 @@ http://opensource.org/licenses/MIT.
|
|||
##### SetGenerate
|
||||
{% include helpers/subhead-links.md %}
|
||||
|
||||
{% assign summary_setGenerate="was removed in Bitcoin Core 0.13.0." %}
|
||||
{% assign summary_setGenerate="enables or disables hashing to attempt to find the next block." %}
|
||||
|
||||
{% autocrossref %}
|
||||
|
||||
*Requires wallet support.*
|
||||
|
||||
The `setgenerate` RPC {{summary_setGenerate}} If you have an older
|
||||
version of Bitcoin Core, use `help setgenerate` RPC to get help. For testing,
|
||||
the generate call can still be used to mine a block, and the `generatetoaddress` RPC
|
||||
call has been added to mine to a specific address. This works with wallet disabled.
|
||||
*Removed in Bitcoin Core 0.13.0.*
|
||||
|
||||
The `setgenerate` RPC {{summary_setGenerate}}
|
||||
|
||||
*Parameter #1---enable/disable generation*
|
||||
|
||||
{% itemplate ntpd1 %}
|
||||
- n: "`generate`"
|
||||
t: "boolean"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "Set to true to turn on generation, false to turn off."
|
||||
|
||||
{% enditemplate %}
|
||||
|
||||
*Parameter #2---processor limit*
|
||||
|
||||
{% itemplate ntpd1 %}
|
||||
- n: "`genproclimit`"
|
||||
t: "number (int)"
|
||||
p: "Optional<br>(exactly 1)"
|
||||
d: "Set the processor limit for when generation is on. Can be -1 for unlimited."
|
||||
|
||||
{% enditemplate %}
|
||||
|
||||
|
||||
*Result---the generated block header hashes*
|
||||
|
||||
{% itemplate ntpd1 %}
|
||||
- n: "`result`"
|
||||
t: "null"
|
||||
p: "Required<br>(exactly 1)"
|
||||
d: "Always JSON `null`"
|
||||
|
||||
{% enditemplate %}
|
||||
|
||||
*Example from Dash Core 0.12.2*
|
||||
|
||||
Using regtest mode, generate 2 blocks:
|
||||
|
||||
{% highlight bash %}
|
||||
dash-cli -testnet setgenerate 1
|
||||
{% endhighlight %}
|
||||
|
||||
Result:
|
||||
|
||||
(Success: no result displayed. Process manager shows 100% CPU usage.)
|
||||
|
||||
*See also*
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue