Closed jr682 closed 1 year ago
I think the solution for this is the same as for listening during sync. I swear I've seen an issue about it, can't find it right now.
I agree that this is a useful feature. There are legitimate reasons to run it offline with no internet connection.
The check for whether or not it's doing an initial block download is done by bitcoind, not electrs. However electrs then refuses to progress any further until bitcoind says that the initial block download is complete.
A workaround while we wait for a fix is to edit src/daemon.rs, and in the function rpc_poll(), change:
if info.initial_block_download || left_blocks > 0 {
to:
if left_blocks > 0 {
The reason electrs is waiting for IBD to finish is to make sure it won't "compete" with bitcoind on CPU/IO resources during the IBD process, which is preferable when running on modest hardware.
Interesting. I think it could be configurable but I'm wondering how much does it even help. At least the blocks which verify signatures are CPU-bound and bitcoind
isn't very parallelized, so if you have many cores it'd be probably better to run them in parallel at that time. There may be other weird cases, like user having two dedicated storages for chain and electrs index...
@jr682 @sjkjs Could you please try #888 (using the new --skip-block-download-wait
flag)?
Thanks romanz. I can confirm that it works after putting skip-block-download-wait=true
into the config file. I didn't try with the flag but I assume it's the same thing.
Is your feature request related to a problem? Please describe. Runnin bitcoind and electrs in an offline machine. No internet. Copy of blockchain on machine for bitcoind. When blockchain is old, maybe some hours, electrs refuse all requests. Message about IBD, initial block download.
Describe the solution you'd like Option to ignore IBD and serve all requests.
Describe alternatives you've considered Other option to answer all request when blockchain is out of date would also work.
Additional context Performance of electrs is excellent in offline machine.