user88214: 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.


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

88214: <p>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?</p>

<p>I get below error:</p>

<pre><code>$ bitcoin-cli -regtest setgenerate true 101  # I want use regtest
Error: Invalid combination of -regtest and -testnet.
</code></pre>
 7272: <p>You can pass the <code>-rpcport</code> flag to bitcoin-cli to specify which node to connect to when running multiple on the same machine.</p>
