Issues with bitcoin-cli on testnet

4 replies 75 views
alpha23Member
Posts: 116 · Reputation: 79
#1May 2, 2023, 04:00 AM
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?
5 Reply Quote Share
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.
1 Reply Quote Share
alpha23Member
Posts: 116 · Reputation: 79
#3May 2, 2023, 09:54 AM
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?
1 Reply Quote Share
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.
2 Reply Quote Share
alpha23Member
Posts: 116 · Reputation: 79
#5May 4, 2023, 11:43 PM
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?
3 Reply Quote Share

Related topics