Skip to content

compolabs/spark-subsquid-indexer

Repository files navigation

Spark OrderBook indexer

Contract: https://github.com/compolabs/orderbook-contract/tree/master/market-contract

Please refer to the documentation website for a thorough guide on all Squid indexer features

Local usage

  1. Clone the repository

    git clone git@github.com:compolabs/spark-subsquid-indexer.git
  2. Open it locally

    cd spark-subsquid-indexer
  3. First, install the latest version of Subsquid CLI as a global npm package

    npm i -g @subsquid/cli@latest
  4. Install dependencies

    npm i
  5. Generate TypeORM entities from the schema file

    sqd codegen
  6. Generate data access classes for an ABI file(s) in the ./abi folder

    sqd typegen
  7. Compile the project

    sqd build
  8. Launch Postgres database to store the data

    sqd up
  9. Apply database migrations to create the target schema

    sqd migration:generate
  10. Run indexer

sqd process
  1. In another terminal, launch the server (open http://localhost:4000/graphql)
sqd serve
  1. Shut down the database
sqd down