stacks-blockchain-api icon indicating copy to clipboard operation
stacks-blockchain-api copied to clipboard

API with SNP syncs from genesis even though DB is populated

Open CharlieC3 opened this issue 6 months ago • 0 comments

When connecting an API with a pre-populated DB to SNP, the API initiates a sync from genesis even though it already has all the data within its database. This causes a pretty significant slowdown when switching services over to SNP.

Currently a manual workaround exists which involves finding and fetching a certain ID from SNP's redis and inserting it into a special table in the API's DB, then restarting the API. But this process is not ideal, prone to further issues, and does not scale.

Ideally the API would detect what block it should start syncing from, and grab that relevant data from SNP.

CharlieC3 avatar Jun 18 '25 20:06 CharlieC3