Skip to main content

Squid project structure

All files and folders except package.json are optional.

  • package.json -- Configuration file for dependencies and the build script (invoked with npm run build). Hard requirement for deploying to Subsquid Cloud.
  • package-lock.json OR yarn.lock OR pnpm-lock.yaml -- Dependencies shrinkwrap. Required for Cloud deployment, except those that override the dependencies installation command.
  • tsconfig.json -- Configuration of tsc. Required for most squids.
  • Deployment manifest (squid.yaml by default) -- Definitions of squid services used for running it locally with sqd run and deploying to Subsquid Cloud.
  • .squidignore -- Files and patterns to be excluded when sending the squid code to the Cloud. When not supplied, some files will still be omitted: see the reference page for details.
  • schema.graphql -- The schema definition file. Required if your squid uses the built-in GraphQL server.
  • /src -- The TypeScript source code 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 -- A folder for user-defined GraphQL resolvers.
    • /src/types -- A folder for types generated by the Substrate typegen tool for use in data decoding.
    • /src/abi -- A folder for modules generated by the EVM typegen tool containing type definitions and data decoding boilerplate code.
  • /db -- The designated folder with the database migrations.
  • /lib -- The output folder for the compiled squid code.
  • /assets -- A designated folder for custom user-provided files (e.g. static data files to seed the squid processor with).
  • /abi -- A designated folder for JSON ABI files used as input by the EVM typegen.
  • docker-compose.yml -- A Docker compose file for local runs. Has a Postgres service definition by default.
  • .env -- Defines environment variables used by docker-compose.yml and when the squid is run locally.
  • typegen.json -- The config file for the Substrate typegen tool.
  • commands.json -- User-defined scripts picked up by Squid CLI. See also the CLI cheatsheet.