Skip to content

InverterNetwork/indexer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Inverter Protocol Indexer

Requirements

  • you have pnpm installed
  • you have docker installed
  • you have envio installed

Getting started

Install dependencies:

pnpm install

Generate code:

pnpm codegen

Run envio indexer locally with docker:

pnpm dev

Explore the graphql endpoint for indexed data:

Schema Management

This project uses a two-step GraphQL schema approach for better maintainability:

Source Schema (config.schema.graphql)

  • Contains the original GraphQL schema with interface definitions and spreads
  • Uses ...InterfaceName syntax to reference shared interface fields
  • This is the file you edit when making schema changes

Processed Schema (schema.graphql)

  • Automatically generated from config.schema.graphql
  • All interface spreads are expanded into their actual field definitions
  • Ready for code generation and indexing
  • Do not edit this file directly - it will be overwritten

How It Works

  1. Development/Codegen: The parse-schema.ts script automatically processes config.schema.graphqlschema.graphql
  2. Pre-commit Hook: Schema processing runs automatically before each commit to keep everything in sync
  3. Interface Resolution: All ...InterfaceName spreads are replaced with the actual interface field definitions

Example

# config.schema.graphql (what you edit)
interface FeeBase {
  timestamp: Int!
  amount: BigDecimal!
}

type ProjectFee implements FeeBase {
  ...FeeBase
  recipient: String!
}

# schema.graphql (automatically generated)
type ProjectFee {
  timestamp: Int!
  amount: BigDecimal!
  recipient: String!
}

Compiling

Make sure you have your docker pnpm dev running with your latest changes.

pnpm compile

Releasing

pnpm release

# Once ready to publish, run:

pnpm release:pub

About

Indexes events emitted by the Inverter Protocol

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages