Is it possible to detect if flag -txindex is enabled using RPC? Using JSONRPC, how do I detect if a node has -txindex enabled?
You can use the getindexinfo RPC call to list (and get the status of) all the available indexes since version 0.21 (currently in rc3).
On my local bitcoind with (only) txindex enabled, here is the output:
$ bitcoin-cli getindexinfo
{
  &quot;txindex&quot;: {
    &quot;synced&quot;: true,
    &quot;best_block_height&quot;: 660887
  }
}