<p>First, create a directory to store your blocks and configuration:</p>

<pre><code>$ mkdir mybitcoindir
$ cd mybitcoindir
</code></pre>

<p>next, you need to create a conf file called <code>bitcoin.conf</code> that has this in it:</p>

<pre><code>checkpoints=0
connect=0.0.0.0
daemon=1
discover=0
dnsseed=0
gen=1
irc=0
keypool=5
listen=0
port=19002
rpcpassword=test123
rpcport=19003
rpcuser=test
upnp=0
</code></pre>

<p>Now start up your bitcoin daemon</p>

<pre><code>$ bitcoind -datadir=mybitcoindir
</code></pre>

<p>You should have no outbound connections</p>

<pre><code>$ bitcoin-cli -datadir=mybitcoindir getpeerinfo
[
]
</code></pre>

<p>Now you can generate coins</p>

<pre><code>$ bitcoin-cli -datadir=mybitcoindir setgenerate true
</code></pre>

<p>Note even with the difficulty at 1, generating coins off of a single CPU can take a while. Expect it to take a few hours to find your first block. You're better off getting a really cheap USB miner as they can find about 2-3 blocks at difficulty 1 every minute. But that, of course, requires a bunch of setup as well.</p>

<p>Best of luck.</p>

CC BY-SA 3.0
2016-06-01T23:27:13.897Z
2016-06-01T23:27:13.897Z
Jimmy Song
<p>Set <code>regtest=1</code> in bitcoin.conf.</p>

CC BY-SA 3.0
2016-05-01T15:06:02.423Z
@zxt1 They're not testnet BTC. Are you asking how to create a new blockchain and mine BTC that is freely exchangeable with the main Bitcoin network?
Nick ODell
CC BY-SA 3.0
2016-05-01T06:15:15.627Z
2016-05-01T06:15:15.627Z
Nick ODell
<p>You can spawn and distribute blockchain networks on the fly with coinclone:<br>
<a href="https://github.com/coinclone/cloner" rel="nofollow">https://github.com/coinclone/cloner</a></p>

CC BY-SA 3.0
2016-05-02T13:59:39.050Z
2016-05-02T22:54:00.100Z
2016-05-02T22:54:00.100Z
derrend
<p>It won't work right out of the box.</p>

<p>First of all, the Bitcoin Core client has hardcoded <a href="https://bitcoin.stackexchange.com/questions/1797/what-are-checkpoints">checkpoints</a> asserting that certain specific blocks should be found at certain heights.  Your chain won't contain those blocks, so if you ever reach those heights, your own client will reject your whole chain.  It might even be that the client will refuse to even start mining until it has downloaded a chain that matches up to the last checkpoint.</p>

<p>So for starters, you'd have to edit out the checkpoints and recompile the source code.</p>

<p>There may be other issues, due to changes in the Bitcoin protocol since 2009.  The client knows what the rules were at that time, and is able to check that blocks near the beginning of the block chain satisfy them.  But it most likely creates new blocks in conformance with today's rules, which might not be acceptable in an "old" block.  So again, you might find that it rejects its own blocks.</p>

CC BY-SA 3.0
2016-05-02T14:18:40.363Z
2016-05-02T14:18:40.363Z
2017-04-13T12:47:33.583Z
Nate Eldredge
<p>I will mine myself ONLY so difficulty will be always in 1 range so CPU is enough for this task</p>

<p>So my question is: how to setup bitcoin core 0.12 to start mining with CPU new blockchain ?</p>

<p>If I type in the console: setgenerate true and wait a few hours it's possible to mine first block with 50 BTC (of course with internet connection OFF to prevent download blocks)?</p>

<p>I know that this BTC will be worthless ATM (without $ value) but I want to do that anyway to better understand mining process</p>

<blockchain>
I want to start mining new blockchain (exactly as Satoshi did in 2009) for testing purpose
zxt
# I want to start mining new blockchain (exactly as Satoshi did in 2009) for testing purpose

(Asked by: username_0 on 2016-04-30)

I will mine myself ONLY so difficulty will be always in 1 range so CPU is enough for this task

So my question is: how to setup bitcoin core 0.12 to start mining with CPU new blockchain ?

If I type in the console: setgenerate true and wait a few hours it's possible to mine first block with 50 BTC (of course with internet connection OFF to prevent download blocks)?

I know that this BTC will be worthless ATM (without $ value) but I want to do that anyway to better understand mining process

**Tags:** blockchain


---

## 4 answers

### Answer by username_1 on 2016-06-01. Score: 3

First, create a directory to store your blocks and configuration:

```
$ mkdir mybitcoindir
$ cd mybitcoindir

```

next, you need to create a conf file called `bitcoin.conf` that has this in it:

```
checkpoints=0
connect=0.0.0.0
daemon=1
discover=0
dnsseed=0
gen=1
irc=0
keypool=5
listen=0
port=19002
rpcpassword=test123
rpcport=19003
rpcuser=test
upnp=0

```

Now start up your bitcoin daemon

```
$ bitcoind -datadir=mybitcoindir

```

You should have no outbound connections

```
$ bitcoin-cli -datadir=mybitcoindir getpeerinfo
[
]

```

Now you can generate coins

```
$ bitcoin-cli -datadir=mybitcoindir setgenerate true

```

Note even with the difficulty at 1, generating coins off of a single CPU can take a while. Expect it to take a few hours to find your first block. You're better off getting a really cheap USB miner as they can find about 2-3 blocks at difficulty 1 every minute. But that, of course, requires a bunch of setup as well.

Best of luck.


---

### Answer by username_2 on 2016-05-01. Score: 0

Set `regtest=1` in bitcoin.conf.

> **Comments:**
> **username_2**: @zxt1 They're not testnet BTC. Are you asking how to create a new blockchain and mine BTC that is freely exchangeable with the main Bitcoin network?  

---

### Answer by username_3 on 2016-05-02. Score: 0

You can spawn and distribute blockchain networks on the fly with coinclone:  
<https://github.com/coinclone/cloner>


---

### Answer by username_4 on 2016-05-02. Score: 0

It won't work right out of the box.

First of all, the Bitcoin Core client has hardcoded [checkpoints](https://bitcoin.stackexchange.com/questions/1797/what-are-checkpoints) asserting that certain specific blocks should be found at certain heights. Your chain won't contain those blocks, so if you ever reach those heights, your own client will reject your whole chain. It might even be that the client will refuse to even start mining until it has downloaded a chain that matches up to the last checkpoint.

So for starters, you'd have to edit out the checkpoints and recompile the source code.

There may be other issues, due to changes in the Bitcoin protocol since 2009. The client knows what the rules were at that time, and is able to check that blocks near the beginning of the block chain satisfy them. But it most likely creates new blocks in conformance with today's rules, which might not be acceptable in an "old" block. So again, you might find that it rejects its own blocks.


---

