<p>You need to mine a block so that the software thinks that the blockchain is fully synced. The most recent block in the regtest blockchain is probably old so you just need to mine one more block to make the blockchain "recent".</p>

<p>Just use the <code>generate</code> command. You can do:</p>

<pre><code>./src/bitcoin-cli -regtest -port=8333 -rpcport=8332 -rpcuser=test -rpcpassword=test generate 1
</code></pre>

<p>to mine one block.</p>

CC BY-SA 4.0
2018-05-18T15:59:23.147Z
2018-05-18T15:59:23.147Z
Ava Chow
<p>I have created two nodes and connected the 1st node with the 2nd node in regtest mode . Now when I make the getblocktemplate command using bitcoin-cli . It fails with bitcoin is downloading the block.</p>

<p>Bitcoin core vs v0.16</p>

<pre><code>admin1@root:~/Projects/bitcoin$ ./src/bitcoin-cli -regtest -port=8333 -rpcport=8332 -rpcuser=test -rpcpassword=test getconnectioncount
1
admin1@root:~/Projects/bitcoin$ ./src/bitcoin-cli -regtest -port=8333 -rpcport=8332 -rpcuser=test -rpcpassword=test getblocktemplate
error code: -10
error message:
Bitcoin is downloading blocks.
</code></pre>

<bitcoin-core><bitcoind><getblocktemplate>
getblocktemplate fails in regtest mode even when it is connected to the other node
nirajkumar
# getblocktemplate fails in regtest mode even when it is connected to the other node

(Asked by: username_0 on 2018-05-18)

I have created two nodes and connected the 1st node with the 2nd node in regtest mode . Now when I make the getblocktemplate command using bitcoin-cli . It fails with bitcoin is downloading the block.

Bitcoin core vs v0.16

```
admin1@root:~/Projects/bitcoin$ ./src/bitcoin-cli -regtest -port=8333 -rpcport=8332 -rpcuser=test -rpcpassword=test getconnectioncount
1
admin1@root:~/Projects/bitcoin$ ./src/bitcoin-cli -regtest -port=8333 -rpcport=8332 -rpcuser=test -rpcpassword=test getblocktemplate
error code: -10
error message:
Bitcoin is downloading blocks.

```

**Tags:** bitcoin-core, bitcoind, getblocktemplate


---

## 1 answers

### Answer by username_1 on 2018-05-18. Score: 2 | Accepted answer

You need to mine a block so that the software thinks that the blockchain is fully synced. The most recent block in the regtest blockchain is probably old so you just need to mine one more block to make the blockchain "recent".

Just use the `generate` command. You can do:

```
./src/bitcoin-cli -regtest -port=8333 -rpcport=8332 -rpcuser=test -rpcpassword=test generate 1

```

to mine one block.


---

