Im trying to make bitcoin-cli work with testnet3, im using bitcoin-qt (knots 29)
I have testnet3 fully synced. In the linux terminal I use
./bitcoin-cli -testnet=1 -datadir=/home/takuma/software/.bitcoin/testnet3 getblockchaininfo
Result:
error: Could not locate RPC credentials. No authentication cookie could be found, and RPC password is not set. See -rpcpassword and -stdinrpcpass. Configuration file: (./bitcoin-cli -testnet=1 -datadir=/home/takuma/software/.bitcoin/testnet3/bitcoin.conf)
On my ./bitcoin/bitcoin.conf file there is this:
listen=0
server=1
rcpbind=127.0.0.1
When I try bitcoin-cli on the main blockchain:
./bitcoin-cli -datadir=/home/takuma/software/.bitcoin getblockchaininfo
it works fine. So something to do with the testnet3 for some reason. The .cookie is there on the /testnet3 folder, but it seems it's not reading it or something. The error points to testnet3/bitcoin.conf file, which didn't exist. So I tried creating a bitcoin.conf file there, which contains the same:
listen=0
server=1
rcpbind=127.0.0.1
Still same error. I have also noticed that it isn't even loading that file on testnet3, because I tried adding par1 on the /.bitcoin/ one and par=4 on the /.bitcoin/testnet3 one and when I open bitcoin-qt -testnet=1 it is using par=1 so it looks like it's reading that config file and on the debug.log file it says:
Script verification uses 0 additional threads
So it seems it's using par=1, it also shows 1 in the GUI. And I actually found the line that says it's just using the regular /.bitcoin/bitcoin.conf file:
Config file: /home/takuma/software/.bitcoin/bitcoin.conf
I thought there was only one global bitcoin.conf file in /.bitcoin/ that was used for all datadirs, but now due that error im not sure if you can set different bitcoin.conf files for each datadir. In any case, I don't understand why this isn't working. It clearly creates the cookie in testnet3, it works when launching mainnet, so unless testnet needs to use different values on bitcoin.conf then I don't get it.