3

I'm trying to get Bitcoin Core to sync the testnet, but it keeps syncing the mainnet instead.

Here is my bitcoin.conf file:

[test]
addnode=104.237.131.138
addnode=151.80.205.132
addnode=192.155.82.123
addnode=74.220.255.190
addnode=80.100.203.151
rpcbind=127.0.0.1
rpcport=18332
chain=test
testnet=1

debug=net

txindex=1
listen=1
listenonion=1
daemon=1

proxy=127.0.0.1:9050

server=1
rpcallowip=127.0.0.1
rpcuser=user
rpcpassword=pw

zmqpubrawblock=tcp://127.0.0.1:28332
zmqpubrawtx=tcp://127.0.0.1:28333

I'm calling it like this:

$ bitcoind -conf=./bitcoin.conf -datadir=./bitcoin-testnet/

But the command line tool tells me it is connected to the mainnet:

$ bitcoin-cli -conf=./bitcoin.conf -datadir=./bitcoin-testnet/ -getinfo
Chain: main
Blocks: 0
Headers: 0
Verification progress: ▒░░░░░░░░░░░░░░░░░░░░ 0.0000%
Difficulty: 1

Network: in 0, out 3, total 3
Version: 250000
Time offset (s): 0
Proxies: n/a
Min tx relay fee rate (BTC/kvB): 0.00001000

Warnings: (none)

What do I need to do to sync the testnet?

2 Answers 2

4

You need to pass -testnet to both the bitcoind and bitcoin-cli calls, so they know to even look into the [testnet] section of the config file.

1

In my wallet that I use for testing, have testnet=1 before the [test] heading in the bitcoin.conf file.

This forces both bitcoind and bitcoin-cli to look into the [test] section.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.