Dev Docs: Describe New RPC 'generate' In Examples

This commit is contained in:
David A. Harding 2015-04-12 20:27:34 -04:00
parent ab7ca1f26f
commit df2f3a77d0
No known key found for this signature in database
GPG key ID: 4B29C30FF29EC4B7
2 changed files with 13 additions and 1 deletions

View file

@ -64,12 +64,16 @@ Start `bitcoind` in regtest mode to create a private block chain.
{% endautocrossref %} {% endautocrossref %}
~~~ ~~~
## Bitcoin Core 0.10.1 and earlier
bitcoin-cli -regtest setgenerate true 101 bitcoin-cli -regtest setgenerate true 101
## Bitcoin Core master (as of commit 48265f3)
bitcoin-cli -regtest generate 101
~~~ ~~~
{% autocrossref %} {% autocrossref %}
Generate 101 blocks using a special version of the `setgenerate` RPC Generate 101 blocks using a special RPC
which is only available in regtest mode. This takes about 30 seconds on which is only available in regtest mode. This takes about 30 seconds on
a generic PC. Because this is a new block chain using Bitcoin's default a generic PC. Because this is a new block chain using Bitcoin's default
rules, the first blocks pay a block reward of 50 bitcoins. Unlike rules, the first blocks pay a block reward of 50 bitcoins. Unlike

View file

@ -115,8 +115,12 @@ someone else, that second transaction would not be displayed in our
list of UTXOs. list of UTXOs.
{% highlight bash %} {% highlight bash %}
## Bitcoin Core 0.10.1 and earlier
> bitcoin-cli -regtest setgenerate true 1 > bitcoin-cli -regtest setgenerate true 1
## Later versions of Bitcoin Core
> bitcoin-cli -regtest generate 1
> unset NEW_ADDRESS > unset NEW_ADDRESS
{% endhighlight %} {% endhighlight %}
@ -332,8 +336,12 @@ would usually then broadcast it to other peers, but we're not currently
connected to other peers because we started in regtest mode. connected to other peers because we started in regtest mode.
{% highlight bash %} {% highlight bash %}
## Bitcoin Core 0.10.1 and earlier
> bitcoin-cli -regtest setgenerate true 1 > bitcoin-cli -regtest setgenerate true 1
## Later versions of Bitcoin Core
> bitcoin-cli -regtest generate 1
> unset UTXO_TXID UTXO_VOUT NEW_ADDRESS RAW_TX SIGNED_RAW_TX > unset UTXO_TXID UTXO_VOUT NEW_ADDRESS RAW_TX SIGNED_RAW_TX
{% endhighlight %} {% endhighlight %}