Bitcoin Core Version:0.16.0
How run multiple nodes in regtest/testnet mode on a single machine?
I want to test.
This might be a better answer. https://bitcoin.stackexchange.com/a/39168
For that, you could create a 2nd data directory (example: /tmp/datadir2). Create /tmp/datadir2/bitcoin.conf.
Use something similar than
rpcuser=rt
rpcuser=rt
port=12340
rpcport=10340
discover=0
You can than distinct between both nodes with the -datadir argument while calling bitcoin-cli.
Some examples:
generate coins in first node (50 BTC available)
get address from 2nd node
send coins to 2nd node
Wise words from AdolfinWolf, I think this way is the best one but isn't the only one.
If you want to have more independence on each testnet, you can o it with virtual machines. First download VirtualBox, install the OS you want, then get bitcoin core. After your node gets updated you can clone that virtual machine, That way if you fuckup the core, the test net or the full os, you still have a clone of the machine when the configuration was fine.
I just love virtual machines, is awesome to run 20 PC's in the same computer, the only problem about that is you need nice hardware, a lot of RAM and a nice CPU