998 B
998 B
Overview
This document will go through some notes on the database component of the statediff service.
Components
- Indexer: The indexer creates IPLD and DB models to insert to the Postgres DB. It performs the insert utilizing and atomic function.
- Builder: The builder constructs the statediff object that needs to be inserted.
- Known Gaps: Captures any gaps that might have occured and either writes them to the DB, local sql file, to prometeus, or a local error.
Making Code Changes
Adding a New Function to the Indexer
If you want to implement a new feature for adding data to the database. Keep the following in mind:
- You need to handle
sql
,file
, anddump
.sql
- Contains the code needed to write directly to thesql
db.file
- Contains all the code required to write the SQL statements to a file.dump
- Contains all the code for outputting events to the console.
- You will have to add it to the
interfaces.StateDiffIndexer
interface.