{"id":28889926,"url":"https://github.com/joincolony/subsquid","last_synced_at":"2025-07-27T18:05:45.796Z","repository":{"id":196905429,"uuid":"697241819","full_name":"JoinColony/subsquid","owner":"JoinColony","description":null,"archived":false,"fork":false,"pushed_at":"2023-10-12T13:18:31.000Z","size":1013,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-07T14:01:53.658Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JoinColony.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-09-27T10:36:49.000Z","updated_at":"2023-09-27T10:39:55.000Z","dependencies_parsed_at":"2023-10-13T00:19:57.041Z","dependency_job_id":null,"html_url":"https://github.com/JoinColony/subsquid","commit_stats":null,"previous_names":["joincolony/subsquid"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/JoinColony/subsquid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoinColony%2Fsubsquid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoinColony%2Fsubsquid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoinColony%2Fsubsquid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoinColony%2Fsubsquid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JoinColony","download_url":"https://codeload.github.com/JoinColony/subsquid/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JoinColony%2Fsubsquid/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261042954,"owners_count":23101778,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-21T00:31:26.078Z","updated_at":"2025-07-27T18:05:45.779Z","avatar_url":"https://github.com/JoinColony.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/subsquid/squid-evm-template)\n\n# Minimal EVM squid\n\nThis is a starter template of a squid indexer for EVM networks (Ethereum, Polygon, BSC, etc.). See [Squid SDK docs](https://docs.subsquid.io/) for a complete reference.\n\nTo extract EVM logs and transactions by a topic or a contract address, use `EvmBatchProcessor.addLog()` and `EvmBatchProcessor.addTransaction()` methods of the `EvmBatchProcessor` instance defined in `src/processor.ts`. \n\nThe requested data is transformed in batches by a single handler provided to the `processor.run()` method. \n\nFor a full list of supported networks and config options,\ncheck the [`EvmBatchProcessor` overview](https://docs.subsquid.io/develop-a-squid/evm-processor/) and the [configuration page](https://docs.subsquid.io/develop-a-squid/evm-processor/configuration/).\n\nFor a step-by-step migration guide from TheGraph, see [the dedicated docs page](https://docs.subsquid.io/migrate/migrate-subgraph/).\n\nDependencies: Node.js, Docker.\n\n## Quickstart\n\n```bash\n# 0. Install @subsquid/cli a.k.a. the sqd command globally\nnpm i -g @subsquid/cli\n\n# 1. Retrieve the template\nsqd init my_squid_name -t evm\ncd my_squid_name\n\n# 2. Install dependencies\nnpm ci\n\n# 3. Start a Postgres database container and detach\nsqd up\n\n# 4. Build and start the processor\nsqd process\n\n# 5. The command above will block the terminal\n#    being busy with fetching the chain data, \n#    transforming and storing it in the target database.\n#\n#    To start the graphql server open the separate terminal\n#    and run\nsqd serve\n```\nA GraphiQL playground will be available at [localhost:4350/graphql](http://localhost:4350/graphql).\n\n## Dev flow\n\n### 1. Define database schema\n\nStart development by defining the schema of the target database via `schema.graphql`.\nSchema definition consists of regular graphql type declarations annotated with custom directives.\nFull description of `schema.graphql` dialect is available [here](https://docs.subsquid.io/basics/schema-file).\n\n### 2. Generate TypeORM classes\n\nMapping developers use TypeORM [EntityManager](https://typeorm.io/#/working-with-entity-manager)\nto interact with target database during data processing. All necessary entity classes are\ngenerated by the squid framework from `schema.graphql`. This is done by running `sqd codegen`\ncommand.\n\n### 3. Generate database migrations\n\nAll database changes are applied through migration files located at `db/migrations`.\n`squid-typeorm-migration(1)` tool provides several commands to drive the process.\n\n```bash\n## drop create the database\nsqd down\nsqd up\n\n## replace any old schemas with a new one made from the entities\nsqd migration:generate\n```\nSee [docs on database migrations](https://docs.subsquid.io/basics/db-migrations) for more details.\n\n### 4. Import ABI contract and generate interfaces to decode events\n\nIt is necessary to import the respective ABI definition to decode EVM logs. One way to generate a type-safe facade class to decode EVM logs is by placing the relevant JSON ABIs to `./abi`, then using `squid-evm-typegen(1)` via an `sqd` script:\n\n```bash\nsqd typegen\n```\n\nSee more details on the [`squid-evm-typegen` doc page](https://docs.subsquid.io/evm-indexing/squid-evm-typegen).\n\n## Project conventions\n\nSquid tools assume a certain [project layout](https://docs.subsquid.io/basics/squid-structure):\n\n* All compiled js files must reside in `lib` and all TypeScript sources in `src`.\nThe layout of `lib` must reflect `src`.\n* All TypeORM classes must be exported by `src/model/index.ts` (`lib/model` module).\n* Database schema must be defined in `schema.graphql`.\n* Database migrations must reside in `db/migrations` and must be plain js files.\n* `sqd(1)` and `squid-*(1)` executables consult `.env` file for environment variables.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoincolony%2Fsubsquid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoincolony%2Fsubsquid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoincolony%2Fsubsquid/lists"}