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.

  • Maybe you are using an older version of bitcoin core? generate was added in AFAIK 0.13 (before it was setgenerate 101) – Jonas Schnelli Apr 21 '17 at 11:17
  • 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 Apr 21 '17 at 13:00
  • It would seem that you're running an older version of bitcoind. – Pieter Wuille Apr 21 '17 at 15:15
  • 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 Apr 21 '17 at 17:33
  • you're right @pie – Gin Apr 22 '17 at 9:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.