janoside / btc-rpc-explorer

Database-free, self-hosted Bitcoin explorer, via RPC to Bitcoin Core.
https://bitcoinexplorer.org
MIT License
1.58k stars 1.18k forks source link

Bitcoin Core "txindex=1" still needed with BTCEXP_ELECTRUM_TXINDEX? #385

Closed Stadicus closed 3 years ago

Stadicus commented 3 years ago

I'm about to update the setup instructions for your great project in my RaspiBolt guide:
https://github.com/raspibolt/raspibolt/pull/786

I'm still recommending to use Bitcoin Core with txindex=1, as I couldn't find information whether the new BTCEXP_ELECTRUM_TXINDEX option is a full replacement.

Questions:

janoside commented 3 years ago

@Stadicus Good questions... I use bitcoind's txindex and haven't experimented with using electrs' version, so the default you're advocating seems like a good one. But...

@shesek @Kixunil can either of you weigh in on these questions?

Kixunil commented 3 years ago

couldn't find information whether the new BTCEXP_ELECTRUM_TXINDEX option is a full replacement.

It should be here, though other software may still require classic txindex.

Can txindex be disabled in Bitcoin Core when BTCEXP_ELECTRUM_TXINDEX is enabled with Electrs?

Yes, if it doesn't work, it's a bug.

Are there tradeoffs between the two methods, e.g. in regards to speed or information available in the block explorer?

Cores should be faster (although there's also slowness of Json RPC) and probably useful for LND and such. OTOH one is storing same information twice.

janoside commented 3 years ago

Added some documentation with this explanation in .env-sample for future reference. Closing since I think the key questions have been answered.