Display sync progress during initial indexing #3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey @sahilph. We're getting ready to have Fulcrum (and a new ElectrumX app) be hot swappable with Electrs on umbrelOS.
In preparation, I've taken a look at the issue of not being able to get sync progress while fulcrum is in the middle of it's initial index. I have a working solution with this PR.
This is fully working and has been tested on umbrelOS so please feel free to just merge it. I also updated the compose file in this repo so that the dev environment works (e.g., run
docker-compose up -d
to get things running on regtest. You can then mine blocks in the bitcoind container withbitcoin-cli -regtest generatetoaddress 1 "bcrt1qs758ursh4q9z627kt3pp5yysm78ddny6txaqgw"
).If you'd be able to merge this and build/push a new Docker image, then I will update the files at https://github.com/getumbrel/umbrel-apps/tree/master/fulcrum in a couple days with some changes that are needed to get things working properly in the app store (requires some env var changes, pre-start changes, and a new manifest key to allow it to be hot-swappable).
Changes:
TL/DR; I've hacked it a bit so that the frontend is parsing the fulcrum logs to get sync percent while fulcrum isn't listening on it's admin port (8000).
Two main changes:
Fulcrum has an admin port that we can query for info instead of the main tcp port that we are currently using. The new ElectrumX app I have working is doing something similar, so I have done the same thing here for easy maintainability.
Unfortunately though, unlike ElectrumX, fulcrum doesn't listen on the admin port until after it has completed the initial index. So this alone is not enough for us. I have opened an issue on fulcrum's repo asking if we can listen on the admin port right away, similar to how ElectrumX functions: Bind admin port for listening during synchronization cculianu/Fulcrum#263. If this is implemented then we can remove the log-parsing hack described below.
If the admin port is closed, we fall back to parsing the fulcrum logs to get sync percent. We always try the admin port first each time we poll from the frontend. Hopefully fulcrum devs can change things so that querying the admin port is possible during initial indexing and we can remove this hack.