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

Are there any ready-to-use dumps for utreexo #2

Open
MCJOHN974 opened this issue Oct 21, 2024 · 3 comments
Open

Are there any ready-to-use dumps for utreexo #2

MCJOHN974 opened this issue Oct 21, 2024 · 3 comments

Comments

@MCJOHN974
Copy link

Hi! I found this repo and what to do some project based on it. I want to get utreexo for some latest blocks (I'm ok with format this repo use). I tried to run code from this repo using esplora API, and found that it will taka around 10 days to fetch to the latest blocks. Probably, you have some utreexo dumps you can share?

@GradleD
Copy link

GradleD commented Oct 27, 2024

Using Esplora API Efficiently
Batch Requests
Instead of fetching blocks one by one, you can retrieve multiple blocks in a single request. The Esplora API supports batch requests through its endpoints, allowing you to gather data more quickly.

Example of Fetching Multiple Blocks
You can utilize the /blocks endpoint to get the latest blocks. However, to implement batching effectively, you may need to create a custom solution since Esplora does not have a dedicated batch endpoint. Here’s a suggested approach:

Fetch Latest Blocks:

Use the following endpoint to get the latest block details:

GET /blocks/tip/height
This returns the height of the latest block.
Retrieve Blocks in Batches:
Create a loop that fetches multiple blocks using their heights. For example, if you want to get the last 10 blocks, you can do:

for i in {0..9}; do
    curl "https://blockstream.info/api/block/$(($latest_height - $i))"
done

Considerations
Rate Limits: Be aware of any rate limits imposed by the API to avoid being throttled.
Error Handling: Implement error handling for failed requests to ensure your application can recover gracefully.
Parallel Requests: If your application allows, consider making parallel requests using asynchronous programming techniques to further speed up data retrieval.

@Davidson-Souza
Copy link
Owner

Hi! I found this repo and what to do some project based on it. I want to get utreexo for some latest blocks (I'm ok with format this repo use). I tried to run code from this repo using esplora API, and found that it will taka around 10 days to fetch to the latest blocks. Probably, you have some utreexo dumps you can share?

I don't. We may change some stuff, so I didn't bother.
The esplora thing is totally not optimized, I made this to keep up after ibd, because I have one running on signet. I don't think esplora will ever let us do this mich request, even with batching

@MCJOHN974 MCJOHN974 reopened this Feb 8, 2025
@MCJOHN974
Copy link
Author

MCJOHN974 commented Feb 8, 2025

Hi again @Davidson-Souza ! Maybe you have any ready to use dumps now? I mean, if you have some synced up bridge, can you pls share your .bridge folder

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

No branches or pull requests

3 participants