"Error: Invalid RPC method" when i try to create block in regtest mode

1

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.

Gin

Posted 2017-04-21T11:09:31.790

Reputation: 11

Maybe you are using an older version of bitcoin core? generate was added in AFAIK 0.13 (before it was setgenerate 101)Jonas Schnelli 2017-04-21T11:17:51.900

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 2017-04-21T13:00:36.377

It would seem that you're running an older version of bitcoind.Pieter Wuille 2017-04-21T15:15:00.680

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 2017-04-21T17:33:29.920

you're right @pieGin 2017-04-22T09:30:57.077

@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 2017-04-22T09:40:01.207

No answers