apibara/dna

Persist state to MongoDB

fracek opened this issue · 1 comments

fracek commented

Is your feature request related to a problem? Please describe.

Users that want to sync onchain data to MongoDB may want to use the same database to persist the indexer's state.

Describe the solution you'd like

We should add a --persist-to-mongo option to persist data to a specific mongodb database, in the _indexers collection.

@fracek Hi, it seems to be a good issue to start to contribute. I'm an ODhack member. Could you assign that one to me.

Scope:

  1. There is a PersistenceClient enum to support Mongo.
  2. Add command flag to construct proper enum member, ensuring that mongo connection is configured
  3. Test persistence client
  4. update documentation.