in

Multiple bitcoind nodes – how to specify to which send RPC commands via bitcoin-cli?

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 ligonskerView Source

Leave a Reply

Your email address will not be published.

GIPHY App Key not set. Please check settings

One Comment

  1. 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.

What do you think?

Bitcoin Adoption: Miami Maylor Takes Full Paycheck In BTC | CryptoGazette

Bitcoin Price Analysis: BTC slowly retraces to retest $63,000, more downside to follow? 1

Bitcoin Price Analysis: BTC slowly retraces to retest $63,000, more downside to follow?