Trying to get bitcoin-cli to work with testnet3 but it's acting up. Using bitcoin-qt (knots 29) and my testnet3 is fully synced. Here's what happens when I run it in the terminal:
The.cookie file is in the /testnet3 folder but it seems like it's not being read. The error keeps pointing to the testnet3/bitcoin.conf file, which doesn’t exist. I even created one with the same settings as my mainnet. Still getting the same error. What gives?
Issues with bitcoin-cli on testnet
4 replies 75 views
matrix2021Full Member
Posts: 92 · Reputation: 612
#2May 2, 2023, 05:37 AM
You might want to check your -datadir setting. It shouldn’t point to the testnet directory directly. In testnet mode, it uses the testnet3 subdirectory of the main -datadir. Just a thought.
Oh wow, didn’t realize that! So there should only be one bitcoin.conf in the main.bitcoin directory, and no separate files for testnet3 or testnet4?
The GUI says my datadir is /home/takuma/software/.bitcoin/testnet3, so I thought it needed its own bitcoin.conf. But I guess it automatically adds /testnet3 when running the testnet?
matrix2021Full Member
Posts: 92 · Reputation: 612
#4May 2, 2023, 02:40 PM
Exactly, you got it!
If you want to avoid typing the path every time with bitcoin-cli, you could set the datadir in your bitcoin.conf file.
I added that but it still needs me to use the -datadir=path argument every single time I run./bitcoin-cli. What am I missing?