Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Support to run electrs offline #410

Closed
jr682 opened this issue Jun 3, 2021 · 6 comments · Fixed by #888
Closed

Feature: Support to run electrs offline #410

jr682 opened this issue Jun 3, 2021 · 6 comments · Fixed by #888
Labels
enhancement New feature or request

Comments

@jr682
Copy link

jr682 commented Jun 3, 2021

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.

@jr682 jr682 added the enhancement New feature or request label Jun 3, 2021
@Kixunil
Copy link
Contributor

Kixunil commented Jun 4, 2021

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.

@sjkjs
Copy link

sjkjs commented Jun 2, 2023

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 {

@romanz
Copy link
Owner

romanz commented Jun 4, 2023

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.

@Kixunil
Copy link
Contributor

Kixunil commented Jun 4, 2023

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...

@romanz
Copy link
Owner

romanz commented Jun 4, 2023

@jr682 @sjkjs Could you please try #888 (using the new --skip-block-download-wait flag)?

@sjkjs
Copy link

sjkjs commented Jun 5, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants