I am currently running two `regtest` nodes on the same PC as described here: [how to run multiple bitcoind node on one server?](https://bitcoin.stackexchange.com/questions/73432/how-to-run-multiple-bitcoind-node-on-one-server)
Now I want to use the following `bitcoin-cli` command as seen in the example from the docs:
`bitcoin-cli -regtest generatetoaddress 101 $(bitcoin-cli -regtest getnewaddress)`
But how to specify a node if I want to choose a specific one?
View Reddit by ligonsker – View Source
You need to supply a -datadir option pointing to the correct data. You may need a -conf as well but can’t recall for sure.
I always use an alias for this:
`alias btc=’bitcoin-cli –datadir=/var/lib/bitcoin’`
That makes it easy at console. For scripts I’d just add a variable holding options.
Here’s another alias I use a lot:
`alias btcinfo=’bitcoin-cli –datadir=/var/lib/bitcoin getblockchaininfo |jq ”’del(.softforks)””`
That one needs jq installed. I guess my aliases show that a -conf isn’t required as it will find correct one in datadir.