stacks-blockchain-api
stacks-blockchain-api copied to clipboard
API with SNP syncs from genesis even though DB is populated
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.