0

I have bitcoin testnet3, mainnet, regtest both running in the same server, I can interactive with them by curl, because the ports are different, but when comes to bitcoin-cli how can I specific the network I want interactive with?

I get below error:

$ bitcoin-cli -regtest setgenerate true 101  # I want use regtest
Error: Invalid combination of -regtest and -testnet.
  • 1
    Does your bitcoin.conf file contain a line testnet=1 ? – Pieter Wuille Nov 12 '18 at 8:47
  • yes, for testnet testnet=1 is on – huahuayu Nov 14 '18 at 14:13
  • So bitcoin-cli is combining the options from the command line and the config file, and sees both which are in conflict with eachother. – Pieter Wuille Nov 14 '18 at 17:31
1

You can pass the -rpcport flag to bitcoin-cli to specify which node to connect to when running multiple on the same machine.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.