<p>I use Ubuntu. <br/>
After i run <strong>bitcoind -regtest -daemon</strong> <br/>
I tried to create blocks by running command: <strong>bitcoin-cli -regtest generate 101</strong> <br/>
And it returned error like this: <br/></p>

<p><code>Error: Invalid RPC method
 Usage: bitcoin-cli [--testnet] [--host=host] [--port=port] [--rpcuser=user 
 --rpcpassword=pass] method args</code></p>

<p>But when i run this command: <strong>bitcoin-cli -regtest getinfo</strong>, it still work</p>

<p>This is my <code>bitcoin.conf</code> file ( directory: /home/myname/.bitcoin/bitcoin.conf) <br/>
<code>
server=1
rpcuser=myuser
rpcpassword=mypassword
txindex=1
regtest=1
</code></p>

<p>I've tried google but I got nothing to handle this trouble, please help me.</p>

CC BY-SA 3.0
2017-04-21T11:17:51.900Z
Maybe you are using an older version of bitcoin core? generate was added in AFAIK 0.13 (before it was `setgenerate 101`)
Jonas Schnelli
CC BY-SA 3.0
2017-04-21T13:00:36.377Z
i've tried that command but it returned this: `Use the generate method instead of setgenerate on this network`. and my bitcoin core version **Bitcoin Core version v0.14.0.0-g43a987c1c (64-bit)**
Gin
CC BY-SA 3.0
2017-04-21T15:15:00.680Z
It would seem that you're running an older version of bitcoind.
Pieter Wuille
CC BY-SA 3.0
2017-04-21T17:33:29.920Z
The error message you're quoting above was last present in Bitcoin Core v0.12.1. Perhaps you accidentally have two binaries installed and are running an older one? Check the contents of debug.log to make sure.
Pieter Wuille
CC BY-SA 3.0
2017-04-22T09:30:57.077Z
you're right @pie
Gin
CC BY-SA 3.0
2017-04-22T09:40:01.207Z
@PieterWuille , I install **bitcore** too. and it includes **bitcoind** version: `Bitcoin Core Daemon version v0.12.1-bitcore-4`, does this cause the error and how to fix it? help me please i'm newbie.
Gin
<regtest><bitcoin-cli>
"Error: Invalid RPC method" when i try to create block in regtest mode
Gin
# "Error: Invalid RPC method" when i try to create block in regtest mode

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

I use Ubuntu.   
After i run **bitcoind -regtest -daemon**   
I tried to create blocks by running command: **bitcoin-cli -regtest generate 101**   
And it returned error like this:

`Error: Invalid RPC method
Usage: bitcoin-cli [--testnet] [--host=host] [--port=port] [--rpcuser=user
--rpcpassword=pass] method args`

But when i run this command: **bitcoin-cli -regtest getinfo**, it still work

This is my `bitcoin.conf` file ( directory: /home/myname/.bitcoin/bitcoin.conf)   
`server=1
rpcuser=myuser
rpcpassword=mypassword
txindex=1
regtest=1`

I've tried google but I got nothing to handle this trouble, please help me.

**Tags:** regtest, bitcoin-cli

> **Comments:**
> **username_1**: Maybe you are using an older version of bitcoin core? generate was added in AFAIK 0.13 (before it was `setgenerate 101`)  
> **username_0**: i've tried that command but it returned this: `Use the generate method instead of setgenerate on this network`. and my bitcoin core version **Bitcoin Core version v0.14.0.0-g43a987c1c (64-bit)**  
> **username_2**: It would seem that you're running an older version of bitcoind.  
> **username_2**: The error message you're quoting above was last present in Bitcoin Core v0.12.1. Perhaps you accidentally have two binaries installed and are running an older one? Check the contents of debug.log to make sure.  
> **username_0**: you're right @pie  
> **username_0**: @username_2 , I install **bitcore** too. and it includes **bitcoind** version: `Bitcoin Core Daemon version v0.12.1-bitcore-4`, does this cause the error and how to fix it? help me please i'm newbie.  

---

## 0 answers

