user138059: 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?

user13866: 
So does anyone know what exactly to do in this situation and what the optimal solution is?

I don't, however the btc-rpc-explorer document you referred to) says
# Select optional "address API" to display address tx lists and balances
# Options: electrum, electrumx, blockchain.com, blockchair.com, blockcypher.com

Which seems to me to suggest you might need one of those to use with the addrindex api it provides.


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.

This seems like it might be similar to How can I take a "snapshot" of the bitcoin blockchain and analyze it? - maybe you could consider a similar approach and perhaps build your own indexes if you need to track changing balances forward in time?
If the number of addresses of interest is small and known in advance, I think you can import them and perform a rescan and then use the Bitcin core RPC API getbalance, getbalances or listreceivedbyaddress to retrieve balances for those specific imported "watch-only" addresses.

Related:

https://bitcointalk.org/index.php?topic=3016279.0
comments on Analyse huge amount of blockchain data


138059: <p>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:</p>
<pre><code># [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
</code></pre>
<p>And after that, I installed the <code>bitcoin-rpc-explorer</code> 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):</p>
<pre><code>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
</code></pre>
<p>However, when I insert an address in the search bar, I get this message</p>
<pre><code>No address API is configured.
See the example configuration file for help setting up an address API.
</code></pre>
<p>which points me to the sample config file of the bitcoin node github repo (<a href="https://github.com/janoside/btc-rpc-explorer/blob/master/.env-sample" rel="nofollow noreferrer">https://github.com/janoside/btc-rpc-explorer/blob/master/.env-sample</a>)</p>
<p>so I checked my node's indexes with the <strong>getindexinfo</strong> command and I got this:</p>
<pre><code>{
  &quot;txindex&quot;: {
    &quot;synced&quot;: true,
    &quot;best_block_height&quot;: 764153
  },
  &quot;coinstatsindex&quot;: {
    &quot;synced&quot;: true,
    &quot;best_block_height&quot;: 764153
  }
}
</code></pre>
<p>So it would seem that <code>addrindex</code> 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 <code>addrindex</code> patch to install.</p>
<p>So does anyone know what exactly to do in this situation and what the optimal solution is?
And is there any recommended <code>addrindex</code> patch for Bitcoin Core if any?</p>
 13866: <blockquote>
<p><strong>So does anyone know what exactly to do in this situation and what the optimal solution is?</strong></p>
</blockquote>
<p>I don't, however the btc-rpc-explorer <a href="https://github.com/janoside/btc-rpc-explorer/blob/master/.env-sample" rel="nofollow noreferrer">document you referred to</a>) says</p>
<pre><code># Select optional &quot;address API&quot; to display address tx lists and balances
# Options: electrum, electrumx, blockchain.com, blockchair.com, blockcypher.com
</code></pre>
<p>Which seems to me to suggest you might need one of those to use with the <code>addrindex</code> api it provides.</p>
<hr />
<blockquote>
<p><strong>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.</strong></p>
</blockquote>
<p>This seems like it <em>might</em> be similar to <a href="https://bitcoin.stackexchange.com/q/114804/13866">How can I take a &quot;snapshot&quot; of the bitcoin blockchain and analyze it?</a> - maybe you could consider a similar approach and perhaps build your own indexes if you need to track changing balances forward in time?</p>
<p>If the number of addresses of interest is small and known in advance, I <em>think</em> you can import them and perform a rescan and then use the Bitcin core RPC API <code>getbalance</code>, <code>getbalances</code> or <code>listreceivedbyaddress</code> to retrieve balances for those specific imported &quot;watch-only&quot; addresses.</p>
<hr />
<p>Related:</p>
<ul>
<li><a href="https://bitcointalk.org/index.php?topic=3016279.0" rel="nofollow noreferrer">https://bitcointalk.org/index.php?topic=3016279.0</a></li>
<li>comments on <a href="https://bitcoin.stackexchange.com/q/116053/13866">Analyse huge amount of blockchain data</a></li>
</ul>
