<p>No, there does not such thing as <code>initialfreecoins=10000000</code>. However mining on regtest is <strong>not</strong> resource hungry and nearly instant. It's the only way to get coins.</p>

<p>To get coins on regtest you first need a address to <em>mine</em> those coins to. An address can be created with
 <code>bitcoin-cli -regtest getnewaddress</code>.</p>

<p>To <em>mine</em> and payout to this address use with <code>&lt;address&gt;</code> being the output of the first step and <code>&lt;nblock&gt;</code> the number of blocks you want to mine. A good number would be for example 101 to get 50 coins (because coins need 100 confirmations to be spendable).</p>

<p><code>bitcoin-cli -regtest generatetoaddress &lt;nblocks&gt; &lt;address&gt;</code></p>

<p>You can repeat <code>generatetoaddress</code> or set a higher value for <code>&lt;nblock&gt;</code> to get more coins.</p>

CC BY-SA 4.0
2019-07-27T05:50:16.060Z
So if i set the value of nblocks to a higher value say 500 then the mined fee would also be higher?
Shubham Saxena
CC BY-SA 4.0
2019-07-27T08:37:25.120Z
No, you'd mine 500 blocks.
0xb10c
CC BY-SA 4.0
2019-07-26T17:57:41.363Z
2019-07-27T16:16:34.667Z
2019-07-27T16:16:34.667Z
0xb10c
<p>I am fairly new to bitcoin and was attempting to setup a local test network in my machine. I am using the regtest network to create the local network. Is there a way in which I can initialize the nodes (using a genesis block or something) to hold bitcoins (without mining)?
I was going through the developer docs but I could not figure it out. Pardon me if it is a simple solution as I am fairly new to bitcoin.
Something like an <code>initialfreecoins=10000000</code> in the elements/lightning network.</p>

<regtest>
How can I fund my node in regtest?
Shubham Saxena
# How can I fund my node in regtest?

(Asked by: username_0 on 2019-07-26)

I am fairly new to bitcoin and was attempting to setup a local test network in my machine. I am using the regtest network to create the local network. Is there a way in which I can initialize the nodes (using a genesis block or something) to hold bitcoins (without mining)?
I was going through the developer docs but I could not figure it out. Pardon me if it is a simple solution as I am fairly new to bitcoin.
Something like an `initialfreecoins=10000000` in the elements/lightning network.

**Tags:** regtest


---

## 1 answers

### Answer by username_1 on 2019-07-26. Score: 4 | Accepted answer

No, there does not such thing as `initialfreecoins=10000000`. However mining on regtest is **not** resource hungry and nearly instant. It's the only way to get coins.

To get coins on regtest you first need a address to *mine* those coins to. An address can be created with
`bitcoin-cli -regtest getnewaddress`.

To *mine* and payout to this address use with `<address>` being the output of the first step and `<nblock>` the number of blocks you want to mine. A good number would be for example 101 to get 50 coins (because coins need 100 confirmations to be spendable).

`bitcoin-cli -regtest generatetoaddress <nblocks> <address>`

You can repeat `generatetoaddress` or set a higher value for `<nblock>` to get more coins.

> **Comments:**
> **username_0**: So if i set the value of nblocks to a higher value say 500 then the mined fee would also be higher?  
> **username_1**: No, you'd mine 500 blocks.  

---

