<p>Just generate some blocks.</p>

<pre><code>bitcoin-cli -regtest generate 101
</code></pre>

<p>You will have them in your wallet and can use the funds once confirmed. <code>101</code> is the number of blocks to create.
You can use any integer that's at least <code>101</code> as the number of blocks.
You cannot use a smaller integer than <code>101</code> if you want to test transactions, because of the <a href="https://bitcoin.stackexchange.com/questions/1991/what-is-the-block-maturation-time/1992#1992">100 block maturation time</a>.</p>

CC BY-SA 3.0
2017-04-26T13:23:04.657Z
Thanks! hmm that's odd. Before I tried generating 5 blocks, and it didn't allow me to spend. But with 101 it worked. Do you understand why?
relG
CC BY-SA 3.0
2017-04-26T14:57:23.373Z
@relG: It's because of the [100 block maturation time](https://bitcoin.stackexchange.com/a/1992/5757).
Nate Eldredge
CC BY-SA 3.0
2017-04-26T12:12:05.643Z
2017-04-26T18:50:13.830Z
2017-04-26T18:50:13.830Z
q9f
<p>I want to experiment in the regtest network.
But I don't understand how I can get funds to play with.
I did:</p>

<p><code>bitcoind -regtest -daemon</code></p>

<p><code>bitcoin-cli -regtest sendtoaddress 2N3V4PeQXoD6TFM9ZvDMX81kzbuNtc5YPW4 1</code></p>

<p>and get:</p>

<p><code>error code: -6
error message:
Insufficient funds</code></p>

<regtest>
How to get money when using regtest
relG
# How to get money when using regtest

(Asked by: username_0 on 2017-04-26)

I want to experiment in the regtest network.
But I don't understand how I can get funds to play with.
I did:

`bitcoind -regtest -daemon`

`bitcoin-cli -regtest sendtoaddress 2N3V4PeQXoD6TFM9ZvDMX81kzbuNtc5YPW4 1`

and get:

`error code: -6
error message:
Insufficient funds`

**Tags:** regtest


---

## 1 answers

### Answer by username_1 on 2017-04-26. Score: 3 | Accepted answer

Just generate some blocks.

```
bitcoin-cli -regtest generate 101

```

You will have them in your wallet and can use the funds once confirmed. `101` is the number of blocks to create.
You can use any integer that's at least `101` as the number of blocks.
You cannot use a smaller integer than `101` if you want to test transactions, because of the [100 block maturation time](https://bitcoin.stackexchange.com/questions/1991/what-is-the-block-maturation-time/1992#1992).

> **Comments:**
> **username_0**: Thanks! hmm that's odd. Before I tried generating 5 blocks, and it didn't allow me to spend. But with 101 it worked. Do you understand why?  
> **username_2**: @username_0: It's because of the [100 block maturation time](https://bitcoin.stackexchange.com/a/1992/5757).  

---

