I'm looking to create an index on addresses in my bitcoin full node in order to fetch the balances of a list of addresses from the blockchain for an academic project without using the public explorers. For that I installed the Bitcoin Core client (version 22) and configured it as follows:
# [core]
# Maintain a full transaction index, used by the getrawtransaction rpc call.
txindex=1
addrindex=1
# Maintain coinstats index used by the gettxoutsetinfo RPC.
coinstatsindex=1
# Run in the background as a daemon and accept commands.
daemon=1
# [rpc]
# Accept command line and JSON-RPC commands.
server=1
# Accept public REST requests.
rest=1
# rpc auth settings
rpcauth=*******
dbcache=1000
And after that, I installed the bitcoin-rpc-explorer
to create a private explorer which is pointed to my bitcoin node correctly (below in my env file for this explorer with the rest of the parameters set to default):
BTCEXP_COIN=BTC
BTCEXP_BITCOIND_HOST=127.0.0.1
BTCEXP_BITCOIND_PORT=8332
BTCEXP_BITCOIND_USER=*******
BTCEXP_BITCOIND_PASS=*******
BTCEXP_BITCOIND_COOKIE=/path/to/bitcoind/.cookie
BTCEXP_BITCOIND_RPC_TIMEOUT=5000
However, when I insert an address in the search bar, I get this message
No address API is configured.
See the example configuration file for help setting up an address API.
which points me to the sample config file of the bitcoin node github repo (https://github.com/janoside/btc-rpc-explorer/blob/master/.env-sample)
so I checked my node's indexes with the getindexinfo command and I got this:
{
"txindex": {
"synced": true,
"best_block_height": 764153
},
"coinstatsindex": {
"synced": true,
"best_block_height": 764153
}
}
So it would seem that addrindex
is not working for some reason. I did some research and a comment mentioned that support for this index has been removed from recent versions of Bitcoin Core and that I should use an Electrum server and Electrum Wallet for this and another link mentioned an addrindex
patch to install.
So does anyone know what exactly to do in this situation and what the optimal solution is?
And is there any recommended addrindex
patch for Bitcoin Core if any?
addrindex
has never been a supported feature in Bitcoin Core.