Sync a Bitcoin Node
We use Bitcoin Core to interact with the Bitcoin Mainnet and retrieve the necessary on-chain data. This requires running a full Bitcoin node, i.e., a node that is fully synchronized with the network.
The initial synchronization downloads the entire blockchain history.
Depending on your hardware (CPU performance, disk read/write speed) and network connection,
this process can take a significant amount of time, potentially a week.
Then, we need to index the transactions, which takes an additional day or two to complete.
As of block height 875,000
, syncing a full node requires approximately 850
GB of storage space.
Bitcoin Core offers a prune option, which reduces disk space usage by discarding older block data.
However, since we need a full transaction index (txindex=1
setting in Bitcoin Core),
and given that indexing is incompatible with pruning,
therefore, we must run a non-pruned node.
You may take the following steps.
-
Download and install Bitcoin Core.
-
Start
bitcoin-qt
using the following command.cd [installation directory]
.\bitcoin-qt.exe -server=1 -rest=1 -txindex=1 -rpcworkqueue=100It will take ~6 days for this process to complete. While you could monitor the progress of synchronizing with the network, the UI does not report on the indexing progress. Hence, after synchronization is complete, the indexing is in progress, and
bitcoin-qt
will not respond (properly) to API calls before this process finishes. You may "monitor" the indexing progress by monitoring the\indexes\txindex
directory for changed/added files.Why setting
-rpcworkqueue=100
? EBA is optimized for concurrency and sends many API requests tobitcoin-qt
, with a dynamically adjusted degree of parallelization. However, Bitcoin Core's default worker queue size is small and you get a503
error when EBA creates many concurrent requests (e.g., see this error); hence, we increase the RPC queue size.
-
Test if the client is correctly set up and responding using the following
GET
request:GET localhost:8332/rest/chaininfo.json
-
[Optional] Please see this page for running Bitcoin Core in a local network.
Privacy Best Practices
Do NOT define your real Wallet on this bitcoin-qt
instance
(i.e., the Wallet you may have used on any Bitcoin exchange service for Bitcoin trading).
EBA does NOT try to access Wallets defined in bitcoin-qt
.
Regardless, there are some known privacy concerns when running bitcoin-qt
with a defined wallet while the REST API is enabled.
See Bitcoin docs.