mina-indexer
mina-indexer copied to clipboard
Server start up causes mysterious errors on changes in database schema
Example error:
2024-04-29T11:19:30.561480-04:00 - ERROR Error in server initialization: unknown variant `network`, expected `V1` or `V2` at line 1 column 10
Changes were introduced in https://github.com/Granola-Team/mina-indexer/pull/821 that caused the above error until a user resets their database (e.g. rm -rf ~/.mina-indexer/database
).
We should store a schema hash/version in the database. We should then read that as one of the first steps on server start and if the hash/version mismatches, throw an error that explains this to the user.