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

Display sync progress during initial indexing #3

Merged
merged 4 commits into from
Nov 18, 2024

Conversation

nmfretz
Copy link

@nmfretz nmfretz commented Nov 16, 2024

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 with bitcoin-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:

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

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

@sahilph sahilph merged commit 2e52b24 into sahilph:master Nov 18, 2024
@sahilph
Copy link
Owner

sahilph commented Nov 18, 2024

@nmfretz This is awesome. Thanks for the modifications. I have tested this and it works fine . I have merged this with master and the docker build is now in progress. I will reply back with the hash, when it finishes building.

@sahilph
Copy link
Owner

sahilph commented Nov 18, 2024

@nmfretz Here is the docker image with hash;

ghcr.io/sahilph/umbrel-fulcrum:sha-2e52b24@sha256:7a7bcc00a3dd41d2c5034b1e8b59bf2c83b0d6f311cdfa405ffbbf2940d7985c

@nmfretz
Copy link
Author

nmfretz commented Nov 19, 2024

Wonderful, thanks @sahilph!

I have updated Fulcrum with your image here: getumbrel/umbrel-apps@a68418a

Fulcrum is now fully interchangeable with Electrs on umbrelOS. I've also tweaked the UI port to make sure it doesn't clash with Core Lightning.

@sahilph
Copy link
Owner

sahilph commented Nov 19, 2024

That's awesome. Thanks 👍

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

Successfully merging this pull request may close these issues.

2 participants