Skip to main content
Version: Current

Squid project structure

A squid is expected to follow the folder structure conventions listed below.

  • /db -- (Required) The designated folder with the database migrations.
  • /lib -- The output folder for the compiled squid code.
  • /src -- (Required) The source folder for the squid processor.
    • /src/main.ts -- The entry point of the squid processor process. Typically, contains a call.
    • /src/processor.ts -- Processor object (EVM or Substrate) definition and configuration.
    • /src/model/generated -- The folder for the TypeORM entities generated from schema.graphql.
    • /src/model -- The module exporting the entity classes.
    • /src/server-extension/resolvers -- An (optional) folder for user-defined GraphQL resolvers.
    • /src/types -- An (optional) output folder for the typegen-generated types for data decoding.
    • /src/abi -- An (optional) output folder for the typegen tools that generate type definitions and the data decoding boilerplate.
  • /assets -- (optional) A designated folder for custom user-provided files (e.g. static data files to seed the squid processor with).
  • /abi -- (optional) A designated folder for JSON ABI files used as input by the EVM typegen when it's called via sqd typegen.
  • schema.graphql -- (Required for GraphQL API) The schema definition file.
  • squid.yaml -- (Required) A manifest file for deploying the squid to Subsquid Cloud and running it locally with sqd run. See Deployment manifest for details.
  • docker-compose.yml -- A Docker compose file for local runs. Has a Postgres service definition by default. Ignored by Subsquid Cloud.
  • .env -- Defines environment variables used by docker-compose.yml and when the squid is run locally. Ignored by Subsquid Cloud.
  • typegen.json -- (optional) The config file for sqd typegen. Ignored by Subsquid Cloud.
  • commands.json -- User-defined scripts picked up by Squid CLI. See also the CLI cheatsheet.
  • tsconfig.json, package-lock.json, package.json -- (Required) The npm and tsc configs.