I've already fully synced the blockchain with btcd, can I point bitcoind at the same datadir
and use its contents?
2 Answers
You can't use the same datadir
, but you can tell btcd
to connect to your locally-running bitcoind
instance in order to do the initial blockchain sync. This means that you'll end up with two copies of the blockchain (one for bitcoind
and one for btcd
) but the sync will happen much faster than starting btcd
with default settings.
In your btcd.conf
file:
; only connect to locally-running node
connect=127.0.0.1
; no need to query for other nodes
nodnsseed=1
; listen on a port other than the default (if bitcoind is already running on the default)
listen=127.0.0.1:8336
; secure the RPC API so that you can interface with your sycing node by using btcctl
rpcuser=<rpcusername>
rpcpassword=<rpcuserpassword>
; sync with indexes enabled
txindex=1
addrindex=1
Now start btcd
. It should start, but no peers will be connected - you can verify this by running btcctl getpeerinfo
and you'll get []
.
With btcd
running, force your bitcoind
node to connect to it by using the command bitcoin-cli --rpcuser=<bitcoindrpcusername> --rpcpassword=<bitcoindrpcuserpassword> addnode 127.0.0.1:8336 'onetry'
Now run btcctl getpeerinfo
again, and you should see that your local bitcoind
node is connected. btcd
has started to sync and it should only take a few hours to sync from the local node. This is much faster than the days it would take to sync over the internet.