zeitgeistpm / zeitgeist-subsquid

Zeitgeist chain block indexer and processor that provides data sets for powerful GraphQL queries.
7 stars 4 forks source link

Subsquid is used to index, process and query on top of Zeitgeist.

Zeitgeist's Self-Hosted Squids

Concept

The substrate events are processed in a multi-step pipeline:

Zeitgeist Chain => Subsquid Archive => Archive GraphQL Gateway => Subsquid Processor => Query Node API

Prerequisites

Quick Run

# 1. The dependencies setup
yarn install --frozen-lockfile

# 2. Init and start services
yarn spin

# 3. Launch GraphQl API
yarn api:start

Project Structure

Subsquid tools expect a certain directory layout:

Scripts

# Stop query-node
yarn api:stop

# Compile processor code
yarn build

# Generate necessary entity classes based on definitions at schema.graphql
yarn codegen

# Start processor services
yarn db:up

# Stop processor services
yarn db:down

# Run existing migrations onto database
yarn migration:apply

# Generate migration to match the target schema
# The target schema is derived from entity classes generated using codegen
yarn migration:generate

# Revert the last performed migration
yarn migration:revert

# Start processor
yarn processor:start

# Stop processor
yarn processor:stop

# Generate types for events defined at typegen.json
yarn typegen

Misc

For more details, please check out https://docs.zeitgeist.pm & https://docs.subsquid.io.