├── .dockerignore ├── .editorconfig ├── .eslintignore ├── .eslintrc.js ├── .github ├── ISSUE_TEMPLATE.md ├── PULL_REQUEST_TEMPLATE.md ├── actions │ ├── create-prerelease │ │ ├── action.yml │ │ └── remove-stable-version.js │ └── create-release │ │ ├── action.yml │ │ └── gh-release-script.js ├── dependabot.yml └── workflows │ ├── benchmark.yml │ ├── discord.yml │ ├── gh-release.yml │ ├── node-docker.yml │ ├── pr.yml │ ├── prerelease.yml │ ├── query-docker.yml │ ├── release.yml │ ├── scripts │ ├── benchmark │ │ ├── Dockerfile │ │ ├── benchmarking.sh │ │ ├── cleanHistory.sh │ │ └── queryMeta.sh │ ├── nodeVersion.sh │ └── queryVersion.sh │ └── sync-sdks.yml ├── .gitignore ├── .gitpod.dockerfile ├── .gitpod.yml ├── .husky ├── .gitignore └── pre-commit ├── .prettierignore ├── .prettierrc ├── .yarn ├── plugins │ └── @yarnpkg │ │ ├── plugin-interactive-tools.cjs │ │ ├── plugin-typescript.cjs │ │ ├── plugin-version.cjs │ │ └── plugin-workspace-tools.cjs ├── releases │ └── yarn-3.2.4.cjs └── versions │ ├── 009f3ed3.yml │ ├── 027a768d.yml │ ├── 043f60d9.yml │ ├── 0499e67a.yml │ ├── 04fe5109.yml │ ├── 0659b210.yml │ ├── 06878261.yml │ ├── 06f061c2.yml │ ├── 0a6cfead.yml │ ├── 0b41d534.yml │ ├── 0c630ddb.yml │ ├── 0c8bf25d.yml │ ├── 0d3c95d9.yml │ ├── 0e4241fb.yml │ ├── 104b6218.yml │ ├── 1288810f.yml │ ├── 12a92ad2.yml │ ├── 12c5da87.yml │ ├── 12f2ee2a.yml │ ├── 1419f252.yml │ ├── 1447e381.yml │ ├── 14e4dc88.yml │ ├── 16f0d61b.yml │ ├── 185d73c5.yml │ ├── 18951341.yml │ ├── 1ab8a1a3.yml │ ├── 1bbf92cf.yml │ ├── 1be0b830.yml │ ├── 1c09bcf3.yml │ ├── 1d7a8221.yml │ ├── 1de6dc61.yml │ ├── 216439fa.yml │ ├── 25310217.yml │ ├── 2584b0f2.yml │ ├── 25cf0a18.yml │ ├── 26d2bede.yml │ ├── 28043ba8.yml │ ├── 2805a1cf.yml │ ├── 29bf85e7.yml │ ├── 2b04685f.yml │ ├── 2c10a261.yml │ ├── 2cc4a2fb.yml │ ├── 2d3b7b53.yml │ ├── 2d3c26d4.yml │ ├── 2d61ee26.yml │ ├── 2dfadf46.yml │ ├── 2eebe132.yml │ ├── 304647ef.yml │ ├── 31de9883.yml │ ├── 322d5d1f.yml │ ├── 3349f1f9.yml │ ├── 33e756ee.yml │ ├── 350b5b09.yml │ ├── 351b62d7.yml │ ├── 35b703be.yml │ ├── 35c43c59.yml │ ├── 35f00361.yml │ ├── 36f01785.yml │ ├── 37b48f24.yml │ ├── 37e31b0c.yml │ ├── 381d4907.yml │ ├── 382f2b82.yml │ ├── 3938a2bc.yml │ ├── 3b3e24c8.yml │ ├── 3d650c95.yml │ ├── 3fbcf2a0.yml │ ├── 3fc924ed.yml │ ├── 4078a944.yml │ ├── 40b6bbec.yml │ ├── 41c9116c.yml │ ├── 41e737e2.yml │ ├── 4303222c.yml │ ├── 445ef638.yml │ ├── 457bc38f.yml │ ├── 46402fec.yml │ ├── 46adba99.yml │ ├── 46b26b5d.yml │ ├── 47d21b05.yml │ ├── 4820d418.yml │ ├── 48ba8de1.yml │ ├── 499171ed.yml │ ├── 49d09eed.yml │ ├── 4b76fe18.yml │ ├── 4b8d567b.yml │ ├── 4c2f3697.yml │ ├── 4c39a3cb.yml │ ├── 4c67dbef.yml │ ├── 4ce88dfa.yml │ ├── 4d1a19ef.yml │ ├── 4de1b78e.yml │ ├── 4e58ec39.yml │ ├── 4eb161fe.yml │ ├── 4ef5ee6c.yml │ ├── 4ef73239.yml │ ├── 4feb4cb4.yml │ ├── 5284b2e3.yml │ ├── 5311ca5a.yml │ ├── 532ac853.yml │ ├── 53d32974.yml │ ├── 53f030f6.yml │ ├── 550fcf8e.yml │ ├── 552aabf7.yml │ ├── 56fc2408.yml │ ├── 57a75c3c.yml │ ├── 5ae3de1b.yml │ ├── 5c14c916.yml │ ├── 5dc4e96b.yml │ ├── 5f92bb54.yml │ ├── 610a5feb.yml │ ├── 61b6fc48.yml │ ├── 645f2b52.yml │ ├── 646d8ce7.yml │ ├── 65681adf.yml │ ├── 6590072c.yml │ ├── 65da9ecd.yml │ ├── 686e36f7.yml │ ├── 689d69d4.yml │ ├── 68dba50f.yml │ ├── 69505fd5.yml │ ├── 6a2da136.yml │ ├── 6b90a9bc.yml │ ├── 6bc3e193.yml │ ├── 6bc752bc.yml │ ├── 6ca7bbbf.yml │ ├── 6cdd41ea.yml │ ├── 6f262f92.yml │ ├── 6f785cb6.yml │ ├── 6fbb21ed.yml │ ├── 6fdfdb04.yml │ ├── 6ffda578.yml │ ├── 722926be.yml │ ├── 7243e463.yml │ ├── 74d627f7.yml │ ├── 74e58e5b.yml │ ├── 75c144d8.yml │ ├── 75d37c61.yml │ ├── 76034c6c.yml │ ├── 78a188b4.yml │ ├── 792d5a54.yml │ ├── 7bd9e3d4.yml │ ├── 7c0eab27.yml │ ├── 7cd00a40.yml │ ├── 7cd681fd.yml │ ├── 7d2a0be3.yml │ ├── 7d9c7c44.yml │ ├── 7e7541ea.yml │ ├── 7f040c3e.yml │ ├── 801fb397.yml │ ├── 809ea2e4.yml │ ├── 8374b398.yml │ ├── 839fb9d1.yml │ ├── 83bb6400.yml │ ├── 848e4e2b.yml │ ├── 8492acfd.yml │ ├── 84941eaf.yml │ ├── 857e5ecd.yml │ ├── 8601d478.yml │ ├── 863b06ea.yml │ ├── 86ccde0d.yml │ ├── 8868808f.yml │ ├── 889ef0f3.yml │ ├── 88fc2bd8.yml │ ├── 8a413ac0.yml │ ├── 8db1483b.yml │ ├── 8e400644.yml │ ├── 9028a0bb.yml │ ├── 91e494d1.yml │ ├── 920dae9d.yml │ ├── 92e577ad.yml │ ├── 92ff9489.yml │ ├── 936dc023.yml │ ├── 94b199e8.yml │ ├── 94c458c9.yml │ ├── 94e27173.yml │ ├── 9697cad0.yml │ ├── 99cf5827.yml │ ├── 9a8e6f5d.yml │ ├── 9b3e8476.yml │ ├── 9eb1a879.yml │ ├── 9f00000f.yml │ ├── 9f0e3f63.yml │ ├── a2c2414d.yml │ ├── a32f012b.yml │ ├── a45f2358.yml │ ├── a48f5a85.yml │ ├── a5397fcf.yml │ ├── a5707e08.yml │ ├── a731a8ae.yml │ ├── a9d498ca.yml │ ├── abc53221.yml │ ├── ac20c55f.yml │ ├── ad1e1894.yml │ ├── aed25208.yml │ ├── aee1ecce.yml │ ├── aff12ab8.yml │ ├── aff73acf.yml │ ├── b027b217.yml │ ├── b03d4318.yml │ ├── b0fa9de1.yml │ ├── b2e2403b.yml │ ├── b426a40b.yml │ ├── b4e981f5.yml │ ├── b5edf689.yml │ ├── b774fd26.yml │ ├── b7f761b8.yml │ ├── b9a59bb0.yml │ ├── b9fbde3d.yml │ ├── ba107355.yml │ ├── ba8ed0a5.yml │ ├── bad2bdac.yml │ ├── bc5d92ce.yml │ ├── bd58ec77.yml │ ├── bf0c3052.yml │ ├── c03d8f8e.yml │ ├── c0558c15.yml │ ├── c0f27d9b.yml │ ├── c285fbd3.yml │ ├── c31e963e.yml │ ├── c4866a61.yml │ ├── c53f3d2c.yml │ ├── c92ce9ed.yml │ ├── ca56439e.yml │ ├── cb885b36.yml │ ├── cd1b2f42.yml │ ├── d11aeeaf.yml │ ├── d2b1da3c.yml │ ├── d2d9e21c.yml │ ├── d408027a.yml │ ├── d52444a9.yml │ ├── d5ba03dd.yml │ ├── d6f4a8f0.yml │ ├── d80bd429.yml │ ├── d8be227b.yml │ ├── d9e0b292.yml │ ├── da057245.yml │ ├── db4f7e5e.yml │ ├── dbb42c9d.yml │ ├── dbefade5.yml │ ├── dc0e431b.yml │ ├── dc12d9bd.yml │ ├── e0c9f4f0.yml │ ├── e2a9b214.yml │ ├── e4f4b87b.yml │ ├── e5f68ec8.yml │ ├── e67c5647.yml │ ├── e6985a5f.yml │ ├── e6aa2497.yml │ ├── e74a08eb.yml │ ├── e7d60c2f.yml │ ├── e8cc0f85.yml │ ├── eb626a6c.yml │ ├── ebb85f62.yml │ ├── ec268f6d.yml │ ├── ecf335ea.yml │ ├── ee2043f1.yml │ ├── ee841b6d.yml │ ├── eee92eb3.yml │ ├── ef1533bb.yml │ ├── ef86740e.yml │ ├── f2404812.yml │ ├── f4be8046.yml │ ├── f5fd9c46.yml │ ├── f6c96839.yml │ ├── f94438ba.yml │ ├── fbe61a9b.yml │ ├── fc193ed1.yml │ ├── fc8527ab.yml │ ├── fd047138.yml │ ├── fd2e440b.yml │ ├── fee55ccb.yml │ ├── ff271075.yml │ └── ff80eab6.yml ├── .yarnrc.yml ├── CODE_OF_CONDUCT.md ├── LICENSE ├── README.md ├── SECURITY.md ├── babel.config.js ├── contributing.md ├── crowdin.yaml ├── deploy ├── k8s │ ├── README.md │ └── deploy.yaml └── logging_debug.png ├── jest.config.js ├── package.json ├── packages ├── cli │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── bin │ │ ├── run │ │ └── run.cmd │ ├── package.json │ ├── src │ │ ├── commands │ │ │ ├── build │ │ │ │ └── index.ts │ │ │ ├── codegen │ │ │ │ ├── generate.ts │ │ │ │ └── index.ts │ │ │ ├── deployment │ │ │ │ ├── delete.ts │ │ │ │ ├── deploy.ts │ │ │ │ ├── index.ts │ │ │ │ └── promote.ts │ │ │ ├── init.ts │ │ │ ├── migrate.test.ts │ │ │ ├── migrate.ts │ │ │ ├── multi-chain │ │ │ │ ├── add.ts │ │ │ │ └── deploy.ts │ │ │ ├── project │ │ │ │ ├── create-project.ts │ │ │ │ ├── delete-project.ts │ │ │ │ └── index.ts │ │ │ ├── publish.test.ts │ │ │ └── publish.ts │ │ ├── constants.ts │ │ ├── controller │ │ │ ├── add-chain-controller.spec.ts │ │ │ ├── add-chain-controller.ts │ │ │ ├── build-controller.spec.ts │ │ │ ├── build-controller.ts │ │ │ ├── codegen-controller.spec.ts │ │ │ ├── codegen-controller.test.ts │ │ │ ├── codegen-controller.ts │ │ │ ├── codegen-cosmos.test.ts │ │ │ ├── deploy-controller.spec.ts │ │ │ ├── deploy-controller.test.ts │ │ │ ├── deploy-controller.ts │ │ │ ├── generate-controller.spec.ts │ │ │ ├── generate-controller.test.ts │ │ │ ├── generate-controller.ts │ │ │ ├── init-controller.spec.ts │ │ │ ├── init-controller.test.ts │ │ │ ├── init-controller.ts │ │ │ ├── migrate │ │ │ │ ├── abis │ │ │ │ │ └── migrate-abis.controller.ts │ │ │ │ ├── constants.ts │ │ │ │ ├── index.ts │ │ │ │ ├── manifest │ │ │ │ │ ├── ethereum.spec.ts │ │ │ │ │ ├── ethereum.ts │ │ │ │ │ ├── migrate-manifest.controller.spec.ts │ │ │ │ │ └── migrate-manifest.controller.ts │ │ │ │ ├── mapping │ │ │ │ │ └── migrate-mapping.controller.ts │ │ │ │ ├── migrate-controller.spec.ts │ │ │ │ ├── migrate-controller.ts │ │ │ │ ├── migrate.fixtures.ts │ │ │ │ ├── schema │ │ │ │ │ ├── __snapshots__ │ │ │ │ │ │ └── migrate-schema.controller.spec.ts.snap │ │ │ │ │ ├── migrate-schema.controller.spec.ts │ │ │ │ │ └── migrate-schema.controller.ts │ │ │ │ └── types.ts │ │ │ ├── project-controller.spec.ts │ │ │ ├── project-controller.ts │ │ │ ├── publish-controller.spec.ts │ │ │ ├── publish-controller.ts │ │ │ └── validate.spec.ts │ │ ├── createProject.fixtures.ts │ │ ├── index.ts │ │ ├── jsonrpc │ │ │ ├── client │ │ │ │ ├── http.ts │ │ │ │ ├── index.ts │ │ │ │ ├── types.ts │ │ │ │ └── ws.ts │ │ │ ├── index.ts │ │ │ └── jsonrpc.test.ts │ │ ├── modulars │ │ │ ├── config.ts │ │ │ ├── index.ts │ │ │ ├── moduleLoader.ts │ │ │ ├── types.ts │ │ │ └── utils.ts │ │ ├── template │ │ │ ├── datasource-templates.ts.ejs │ │ │ ├── enum.ts.ejs │ │ │ ├── interface.ts.ejs │ │ │ ├── model.ts.ejs │ │ │ ├── models-index.ts.ejs │ │ │ ├── project.ts.ejs │ │ │ ├── scaffold-handlers.ts.ejs │ │ │ └── types-index.ts.ejs │ │ ├── types.ts │ │ └── utils │ │ │ ├── build.spec.ts │ │ │ ├── build.ts │ │ │ ├── index.ts │ │ │ ├── networkFamily.spec.ts │ │ │ ├── networkFamily.ts │ │ │ └── utils.ts │ ├── test │ │ ├── abiTest1 │ │ │ ├── abis │ │ │ │ ├── abis.json │ │ │ │ ├── artifact.json │ │ │ │ └── artifact.sol │ │ │ │ │ └── artifact.json │ │ │ └── project.yaml │ │ ├── abiTest2 │ │ │ ├── abis │ │ │ │ └── artifact.json │ │ │ └── project.yaml │ │ ├── build │ │ │ ├── package.json │ │ │ ├── src │ │ │ │ ├── chainTypes.ts │ │ │ │ ├── index.ts │ │ │ │ └── test │ │ │ │ │ └── mappingHandler.test.ts │ │ │ └── tsconfig.json │ │ ├── jsoncConfig │ │ │ └── tsconfig.json │ │ ├── migrate │ │ │ └── testProject │ │ │ │ ├── package.json │ │ │ │ └── subgraph.yaml │ │ ├── protoTest1 │ │ │ ├── project.yaml │ │ │ └── proto │ │ │ │ ├── cosmos │ │ │ │ └── base │ │ │ │ │ └── v1beta1 │ │ │ │ │ └── coin.proto │ │ │ │ └── osmosis │ │ │ │ ├── gamm │ │ │ │ └── v1beta1 │ │ │ │ │ └── tx.proto │ │ │ │ └── poolmanager │ │ │ │ └── v1beta1 │ │ │ │ └── swap_route.proto │ │ ├── schemaTest │ │ │ ├── abis │ │ │ │ └── erc721.json │ │ │ ├── badEntity.graphql │ │ │ ├── badschema.graphql │ │ │ ├── camelcaseEntityName.graphql │ │ │ ├── dbTypeSchema.graphql │ │ │ ├── duplicateEnum.graphql │ │ │ ├── generate-project-2.yaml │ │ │ ├── generate-project.yaml │ │ │ ├── non-evm-project.yaml │ │ │ ├── package.json │ │ │ ├── project-bad-entity.yaml │ │ │ ├── project-bad-schema.yaml │ │ │ ├── project-case-sensitive-import-entity.yaml │ │ │ ├── project-cosmos.yaml │ │ │ ├── project-duplicate-enum.yaml │ │ │ ├── project-id-type.yaml │ │ │ ├── project-no-abi.yaml │ │ │ ├── project-no-assets.yaml │ │ │ ├── project-templates-abi.yaml │ │ │ ├── project.ts │ │ │ ├── project.yaml │ │ │ ├── schema.graphql │ │ │ └── typechain-test.yaml │ │ ├── ts-manifest │ │ │ ├── erc20.json │ │ │ └── project.ts │ │ └── tsManifestTest │ │ │ ├── project1.ts │ │ │ ├── project2.ts │ │ │ ├── project3.yaml │ │ │ ├── subquery-multichain.ts │ │ │ ├── subquery-multichain2.ts │ │ │ ├── subquery-multichain3.ts │ │ │ └── subquery-multichain4.yaml │ └── tsconfig.json ├── common-substrate │ ├── CHANGELOG.md │ ├── LICENSE │ ├── package.json │ ├── src │ │ ├── index.ts │ │ └── project │ │ │ ├── index.ts │ │ │ ├── load.spec.ts │ │ │ ├── load.ts │ │ │ ├── models.ts │ │ │ ├── project.spec.ts │ │ │ ├── types.ts │ │ │ ├── utils.ts │ │ │ └── versioned │ │ │ ├── ProjectManifestVersioned.ts │ │ │ ├── index.ts │ │ │ └── v1_0_0 │ │ │ ├── index.ts │ │ │ └── model.ts │ ├── test │ │ ├── project_1.0.0.yaml │ │ ├── project_1.0.0_bad_processor.yaml │ │ ├── project_1.0.0_bad_runner.yaml │ │ ├── project_1.0.0_bad_runner_version.yaml │ │ ├── project_1.0.0_chainId.yaml │ │ ├── project_1.0.0_custom_ds.yaml │ │ ├── project_1.0.0_falsy.yaml │ │ ├── project_1.0.0_falsy_array.yaml │ │ ├── project_1.0.0_node_options.yaml │ │ ├── project_1.0.0_runner_ds_mismatch.yaml │ │ ├── project_bypass.yaml │ │ ├── project_bypass_range.yaml │ │ └── project_invalid_version.yaml │ └── tsconfig.json ├── common │ ├── CHANGELOG.md │ ├── LICENSE │ ├── fixtures │ │ ├── package.json │ │ └── project.yaml │ ├── package.json │ ├── src │ │ ├── constants.ts │ │ ├── index.ts │ │ ├── multichain │ │ │ ├── index.ts │ │ │ └── models.ts │ │ └── project │ │ │ ├── IpfsHttpClientLite │ │ │ ├── IPFSHTTPClientLite.ts │ │ │ ├── IpfsHttpClientLite.spec.ts │ │ │ ├── index.ts │ │ │ └── utils.ts │ │ │ ├── index.ts │ │ │ ├── load.ts │ │ │ ├── readers │ │ │ ├── github-reader.spec.ts │ │ │ ├── github-reader.ts │ │ │ ├── index.ts │ │ │ ├── ipfs-reader.spec.ts │ │ │ ├── ipfs-reader.ts │ │ │ ├── local-reader.spec.ts │ │ │ ├── local-reader.ts │ │ │ ├── reader.spec.ts │ │ │ └── reader.ts │ │ │ ├── utils.ts │ │ │ └── versioned │ │ │ ├── base.ts │ │ │ ├── index.ts │ │ │ └── v1_0_0 │ │ │ ├── index.ts │ │ │ ├── model.spec.ts │ │ │ └── models.ts │ ├── test │ │ ├── mockedSubqueryProject.tgz │ │ ├── project.yaml │ │ ├── project_0.2.0.yaml │ │ ├── project_0.2.0_custom_ds.yaml │ │ ├── project_0.2.0_invalid_custom_ds.yaml │ │ ├── project_falsy.yaml │ │ ├── project_falsy_array.yaml │ │ └── project_invalid_version.yaml │ └── tsconfig.json ├── node-core │ ├── CHANGELOG.md │ ├── LICENSE │ ├── logger.js │ ├── package.json │ ├── src │ │ ├── admin │ │ │ ├── admin.controller.spec.ts │ │ │ ├── admin.controller.ts │ │ │ ├── blockRange.test.ts │ │ │ ├── blockRange.ts │ │ │ └── index.ts │ │ ├── api.connection.error.ts │ │ ├── api.service.spec.ts │ │ ├── api.service.ts │ │ ├── blockchain.service.ts │ │ ├── configure │ │ │ ├── NodeConfig.spec.ts │ │ │ ├── NodeConfig.ts │ │ │ ├── ProjectUpgrade.service.spec.ts │ │ │ ├── ProjectUpgrade.service.ts │ │ │ ├── SubqueryProject.ts │ │ │ ├── configure.module.spec.ts │ │ │ ├── configure.module.ts │ │ │ └── index.ts │ │ ├── db │ │ │ ├── db.module.test.ts │ │ │ ├── db.module.ts │ │ │ ├── index.ts │ │ │ ├── migration-service │ │ │ │ ├── SchemaMigration.service.spec.ts │ │ │ │ ├── SchemaMigration.service.test.ts │ │ │ │ ├── SchemaMigration.service.ts │ │ │ │ ├── index.ts │ │ │ │ ├── migration-helpers.ts │ │ │ │ └── migration.ts │ │ │ ├── sequelizeUtil.ts │ │ │ ├── sync-helper.spec.ts │ │ │ ├── sync-helper.test.ts │ │ │ └── sync-helper.ts │ │ ├── events.ts │ │ ├── index.ts │ │ ├── indexer │ │ │ ├── StoreOperations.spec.ts │ │ │ ├── StoreOperations.test.ts │ │ │ ├── StoreOperations.ts │ │ │ ├── benchmark.service.ts │ │ │ ├── blockDispatcher │ │ │ │ ├── base-block-dispatcher.ts │ │ │ │ ├── block-dispatcher.spec.ts │ │ │ │ ├── block-dispatcher.ts │ │ │ │ ├── factory.ts │ │ │ │ ├── index.ts │ │ │ │ └── worker-block-dispatcher.ts │ │ │ ├── connectionPool.service.spec.ts │ │ │ ├── connectionPool.service.ts │ │ │ ├── connectionPoolState.manager.spec.ts │ │ │ ├── connectionPoolState.manager.ts │ │ │ ├── core.module.ts │ │ │ ├── dictionary │ │ │ │ ├── coreDictionary.ts │ │ │ │ ├── dictionary.fixtures.ts │ │ │ │ ├── dictionary.service.spec.ts │ │ │ │ ├── dictionary.service.ts │ │ │ │ ├── index.ts │ │ │ │ ├── types.ts │ │ │ │ ├── utils.spec.ts │ │ │ │ ├── utils.ts │ │ │ │ ├── v1 │ │ │ │ │ ├── dictionaryV1.spec.ts │ │ │ │ │ ├── dictionaryV1.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ └── utils.ts │ │ │ │ └── v2 │ │ │ │ │ ├── dictionaryV2.spec.ts │ │ │ │ │ ├── dictionaryV2.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ └── types.ts │ │ │ ├── ds-processor.service.spec.ts │ │ │ ├── ds-processor.service.ts │ │ │ ├── dynamic-ds.service.spec.ts │ │ │ ├── dynamic-ds.service.ts │ │ │ ├── entities │ │ │ │ ├── GlobalData.entity.ts │ │ │ │ ├── Metadata.entity.ts │ │ │ │ ├── Poi.entity.ts │ │ │ │ └── index.ts │ │ │ ├── fetch.service.spec.ts │ │ │ ├── fetch.service.ts │ │ │ ├── inMemoryCache.service.spec.ts │ │ │ ├── inMemoryCache.service.ts │ │ │ ├── index.ts │ │ │ ├── indexer.manager.ts │ │ │ ├── monitor.service.test.ts │ │ │ ├── monitor.service.ts │ │ │ ├── multiChainRewind.service.test.ts │ │ │ ├── multiChainRewind.service.ts │ │ │ ├── poi │ │ │ │ ├── PoiBlock.spec.ts │ │ │ │ ├── PoiBlock.ts │ │ │ │ ├── index.ts │ │ │ │ ├── poi.service.spec.ts │ │ │ │ ├── poi.service.ts │ │ │ │ ├── poiSync.service.spec.ts │ │ │ │ └── poiSync.service.ts │ │ │ ├── project.service.spec.ts │ │ │ ├── project.service.ts │ │ │ ├── sandbox.service.ts │ │ │ ├── sandbox.spec.ts │ │ │ ├── sandbox.ts │ │ │ ├── store.service.spec.ts │ │ │ ├── store.service.test.ts │ │ │ ├── store.service.ts │ │ │ ├── store │ │ │ │ ├── entity.ts │ │ │ │ ├── index.ts │ │ │ │ └── store.ts │ │ │ ├── storeModelProvider │ │ │ │ ├── baseCache.service.ts │ │ │ │ ├── baseStoreModel.service.ts │ │ │ │ ├── cacheable.ts │ │ │ │ ├── exporters │ │ │ │ │ ├── csvStore.spec.ts │ │ │ │ │ ├── csvStore.ts │ │ │ │ │ ├── exporter.ts │ │ │ │ │ └── index.ts │ │ │ │ ├── global │ │ │ │ │ ├── global.ts │ │ │ │ │ └── index.ts │ │ │ │ ├── index.ts │ │ │ │ ├── metadata │ │ │ │ │ ├── cacheMetadata.spec.ts │ │ │ │ │ ├── cacheMetadata.test.ts │ │ │ │ │ ├── cacheMetadata.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── metadata.ts │ │ │ │ │ └── utils.ts │ │ │ │ ├── model │ │ │ │ │ ├── cacheModel.spec.ts │ │ │ │ │ ├── cacheModel.test.ts │ │ │ │ │ ├── cacheModel.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── model.test.ts │ │ │ │ │ ├── model.ts │ │ │ │ │ └── utils.ts │ │ │ │ ├── poi │ │ │ │ │ ├── cachePoi.spec.ts │ │ │ │ │ ├── cachePoi.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ └── poi.ts │ │ │ │ ├── setValueModel.spec.ts │ │ │ │ ├── setValueModel.ts │ │ │ │ ├── storeCache.service.spec.ts │ │ │ │ ├── storeCache.service.ts │ │ │ │ ├── storeModel.service.spec.ts │ │ │ │ ├── storeModel.service.ts │ │ │ │ ├── types.ts │ │ │ │ └── utils.ts │ │ │ ├── test.runner.spec.ts │ │ │ ├── test.runner.ts │ │ │ ├── testing.service.ts │ │ │ ├── types.ts │ │ │ ├── unfinalizedBlocks.service.spec.ts │ │ │ ├── unfinalizedBlocks.service.ts │ │ │ └── worker │ │ │ │ ├── index.ts │ │ │ │ ├── test.store.worker.ts │ │ │ │ ├── utils.ts │ │ │ │ ├── worker.builder.ts │ │ │ │ ├── worker.cache.service.ts │ │ │ │ ├── worker.connectionPoolState.manager.ts │ │ │ │ ├── worker.core.module.ts │ │ │ │ ├── worker.dynamic-ds.service.ts │ │ │ │ ├── worker.monitor.service.ts │ │ │ │ ├── worker.service.ts │ │ │ │ ├── worker.store.service.test.ts │ │ │ │ ├── worker.store.service.ts │ │ │ │ ├── worker.ts │ │ │ │ └── worker.unfinalizedBlocks.service.ts │ │ ├── logger.ts │ │ ├── meta │ │ │ ├── event.listener.ts │ │ │ ├── health.controller.ts │ │ │ ├── health.service.ts │ │ │ ├── index.ts │ │ │ ├── meta.controller.ts │ │ │ ├── meta.module.ts │ │ │ ├── meta.service.ts │ │ │ ├── meta.ts │ │ │ ├── ready.controller.ts │ │ │ └── ready.service.ts │ │ ├── process.ts │ │ ├── profiler.ts │ │ ├── subcommands │ │ │ ├── forceClean.module.ts │ │ │ ├── forceClean.service.ts │ │ │ ├── foreceClean.init.ts │ │ │ ├── index.ts │ │ │ ├── reindex.init.ts │ │ │ ├── reindex.service.ts │ │ │ └── testing.core.module.ts │ │ ├── utils │ │ │ ├── bigint.ts │ │ │ ├── blockHeightMap.spec.ts │ │ │ ├── blockHeightMap.ts │ │ │ ├── blocks.spec.ts │ │ │ ├── blocks.ts │ │ │ ├── configure.spec.ts │ │ │ ├── configure.ts │ │ │ ├── decorators.ts │ │ │ ├── fetchHelper.spec.ts │ │ │ ├── fetchHelpers.ts │ │ │ ├── graphql.ts │ │ │ ├── index.ts │ │ │ ├── object.spec.ts │ │ │ ├── object.ts │ │ │ ├── project.spec.ts │ │ │ ├── project.ts │ │ │ ├── promise.spec.ts │ │ │ ├── promise.ts │ │ │ ├── queues │ │ │ │ ├── autoQueue.spec.ts │ │ │ │ ├── autoQueue.ts │ │ │ │ ├── index.ts │ │ │ │ ├── queue.ts │ │ │ │ ├── rampQueue.spec.ts │ │ │ │ └── rampQueue.ts │ │ │ ├── reindex.ts │ │ │ ├── string.spec.ts │ │ │ └── string.ts │ │ └── yargs.ts │ ├── test │ │ ├── config.json │ │ ├── config.toml │ │ ├── config.yml │ │ ├── jsonfy.js │ │ ├── migration-schemas │ │ │ ├── test_10_1.graphql │ │ │ ├── test_10_1000.graphql │ │ │ ├── test_11_1.graphql │ │ │ ├── test_11_2000.graphql │ │ │ ├── test_12_1.graphql │ │ │ ├── test_12_2000.graphql │ │ │ ├── test_13_1.graphql │ │ │ ├── test_13_2000.graphql │ │ │ ├── test_14_1.graphql │ │ │ ├── test_14_1000.graphql │ │ │ ├── test_15_1.graphql │ │ │ ├── test_15_2000.graphql │ │ │ ├── test_15_4000.graphql │ │ │ ├── test_16_1.graphql │ │ │ ├── test_16_2000.graphql │ │ │ ├── test_17_1.graphql │ │ │ ├── test_17_2000.graphql │ │ │ ├── test_18_1.graphql │ │ │ ├── test_18_2000.graphql │ │ │ ├── test_19_1.graphql │ │ │ ├── test_19_2000.graphql │ │ │ ├── test_1_1.graphql │ │ │ ├── test_1_1000.graphql │ │ │ ├── test_20_1.graphql │ │ │ ├── test_20_2000.graphql │ │ │ ├── test_2_1.graphql │ │ │ ├── test_2_1000.graphql │ │ │ ├── test_5_1.graphql │ │ │ ├── test_5_1000.graphql │ │ │ ├── test_6_1.graphql │ │ │ └── test_6_2000.graphql │ │ ├── sandbox │ │ │ ├── atob-test.js │ │ │ ├── atob-test.ts │ │ │ ├── buffer-test.js │ │ │ ├── buffer-test.ts │ │ │ ├── main.js │ │ │ ├── main.ts │ │ │ ├── package.json │ │ │ ├── schema.graphql │ │ │ └── tsconfig.json │ │ ├── schemas │ │ │ ├── badSchema.graphql │ │ │ ├── badschema-2.graphql │ │ │ ├── newSchema.graphql │ │ │ ├── oldSchema.graphql │ │ │ └── schemaDiff.json │ │ └── v1.0.0 │ │ │ ├── distMock │ │ │ ├── chaintypes.js │ │ │ └── index.js │ │ │ ├── erc20.abi.json │ │ │ ├── package.json │ │ │ ├── project.yaml │ │ │ ├── projectOptions.yaml │ │ │ ├── schema.graphql │ │ │ └── types.yaml │ ├── tsconfig.json │ └── yargs.js ├── node │ ├── .gitignore │ ├── .prettierrc │ ├── .trigger │ ├── CHANGELOG.md │ ├── Dockerfile │ ├── LICENSE │ ├── README.md │ ├── bin │ │ ├── run │ │ └── run.cmd │ ├── docker │ │ ├── cockroach-db │ │ │ └── docker-compose.yml │ │ ├── docker-compose.yml │ │ ├── load-extensions.sh │ │ └── pg-Dockerfile │ ├── nest-cli.json │ ├── nodemon.json │ ├── package.json │ ├── src │ │ ├── app.module.ts │ │ ├── blockchain.service.spec.ts │ │ ├── blockchain.service.ts │ │ ├── configure │ │ │ ├── NodeConfig.ts │ │ │ ├── SchemaMigration.service.test.ts │ │ │ ├── SubqueryProject.spec.ts │ │ │ ├── SubqueryProject.ts │ │ │ └── configure.module.ts │ │ ├── indexer │ │ │ ├── api.service.spec.ts │ │ │ ├── api.service.test.ts │ │ │ ├── api.service.ts │ │ │ ├── apiPromise.connection.ts │ │ │ ├── dictionary │ │ │ │ ├── index.ts │ │ │ │ ├── substrateDictionary.service.spec.ts │ │ │ │ ├── substrateDictionary.service.ts │ │ │ │ ├── types.ts │ │ │ │ ├── v1 │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── substrateDictionaryV1.spec.ts │ │ │ │ │ └── substrateDictionaryV1.ts │ │ │ │ └── v2 │ │ │ │ │ ├── index.ts │ │ │ │ │ ├── substrateDictionaryV2.ts │ │ │ │ │ └── types.ts │ │ │ ├── fetch.module.ts │ │ │ ├── indexer.manager.ts │ │ │ ├── project.service.spec.ts │ │ │ ├── runtime │ │ │ │ ├── base-runtime.service.ts │ │ │ │ ├── runtime.service.spec.ts │ │ │ │ ├── runtimeService.ts │ │ │ │ └── workerRuntimeService.ts │ │ │ ├── store.service.test.ts │ │ │ ├── types.ts │ │ │ ├── worker │ │ │ │ ├── worker-fetch.module.ts │ │ │ │ ├── worker.module.ts │ │ │ │ ├── worker.service.ts │ │ │ │ └── worker.ts │ │ │ └── x-provider │ │ │ │ ├── cachedProvider.ts │ │ │ │ ├── http.ts │ │ │ │ └── x-provider.spec.ts │ │ ├── init.ts │ │ ├── main.ts │ │ ├── subcommands │ │ │ ├── forceClean.init.ts │ │ │ ├── forceClean.module.ts │ │ │ ├── reindex.init.ts │ │ │ ├── reindex.module.spec.ts │ │ │ ├── reindex.module.ts │ │ │ ├── testing.init.ts │ │ │ ├── testing.module.spec.ts │ │ │ ├── testing.module.ts │ │ │ └── testing.service.ts │ │ ├── utils │ │ │ ├── project.ts │ │ │ ├── substrate.test.ts │ │ │ ├── substrate.ts │ │ │ └── test.utils.ts │ │ └── yargs.ts │ ├── test │ │ ├── jest-e2e.json │ │ ├── jsonfy.js │ │ └── projectFixture │ │ │ ├── bad.json │ │ │ ├── template-v1.0.0 │ │ │ ├── distMock │ │ │ │ ├── chaintypes.js │ │ │ │ └── index.js │ │ │ ├── erc20.abi.json │ │ │ ├── js │ │ │ │ ├── test1 │ │ │ │ │ ├── project.yaml │ │ │ │ │ └── types.js │ │ │ │ ├── test2 │ │ │ │ │ ├── project.yaml │ │ │ │ │ └── types.js │ │ │ │ ├── test3 │ │ │ │ │ ├── project.yaml │ │ │ │ │ └── types.js │ │ │ │ └── test4 │ │ │ │ │ ├── project.yaml │ │ │ │ │ └── types.js │ │ │ ├── package.json │ │ │ ├── project.yaml │ │ │ ├── schema.graphql │ │ │ └── types.yaml │ │ │ └── v1.0.0 │ │ │ ├── distMock │ │ │ ├── chaintypes.js │ │ │ └── index.js │ │ │ ├── erc20.abi.json │ │ │ ├── js │ │ │ ├── test1 │ │ │ │ ├── project.yaml │ │ │ │ └── types.js │ │ │ ├── test2 │ │ │ │ ├── project.yaml │ │ │ │ └── types.js │ │ │ ├── test3 │ │ │ │ ├── project.yaml │ │ │ │ └── types.js │ │ │ └── test4 │ │ │ │ ├── project.yaml │ │ │ │ └── types.js │ │ │ ├── package.json │ │ │ ├── project.yaml │ │ │ ├── schema.graphql │ │ │ └── types.yaml │ ├── tsconfig.build.json │ └── tsconfig.json ├── query │ ├── .env.example │ ├── .gitignore │ ├── CHANGELOG.md │ ├── Dockerfile │ ├── LICENSE │ ├── README.md │ ├── bin │ │ ├── run │ │ └── run.cmd │ ├── nest-cli.json │ ├── nodemon.json │ ├── package.json │ ├── src │ │ ├── app.module.ts │ │ ├── configure │ │ │ ├── config.ts │ │ │ ├── configure.module.ts │ │ │ ├── index.ts │ │ │ └── x-postgraphile │ │ │ │ └── debugClient.ts │ │ ├── graphql │ │ │ ├── __snapshots__ │ │ │ │ └── graphql.historical.test.ts.snap │ │ │ ├── graphql.historical.test.ts │ │ │ ├── graphql.module.ts │ │ │ ├── graphql.test.ts │ │ │ ├── limit.test.ts │ │ │ ├── plugins │ │ │ │ ├── GetMetadataPlugin.ts │ │ │ │ ├── PgAggregateSpecsPlugin.ts │ │ │ │ ├── PgAggregationPlugin.ts │ │ │ │ ├── PgBackwardRelationPlugin.ts │ │ │ │ ├── PgConnectionArgFirstLastBeforeAfter.ts │ │ │ │ ├── PgDistinctPlugin.ts │ │ │ │ ├── PgOrderByAggregatesPlugin.ts │ │ │ │ ├── PgOrderByUnique.ts │ │ │ │ ├── PgRowByVirtualIdPlugin.ts │ │ │ │ ├── PgSearchPlugin.ts │ │ │ │ ├── PgSubscriptionPlugin.ts │ │ │ │ ├── PlaygroundPlugin.ts │ │ │ │ ├── QueryAliasLimitPlugin.ts │ │ │ │ ├── QueryComplexityPlugin.ts │ │ │ │ ├── QueryDepthLimitPlugin.spec.ts │ │ │ │ ├── QueryDepthLimitPlugin.ts │ │ │ │ ├── historical │ │ │ │ │ ├── PgBlockHeightPlugin.ts │ │ │ │ │ ├── PgConnectionArgFilterBackwardRelationsPlugin.ts │ │ │ │ │ ├── PgConnectionArgFilterForwardRelationsPlugin.ts │ │ │ │ │ ├── index.ts │ │ │ │ │ └── utils.ts │ │ │ │ ├── index.ts │ │ │ │ └── smartTagsPlugin.ts │ │ │ └── project.service.ts │ │ ├── main.ts │ │ ├── utils │ │ │ ├── asyncInterval.ts │ │ │ └── logger.ts │ │ └── yargs.ts │ ├── tsconfig.build.json │ └── tsconfig.json ├── testing │ ├── CHANGELOG.md │ ├── LICENSE │ ├── package.json │ ├── src │ │ ├── index.ts │ │ └── interfaces.ts │ └── tsconfig.json ├── types-core │ ├── CHANGELOG.md │ ├── LICENSE │ ├── package.json │ ├── src │ │ ├── global.ts │ │ ├── index.ts │ │ ├── interfaces.ts │ │ ├── multichain │ │ │ ├── index.ts │ │ │ └── types.ts │ │ ├── project │ │ │ ├── datasourceProcessors.ts │ │ │ ├── index.ts │ │ │ ├── modulars │ │ │ │ ├── index.ts │ │ │ │ └── types.ts │ │ │ ├── readers │ │ │ │ ├── index.ts │ │ │ │ └── reader.ts │ │ │ ├── types.ts │ │ │ └── versioned │ │ │ │ ├── base.ts │ │ │ │ ├── index.ts │ │ │ │ └── v1_0_0 │ │ │ │ ├── index.ts │ │ │ │ └── types.ts │ │ └── store.ts │ └── tsconfig.json ├── types │ ├── CHANGELOG.md │ ├── LICENSE │ ├── package.json │ ├── src │ │ ├── global.ts │ │ ├── index.ts │ │ ├── interfaces.ts │ │ └── project.ts │ └── tsconfig.json └── utils │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── package.json │ ├── src │ ├── array │ │ ├── array.spec.ts │ │ ├── array.ts │ │ └── index.ts │ ├── buffer │ │ ├── buffer.spec.ts │ │ ├── buffer.ts │ │ └── index.ts │ ├── graphql │ │ ├── builder.spec.ts │ │ ├── builder.ts │ │ ├── constant.ts │ │ ├── entities.ts │ │ ├── graphql.spec.ts │ │ ├── index.ts │ │ ├── schema.ts │ │ ├── schema │ │ │ ├── directives.ts │ │ │ └── scalas.ts │ │ └── types.ts │ ├── index.ts │ ├── logger │ │ ├── colors.spec.ts │ │ ├── colors.ts │ │ ├── constants.ts │ │ ├── index.ts │ │ ├── logger.ts │ │ └── util.ts │ ├── networking.ts │ ├── query │ │ ├── index.ts │ │ ├── metadata.ts │ │ └── types.ts │ └── types │ │ ├── TypeClass.ts │ │ ├── generalTypes.spec.ts │ │ ├── generalTypes.ts │ │ ├── index.ts │ │ ├── supported │ │ ├── BigInt.ts │ │ ├── Boolean.ts │ │ ├── Bytes.ts │ │ ├── Date.ts │ │ ├── Float.ts │ │ ├── ID.ts │ │ ├── Int.ts │ │ ├── Json.ts │ │ ├── String.ts │ │ └── index.ts │ │ └── u8aUtils.ts │ └── tsconfig.json ├── report-main.json ├── scripts ├── build.sh └── update_versions.sh ├── test ├── Dockerfile ├── docker-compose.yaml ├── jest-setup.ts ├── load-extensions.sh └── pg-Dockerfile ├── tsconfig.json ├── tsconfig.test.json └── yarn.lock /.dockerignore: -------------------------------------------------------------------------------- 1 | .github 2 | node_modules 3 | coverage 4 | deploy 5 | docs 6 | test/docker-compose.yaml 7 | test/Dockerfile 8 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 2 6 | end_of_line = lf 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | 11 | [*.md] 12 | trim_trailing_whitespace = false 13 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | /build/** 2 | /api_docs/** 3 | **/node_modules/** 4 | **/test/**/* 5 | /scripts/* 6 | packages/**/dist/** 7 | packages/**/lib/** 8 | .eslintrc.js 9 | *.proto 10 | *.ts.snap 11 | -------------------------------------------------------------------------------- /.github/actions/create-prerelease/remove-stable-version.js: -------------------------------------------------------------------------------- 1 | const fs = require('fs'); 2 | const myArgs = process.argv.slice(2); 3 | const pJson = require(`${myArgs[0]}/package.json`) 4 | 5 | if (pJson.stableVersion){ 6 | delete pJson.stableVersion 7 | fs.writeFileSync(`${myArgs[0]}/package.json`, JSON.stringify(pJson, null, 2)) 8 | } 9 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # To get started with Dependabot version updates, you'll need to specify which 2 | # package ecosystems to update and where the package manifests are located. 3 | # Please see the documentation for all configuration options: 4 | # https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file 5 | 6 | version: 2 7 | updates: 8 | - package-ecosystem: "npm" # See documentation for possible values 9 | directories: # Location of package manifests 10 | - "/" 11 | - "/packages/*" 12 | schedule: 13 | interval: "weekly" 14 | - package-ecosystem: "github-actions" 15 | # Workflow files stored in the default location of `.github/workflows` 16 | # You don't need to specify `/.github/workflows` for `directory`. You can use `directory: "/"`. 17 | directory: "/" 18 | schedule: 19 | interval: "weekly" 20 | -------------------------------------------------------------------------------- /.github/workflows/discord.yml: -------------------------------------------------------------------------------- 1 | name: discord notification 2 | on: 3 | release: 4 | types: 5 | - published 6 | 7 | jobs: 8 | notify: 9 | name: Discord Notification 10 | runs-on: ubuntu-latest 11 | 12 | steps: 13 | - name: Send release details to Discord 14 | uses: rjstone/discord-webhook-notify@v1 15 | with: 16 | webhookUrl: ${{ secrets.DISCORD_RELEASE_NOTES_WEBHOOK }} 17 | color: "#6499ff" 18 | avatarUrl: https://github.githubassets.com/images/modules/logos_page/Octocat.png 19 | details: ${{ github.event.release.body }} 20 | description: "[Release] ${{ github.event.release.name }}" 21 | footer: ${{ github.event.release.html_url }} 22 | -------------------------------------------------------------------------------- /.github/workflows/scripts/benchmark/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:lts 2 | 3 | # Define build-time arguments 4 | 5 | ARG input_indexer_version 6 | ENV INDEXER_VERSION=${input_indexer_version} 7 | 8 | ENV DB_USER=postgres 9 | ENV DB_PASS=postgres 10 | ENV DB_DATABASE=postgres 11 | ENV DB_HOST=postgres 12 | ENV DB_PORT=5432 13 | 14 | # Set the working directory in the container 15 | WORKDIR /app 16 | 17 | # Install app dependencies 18 | RUN npm i @subql/node@$INDEXER_VERSION -g 19 | 20 | # Copy the rest of the app's code to the container 21 | COPY . . 22 | 23 | # Custom script to run the Node.js app and handle other tasks 24 | COPY benchmarking.sh /app/benchmarking.sh 25 | RUN chmod +x /app/benchmarking.sh 26 | 27 | # Set the entrypoint to the script 28 | ENTRYPOINT ["/bin/bash", "/app/benchmarking.sh"] 29 | -------------------------------------------------------------------------------- /.github/workflows/scripts/benchmark/benchmarking.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Get input parameters passed from the GitHub Action workflow 4 | # Testing time 5 | input_duration=$1 6 | input_deployment=$2 7 | input_endpoint=$3 8 | input_batch_size=$4 9 | input_workers=$5 10 | input_disableHistorical=$6 11 | input_others=$7 12 | 13 | # Start the Node.js app in the background and save its PID 14 | subql-node -f ipfs://$input_deployment --network-endpoint=$input_endpoint --batch-size=$input_batch_size --workers=$input_workers --disable-historical=$input_disableHistorical $input_others --ipfs='https://unauthipfs.subquery.network/ipfs/api/v0' --db-schema=app > output/benchmark/indexing.log 2>&1 & 15 | 16 | APP_PID=$! 17 | 18 | echo "Benchmarking, please wait $input_duration." 19 | # Wait for timeout 20 | sleep $input_duration 21 | 22 | # Terminate the Node.js app 23 | pkill -P $APP_PID || true 24 | -------------------------------------------------------------------------------- /.github/workflows/scripts/benchmark/cleanHistory.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | output_dir=$1 4 | 5 | if [ -d "$output_dir" ]; then 6 | echo "Removing existing directory: $output_dir" 7 | rm -rf "$output_dir" 8 | fi 9 | # Create the new directory 10 | echo "Creating new directory: ${PWD}/$output_dir" 11 | mkdir -p "$output_dir" 12 | -------------------------------------------------------------------------------- /.github/workflows/scripts/nodeVersion.sh: -------------------------------------------------------------------------------- 1 | PACKAGE_VERSION=$(cat ./packages/node/package.json \ 2 | | grep version \ 3 | | head -1 \ 4 | | awk -F: '{ print $2 }' \ 5 | | sed 's/[",]//g' \ 6 | | tr -d '[[:space:]]') 7 | 8 | 9 | echo "::set-output name=NODE_VERSION::$PACKAGE_VERSION" 10 | -------------------------------------------------------------------------------- /.github/workflows/scripts/queryVersion.sh: -------------------------------------------------------------------------------- 1 | PACKAGE_VERSION=$(cat ./packages/query/package.json \ 2 | | grep version \ 3 | | head -1 \ 4 | | awk -F: '{ print $2 }' \ 5 | | sed 's/[",]//g' \ 6 | | tr -d '[[:space:]]') 7 | 8 | 9 | echo "::set-output name=QUERY_VERSION::$PACKAGE_VERSION" 10 | -------------------------------------------------------------------------------- /.gitpod.dockerfile: -------------------------------------------------------------------------------- 1 | FROM gitpod/workspace-postgresql -------------------------------------------------------------------------------- /.gitpod.yml: -------------------------------------------------------------------------------- 1 | # This configuration file was automatically generated by Gitpod. 2 | # Please adjust to your needs (see https://www.gitpod.io/docs/config-gitpod-file) 3 | # and commit this file to your remote git repository to share the goodness with others. 4 | image: 5 | file: .gitpod.dockerfile 6 | 7 | tasks: 8 | - init: yarn install && yarn run build 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.husky/.gitignore: -------------------------------------------------------------------------------- 1 | _ 2 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | npx lint-staged 5 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | **/CHANGELOG.md 2 | **/node_modules/** 3 | **/.*/** 4 | **/coverage/** 5 | **/dist/** 6 | *.d.ts 7 | **/.DS_Store 8 | *.ejs 9 | *.tgz 10 | *.cmd 11 | *.sh 12 | generate-project*.yaml 13 | *.proto 14 | *.ts.snap 15 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "printWidth": 120, 3 | "trailingComma": "es5", 4 | "tabWidth": 2, 5 | "singleQuote": true, 6 | "bracketSpacing": false 7 | } 8 | -------------------------------------------------------------------------------- /.yarn/versions/009f3ed3.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/027a768d.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/027a768d.yml -------------------------------------------------------------------------------- /.yarn/versions/043f60d9.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/utils" 3 | -------------------------------------------------------------------------------- /.yarn/versions/0499e67a.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/04fe5109.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/0659b210.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node" 3 | -------------------------------------------------------------------------------- /.yarn/versions/06878261.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/06f061c2.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/06f061c2.yml -------------------------------------------------------------------------------- /.yarn/versions/0a6cfead.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/cli" 3 | - "@subql/common-substrate" 4 | -------------------------------------------------------------------------------- /.yarn/versions/0b41d534.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/0b41d534.yml -------------------------------------------------------------------------------- /.yarn/versions/0c630ddb.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/types-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/0c8bf25d.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node" 3 | -------------------------------------------------------------------------------- /.yarn/versions/0d3c95d9.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node" 3 | -------------------------------------------------------------------------------- /.yarn/versions/0e4241fb.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/0e4241fb.yml -------------------------------------------------------------------------------- /.yarn/versions/104b6218.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/common" 3 | - "@subql/common-substrate" 4 | - "@subql/node" 5 | - "@subql/node-core" 6 | - "@subql/query" 7 | - "@subql/testing" 8 | - "@subql/types" 9 | - "@subql/types-core" 10 | - "@subql/utils" 11 | -------------------------------------------------------------------------------- /.yarn/versions/1288810f.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/cli" 3 | - "@subql/common" 4 | - "@subql/node" 5 | - "@subql/node-core" 6 | -------------------------------------------------------------------------------- /.yarn/versions/12a92ad2.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/12c5da87.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/12f2ee2a.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/12f2ee2a.yml -------------------------------------------------------------------------------- /.yarn/versions/1419f252.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/1419f252.yml -------------------------------------------------------------------------------- /.yarn/versions/1447e381.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/14e4dc88.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node" 3 | - "@subql/node-core" 4 | - "@subql/testing" 5 | - "@subql/types-core" 6 | -------------------------------------------------------------------------------- /.yarn/versions/16f0d61b.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/cli" 3 | - "@subql/node" 4 | - "@subql/node-core" 5 | - "@subql/query" 6 | -------------------------------------------------------------------------------- /.yarn/versions/185d73c5.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/18951341.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/cli" 3 | - "@subql/common" 4 | - "@subql/node" 5 | - "@subql/node-core" 6 | -------------------------------------------------------------------------------- /.yarn/versions/1ab8a1a3.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/1ab8a1a3.yml -------------------------------------------------------------------------------- /.yarn/versions/1bbf92cf.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/common" 3 | - "@subql/query" 4 | - "@subql/utils" 5 | -------------------------------------------------------------------------------- /.yarn/versions/1be0b830.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/1be0b830.yml -------------------------------------------------------------------------------- /.yarn/versions/1c09bcf3.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/1c09bcf3.yml -------------------------------------------------------------------------------- /.yarn/versions/1d7a8221.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/types-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/1de6dc61.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/216439fa.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/216439fa.yml -------------------------------------------------------------------------------- /.yarn/versions/25310217.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/25310217.yml -------------------------------------------------------------------------------- /.yarn/versions/2584b0f2.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/2584b0f2.yml -------------------------------------------------------------------------------- /.yarn/versions/25cf0a18.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/common-substrate" 3 | - "@subql/node" 4 | - "@subql/types" 5 | -------------------------------------------------------------------------------- /.yarn/versions/26d2bede.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/28043ba8.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/28043ba8.yml -------------------------------------------------------------------------------- /.yarn/versions/2805a1cf.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/2805a1cf.yml -------------------------------------------------------------------------------- /.yarn/versions/29bf85e7.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/2b04685f.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/2b04685f.yml -------------------------------------------------------------------------------- /.yarn/versions/2c10a261.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/2cc4a2fb.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/2cc4a2fb.yml -------------------------------------------------------------------------------- /.yarn/versions/2d3b7b53.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/cli" 3 | - "@subql/common" 4 | - "@subql/node" 5 | - "@subql/node-core" 6 | -------------------------------------------------------------------------------- /.yarn/versions/2d3c26d4.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/2d3c26d4.yml -------------------------------------------------------------------------------- /.yarn/versions/2d61ee26.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/cli" 3 | - "@subql/common" 4 | - "@subql/node" 5 | - "@subql/node-core" 6 | - "@subql/query" 7 | - "@subql/testing" 8 | - "@subql/types" 9 | - "@subql/types-core" 10 | -------------------------------------------------------------------------------- /.yarn/versions/2dfadf46.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/2dfadf46.yml -------------------------------------------------------------------------------- /.yarn/versions/2eebe132.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/304647ef.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/31de9883.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/types" 3 | -------------------------------------------------------------------------------- /.yarn/versions/322d5d1f.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/322d5d1f.yml -------------------------------------------------------------------------------- /.yarn/versions/3349f1f9.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/3349f1f9.yml -------------------------------------------------------------------------------- /.yarn/versions/33e756ee.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/350b5b09.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/query" 3 | -------------------------------------------------------------------------------- /.yarn/versions/351b62d7.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/351b62d7.yml -------------------------------------------------------------------------------- /.yarn/versions/35b703be.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/query" 3 | -------------------------------------------------------------------------------- /.yarn/versions/35c43c59.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/common" 3 | -------------------------------------------------------------------------------- /.yarn/versions/35f00361.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/35f00361.yml -------------------------------------------------------------------------------- /.yarn/versions/36f01785.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/cli" 3 | - "@subql/common" 4 | - "@subql/node" 5 | - "@subql/node-core" 6 | - "@subql/query" 7 | - "@subql/utils" 8 | -------------------------------------------------------------------------------- /.yarn/versions/37b48f24.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/37b48f24.yml -------------------------------------------------------------------------------- /.yarn/versions/37e31b0c.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node" 3 | - "@subql/node-core" 4 | -------------------------------------------------------------------------------- /.yarn/versions/381d4907.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/382f2b82.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/382f2b82.yml -------------------------------------------------------------------------------- /.yarn/versions/3938a2bc.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/3938a2bc.yml -------------------------------------------------------------------------------- /.yarn/versions/3b3e24c8.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/cli" 3 | - "@subql/node" 4 | - "@subql/node-core" 5 | -------------------------------------------------------------------------------- /.yarn/versions/3d650c95.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/cli" 3 | - "@subql/common" 4 | - "@subql/common-substrate" 5 | - "@subql/node" 6 | - "@subql/node-core" 7 | - "@subql/query" 8 | - "@subql/types" 9 | -------------------------------------------------------------------------------- /.yarn/versions/3fbcf2a0.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/3fbcf2a0.yml -------------------------------------------------------------------------------- /.yarn/versions/3fc924ed.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/4078a944.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/4078a944.yml -------------------------------------------------------------------------------- /.yarn/versions/40b6bbec.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/types-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/41c9116c.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/common" 3 | - "@subql/node" 4 | - "@subql/node-core" 5 | - "@subql/types" 6 | - "@subql/utils" 7 | -------------------------------------------------------------------------------- /.yarn/versions/41e737e2.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node" 3 | -------------------------------------------------------------------------------- /.yarn/versions/4303222c.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/4303222c.yml -------------------------------------------------------------------------------- /.yarn/versions/445ef638.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/cli" 3 | - "@subql/common" 4 | - "@subql/common-substrate" 5 | - "@subql/node" 6 | -------------------------------------------------------------------------------- /.yarn/versions/457bc38f.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/457bc38f.yml -------------------------------------------------------------------------------- /.yarn/versions/46402fec.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/46402fec.yml -------------------------------------------------------------------------------- /.yarn/versions/46adba99.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/46adba99.yml -------------------------------------------------------------------------------- /.yarn/versions/46b26b5d.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/46b26b5d.yml -------------------------------------------------------------------------------- /.yarn/versions/47d21b05.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | - "@subql/types" 4 | -------------------------------------------------------------------------------- /.yarn/versions/4820d418.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node" 3 | -------------------------------------------------------------------------------- /.yarn/versions/48ba8de1.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/48ba8de1.yml -------------------------------------------------------------------------------- /.yarn/versions/499171ed.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/49d09eed.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/cli" 3 | - "@subql/node" 4 | -------------------------------------------------------------------------------- /.yarn/versions/4b76fe18.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/common-substrate" 3 | - "@subql/node-core" 4 | -------------------------------------------------------------------------------- /.yarn/versions/4b8d567b.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/4b8d567b.yml -------------------------------------------------------------------------------- /.yarn/versions/4c2f3697.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/4c39a3cb.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/4c39a3cb.yml -------------------------------------------------------------------------------- /.yarn/versions/4c67dbef.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/4c67dbef.yml -------------------------------------------------------------------------------- /.yarn/versions/4ce88dfa.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/4ce88dfa.yml -------------------------------------------------------------------------------- /.yarn/versions/4d1a19ef.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/4d1a19ef.yml -------------------------------------------------------------------------------- /.yarn/versions/4de1b78e.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/4e58ec39.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/cli" 3 | - "@subql/node-core" 4 | -------------------------------------------------------------------------------- /.yarn/versions/4eb161fe.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/common" 3 | - "@subql/node" 4 | - "@subql/node-core" 5 | - "@subql/query" 6 | - "@subql/utils" 7 | -------------------------------------------------------------------------------- /.yarn/versions/4ef5ee6c.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/utils" 3 | -------------------------------------------------------------------------------- /.yarn/versions/4ef73239.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/4ef73239.yml -------------------------------------------------------------------------------- /.yarn/versions/4feb4cb4.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/cli" 3 | - "@subql/common" 4 | - "@subql/node" 5 | - "@subql/node-core" 6 | -------------------------------------------------------------------------------- /.yarn/versions/5284b2e3.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/5284b2e3.yml -------------------------------------------------------------------------------- /.yarn/versions/5311ca5a.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/5311ca5a.yml -------------------------------------------------------------------------------- /.yarn/versions/532ac853.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/532ac853.yml -------------------------------------------------------------------------------- /.yarn/versions/53d32974.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node" 3 | -------------------------------------------------------------------------------- /.yarn/versions/53f030f6.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/utils" 3 | -------------------------------------------------------------------------------- /.yarn/versions/550fcf8e.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | - "@subql/types" 4 | - "@subql/utils" 5 | -------------------------------------------------------------------------------- /.yarn/versions/552aabf7.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/552aabf7.yml -------------------------------------------------------------------------------- /.yarn/versions/56fc2408.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/common" 3 | - "@subql/common-substrate" 4 | - "@subql/node" 5 | - "@subql/node-core" 6 | - "@subql/types-core" 7 | -------------------------------------------------------------------------------- /.yarn/versions/57a75c3c.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node" 3 | - "@subql/node-core" 4 | -------------------------------------------------------------------------------- /.yarn/versions/5ae3de1b.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/5ae3de1b.yml -------------------------------------------------------------------------------- /.yarn/versions/5c14c916.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/5c14c916.yml -------------------------------------------------------------------------------- /.yarn/versions/5dc4e96b.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/5dc4e96b.yml -------------------------------------------------------------------------------- /.yarn/versions/5f92bb54.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/610a5feb.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/610a5feb.yml -------------------------------------------------------------------------------- /.yarn/versions/61b6fc48.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | - "@subql/types-core" 4 | -------------------------------------------------------------------------------- /.yarn/versions/645f2b52.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node" 3 | - "@subql/node-core" 4 | - "@subql/query" 5 | - "@subql/types" 6 | - "@subql/utils" 7 | -------------------------------------------------------------------------------- /.yarn/versions/646d8ce7.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/646d8ce7.yml -------------------------------------------------------------------------------- /.yarn/versions/65681adf.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/65681adf.yml -------------------------------------------------------------------------------- /.yarn/versions/6590072c.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | - "@subql/utils" 4 | -------------------------------------------------------------------------------- /.yarn/versions/65da9ecd.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node" 3 | - "@subql/node-core" 4 | - "@subql/types" 5 | - "@subql/utils" 6 | -------------------------------------------------------------------------------- /.yarn/versions/686e36f7.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/cli" 3 | - "@subql/common" 4 | - "@subql/node" 5 | - "@subql/node-core" 6 | - "@subql/query" 7 | - "@subql/utils" 8 | -------------------------------------------------------------------------------- /.yarn/versions/689d69d4.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/689d69d4.yml -------------------------------------------------------------------------------- /.yarn/versions/68dba50f.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/68dba50f.yml -------------------------------------------------------------------------------- /.yarn/versions/69505fd5.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/cli" 3 | - "@subql/common" 4 | - "@subql/common-substrate" 5 | - "@subql/node" 6 | - "@subql/node-core" 7 | - "@subql/query" 8 | - "@subql/testing" 9 | - "@subql/types" 10 | - "@subql/types-core" 11 | -------------------------------------------------------------------------------- /.yarn/versions/6a2da136.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/6a2da136.yml -------------------------------------------------------------------------------- /.yarn/versions/6b90a9bc.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/cli" 3 | - "@subql/node-core" 4 | -------------------------------------------------------------------------------- /.yarn/versions/6bc3e193.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/utils" 3 | -------------------------------------------------------------------------------- /.yarn/versions/6bc752bc.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/cli" 3 | - "@subql/node-core" 4 | -------------------------------------------------------------------------------- /.yarn/versions/6ca7bbbf.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/common" 3 | - "@subql/common-substrate" 4 | - "@subql/node" 5 | - "@subql/node-core" 6 | - "@subql/types-core" 7 | -------------------------------------------------------------------------------- /.yarn/versions/6cdd41ea.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/common" 3 | - "@subql/node" 4 | - "@subql/node-core" 5 | - "@subql/query" 6 | - "@subql/types" 7 | - "@subql/utils" 8 | -------------------------------------------------------------------------------- /.yarn/versions/6f262f92.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/6f262f92.yml -------------------------------------------------------------------------------- /.yarn/versions/6f785cb6.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/6fbb21ed.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/common" 3 | - "@subql/common-substrate" 4 | - "@subql/node" 5 | - "@subql/node-core" 6 | - "@subql/utils" 7 | -------------------------------------------------------------------------------- /.yarn/versions/6fdfdb04.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/6fdfdb04.yml -------------------------------------------------------------------------------- /.yarn/versions/6ffda578.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/722926be.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/utils" 3 | -------------------------------------------------------------------------------- /.yarn/versions/7243e463.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/7243e463.yml -------------------------------------------------------------------------------- /.yarn/versions/74d627f7.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/74d627f7.yml -------------------------------------------------------------------------------- /.yarn/versions/74e58e5b.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/74e58e5b.yml -------------------------------------------------------------------------------- /.yarn/versions/75c144d8.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/cli" 3 | - "@subql/node" 4 | - "@subql/node-core" 5 | - "@subql/query" 6 | - "@subql/types" 7 | -------------------------------------------------------------------------------- /.yarn/versions/75d37c61.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/common" 3 | - "@subql/node" 4 | - "@subql/node-core" 5 | - "@subql/types" 6 | - "@subql/utils" 7 | -------------------------------------------------------------------------------- /.yarn/versions/76034c6c.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/76034c6c.yml -------------------------------------------------------------------------------- /.yarn/versions/78a188b4.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/78a188b4.yml -------------------------------------------------------------------------------- /.yarn/versions/792d5a54.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/7bd9e3d4.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/7bd9e3d4.yml -------------------------------------------------------------------------------- /.yarn/versions/7c0eab27.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/7cd00a40.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/cli" 3 | - "@subql/common-substrate" 4 | - "@subql/node" 5 | - "@subql/node-core" 6 | - "@subql/query" 7 | - "@subql/utils" 8 | -------------------------------------------------------------------------------- /.yarn/versions/7cd681fd.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/7cd681fd.yml -------------------------------------------------------------------------------- /.yarn/versions/7d2a0be3.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/7d9c7c44.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/query" 3 | -------------------------------------------------------------------------------- /.yarn/versions/7e7541ea.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/7e7541ea.yml -------------------------------------------------------------------------------- /.yarn/versions/7f040c3e.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/common" 3 | -------------------------------------------------------------------------------- /.yarn/versions/801fb397.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/cli" 3 | - "@subql/common" 4 | - "@subql/common-substrate" 5 | - "@subql/node" 6 | - "@subql/node-core" 7 | - "@subql/query" 8 | - "@subql/types" 9 | - "@subql/types-core" 10 | -------------------------------------------------------------------------------- /.yarn/versions/809ea2e4.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/809ea2e4.yml -------------------------------------------------------------------------------- /.yarn/versions/8374b398.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/839fb9d1.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/83bb6400.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/848e4e2b.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/848e4e2b.yml -------------------------------------------------------------------------------- /.yarn/versions/8492acfd.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/cli" 3 | - "@subql/common" 4 | - "@subql/common-substrate" 5 | - "@subql/node" 6 | - "@subql/node-core" 7 | -------------------------------------------------------------------------------- /.yarn/versions/84941eaf.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/cli" 3 | -------------------------------------------------------------------------------- /.yarn/versions/857e5ecd.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | - "@subql/types-core" 4 | -------------------------------------------------------------------------------- /.yarn/versions/8601d478.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/8601d478.yml -------------------------------------------------------------------------------- /.yarn/versions/863b06ea.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/863b06ea.yml -------------------------------------------------------------------------------- /.yarn/versions/86ccde0d.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/8868808f.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/8868808f.yml -------------------------------------------------------------------------------- /.yarn/versions/889ef0f3.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node" 3 | - "@subql/node-core" 4 | -------------------------------------------------------------------------------- /.yarn/versions/88fc2bd8.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/8a413ac0.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/common" 3 | - "@subql/node-core" 4 | - "@subql/types-core" 5 | -------------------------------------------------------------------------------- /.yarn/versions/8db1483b.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/cli" 3 | - "@subql/node-core" 4 | -------------------------------------------------------------------------------- /.yarn/versions/8e400644.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/9028a0bb.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/cli" 3 | - "@subql/node" 4 | -------------------------------------------------------------------------------- /.yarn/versions/91e494d1.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/common" 3 | -------------------------------------------------------------------------------- /.yarn/versions/920dae9d.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node" 3 | -------------------------------------------------------------------------------- /.yarn/versions/92e577ad.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/92ff9489.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/common" 3 | - "@subql/common-substrate" 4 | - "@subql/node" 5 | - "@subql/node-core" 6 | - "@subql/query" 7 | - "@subql/testing" 8 | - "@subql/types" 9 | - "@subql/types-core" 10 | - "@subql/utils" 11 | -------------------------------------------------------------------------------- /.yarn/versions/936dc023.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/936dc023.yml -------------------------------------------------------------------------------- /.yarn/versions/94b199e8.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/94b199e8.yml -------------------------------------------------------------------------------- /.yarn/versions/94c458c9.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/94c458c9.yml -------------------------------------------------------------------------------- /.yarn/versions/94e27173.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/94e27173.yml -------------------------------------------------------------------------------- /.yarn/versions/9697cad0.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/9697cad0.yml -------------------------------------------------------------------------------- /.yarn/versions/99cf5827.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/9a8e6f5d.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/9a8e6f5d.yml -------------------------------------------------------------------------------- /.yarn/versions/9b3e8476.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/9b3e8476.yml -------------------------------------------------------------------------------- /.yarn/versions/9eb1a879.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/cli" 3 | - "@subql/common" 4 | - "@subql/common-substrate" 5 | - "@subql/node" 6 | - "@subql/node-core" 7 | - "@subql/utils" 8 | -------------------------------------------------------------------------------- /.yarn/versions/9f00000f.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/9f00000f.yml -------------------------------------------------------------------------------- /.yarn/versions/9f0e3f63.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/9f0e3f63.yml -------------------------------------------------------------------------------- /.yarn/versions/a2c2414d.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/a2c2414d.yml -------------------------------------------------------------------------------- /.yarn/versions/a32f012b.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/a32f012b.yml -------------------------------------------------------------------------------- /.yarn/versions/a45f2358.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/a45f2358.yml -------------------------------------------------------------------------------- /.yarn/versions/a48f5a85.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/common" 3 | - "@subql/common-substrate" 4 | - "@subql/node" 5 | - "@subql/node-core" 6 | - "@subql/query" 7 | - "@subql/types" 8 | - "@subql/types-core" 9 | - "@subql/utils" 10 | -------------------------------------------------------------------------------- /.yarn/versions/a5397fcf.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/a5397fcf.yml -------------------------------------------------------------------------------- /.yarn/versions/a5707e08.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/utils" 3 | -------------------------------------------------------------------------------- /.yarn/versions/a731a8ae.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/a9d498ca.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/common" 3 | - "@subql/common-substrate" 4 | - "@subql/node" 5 | - "@subql/node-core" 6 | - "@subql/query" 7 | - "@subql/testing" 8 | - "@subql/types" 9 | - "@subql/types-core" 10 | - "@subql/utils" 11 | -------------------------------------------------------------------------------- /.yarn/versions/abc53221.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/abc53221.yml -------------------------------------------------------------------------------- /.yarn/versions/ac20c55f.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/ac20c55f.yml -------------------------------------------------------------------------------- /.yarn/versions/ad1e1894.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/aed25208.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/aed25208.yml -------------------------------------------------------------------------------- /.yarn/versions/aee1ecce.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/cli" 3 | - "@subql/node" 4 | - "@subql/node-core" 5 | -------------------------------------------------------------------------------- /.yarn/versions/aff12ab8.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/cli" 3 | - "@subql/common" 4 | - "@subql/common-substrate" 5 | - "@subql/node" 6 | - "@subql/node-core" 7 | - "@subql/query" 8 | - "@subql/testing" 9 | - "@subql/types" 10 | - "@subql/types-core" 11 | -------------------------------------------------------------------------------- /.yarn/versions/aff73acf.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/aff73acf.yml -------------------------------------------------------------------------------- /.yarn/versions/b027b217.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/b027b217.yml -------------------------------------------------------------------------------- /.yarn/versions/b03d4318.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node" 3 | - "@subql/node-core" 4 | - "@subql/types" 5 | - "@subql/types-core" 6 | -------------------------------------------------------------------------------- /.yarn/versions/b0fa9de1.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/b0fa9de1.yml -------------------------------------------------------------------------------- /.yarn/versions/b2e2403b.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/b426a40b.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/common" 3 | - "@subql/node-core" 4 | - "@subql/types" 5 | - "@subql/types-core" 6 | -------------------------------------------------------------------------------- /.yarn/versions/b4e981f5.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/common" 3 | - "@subql/testing" 4 | -------------------------------------------------------------------------------- /.yarn/versions/b5edf689.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/b774fd26.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/b7f761b8.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/b7f761b8.yml -------------------------------------------------------------------------------- /.yarn/versions/b9a59bb0.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/b9a59bb0.yml -------------------------------------------------------------------------------- /.yarn/versions/b9fbde3d.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/ba107355.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/ba107355.yml -------------------------------------------------------------------------------- /.yarn/versions/ba8ed0a5.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/ba8ed0a5.yml -------------------------------------------------------------------------------- /.yarn/versions/bad2bdac.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node" 3 | -------------------------------------------------------------------------------- /.yarn/versions/bc5d92ce.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node" 3 | - "@subql/node-core" 4 | -------------------------------------------------------------------------------- /.yarn/versions/bd58ec77.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/bf0c3052.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/cli" 3 | - "@subql/node" 4 | - "@subql/query" 5 | -------------------------------------------------------------------------------- /.yarn/versions/c03d8f8e.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node" 3 | - "@subql/node-core" 4 | -------------------------------------------------------------------------------- /.yarn/versions/c0558c15.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/common" 3 | - "@subql/common-substrate" 4 | - "@subql/node" 5 | - "@subql/node-core" 6 | - "@subql/query" 7 | - "@subql/testing" 8 | - "@subql/types" 9 | - "@subql/types-core" 10 | - "@subql/utils" 11 | -------------------------------------------------------------------------------- /.yarn/versions/c0f27d9b.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/c285fbd3.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/c285fbd3.yml -------------------------------------------------------------------------------- /.yarn/versions/c31e963e.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/c31e963e.yml -------------------------------------------------------------------------------- /.yarn/versions/c4866a61.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/c53f3d2c.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/c53f3d2c.yml -------------------------------------------------------------------------------- /.yarn/versions/c92ce9ed.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/ca56439e.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/cb885b36.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node" 3 | -------------------------------------------------------------------------------- /.yarn/versions/cd1b2f42.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/cd1b2f42.yml -------------------------------------------------------------------------------- /.yarn/versions/d11aeeaf.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/d2b1da3c.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/cli" 3 | - "@subql/node" 4 | - "@subql/node-core" 5 | -------------------------------------------------------------------------------- /.yarn/versions/d2d9e21c.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/d2d9e21c.yml -------------------------------------------------------------------------------- /.yarn/versions/d408027a.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/d408027a.yml -------------------------------------------------------------------------------- /.yarn/versions/d52444a9.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/d52444a9.yml -------------------------------------------------------------------------------- /.yarn/versions/d5ba03dd.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | - "@subql/types" 4 | -------------------------------------------------------------------------------- /.yarn/versions/d6f4a8f0.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/d80bd429.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/common" 3 | - "@subql/node-core" 4 | - "@subql/types" 5 | -------------------------------------------------------------------------------- /.yarn/versions/d8be227b.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/d8be227b.yml -------------------------------------------------------------------------------- /.yarn/versions/d9e0b292.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/da057245.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/da057245.yml -------------------------------------------------------------------------------- /.yarn/versions/db4f7e5e.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/db4f7e5e.yml -------------------------------------------------------------------------------- /.yarn/versions/dbb42c9d.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/dbefade5.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/dbefade5.yml -------------------------------------------------------------------------------- /.yarn/versions/dc0e431b.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/dc0e431b.yml -------------------------------------------------------------------------------- /.yarn/versions/dc12d9bd.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/cli" 3 | - "@subql/common" 4 | - "@subql/node" 5 | - "@subql/node-core" 6 | - "@subql/query" 7 | - "@subql/types" 8 | -------------------------------------------------------------------------------- /.yarn/versions/e0c9f4f0.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/e0c9f4f0.yml -------------------------------------------------------------------------------- /.yarn/versions/e2a9b214.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/e4f4b87b.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node" 3 | - "@subql/node-core" 4 | - "@subql/types" 5 | -------------------------------------------------------------------------------- /.yarn/versions/e5f68ec8.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/e5f68ec8.yml -------------------------------------------------------------------------------- /.yarn/versions/e67c5647.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/e6985a5f.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/utils" 3 | -------------------------------------------------------------------------------- /.yarn/versions/e6aa2497.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node" 3 | - "@subql/node-core" 4 | -------------------------------------------------------------------------------- /.yarn/versions/e74a08eb.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/e74a08eb.yml -------------------------------------------------------------------------------- /.yarn/versions/e7d60c2f.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/e7d60c2f.yml -------------------------------------------------------------------------------- /.yarn/versions/e8cc0f85.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/e8cc0f85.yml -------------------------------------------------------------------------------- /.yarn/versions/eb626a6c.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/eb626a6c.yml -------------------------------------------------------------------------------- /.yarn/versions/ebb85f62.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/ebb85f62.yml -------------------------------------------------------------------------------- /.yarn/versions/ec268f6d.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/ec268f6d.yml -------------------------------------------------------------------------------- /.yarn/versions/ecf335ea.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | -------------------------------------------------------------------------------- /.yarn/versions/ee2043f1.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/ee2043f1.yml -------------------------------------------------------------------------------- /.yarn/versions/ee841b6d.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node-core" 3 | - "@subql/query" 4 | - "@subql/utils" 5 | -------------------------------------------------------------------------------- /.yarn/versions/eee92eb3.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/common" 3 | -------------------------------------------------------------------------------- /.yarn/versions/ef1533bb.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/common-substrate" 3 | -------------------------------------------------------------------------------- /.yarn/versions/ef86740e.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/ef86740e.yml -------------------------------------------------------------------------------- /.yarn/versions/f2404812.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/f2404812.yml -------------------------------------------------------------------------------- /.yarn/versions/f4be8046.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/query" 3 | -------------------------------------------------------------------------------- /.yarn/versions/f5fd9c46.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/utils" 3 | -------------------------------------------------------------------------------- /.yarn/versions/f6c96839.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/common" 3 | - "@subql/common-substrate" 4 | - "@subql/node" 5 | - "@subql/node-core" 6 | -------------------------------------------------------------------------------- /.yarn/versions/f94438ba.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node" 3 | -------------------------------------------------------------------------------- /.yarn/versions/fbe61a9b.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/types" 3 | - "@subql/types-core" 4 | -------------------------------------------------------------------------------- /.yarn/versions/fc193ed1.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/cli" 3 | - "@subql/common" 4 | - "@subql/node-core" 5 | -------------------------------------------------------------------------------- /.yarn/versions/fc8527ab.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/common" 3 | -------------------------------------------------------------------------------- /.yarn/versions/fd047138.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/common-substrate" 3 | - "@subql/node-core" 4 | - "@subql/types-core" 5 | -------------------------------------------------------------------------------- /.yarn/versions/fd2e440b.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/node" 3 | -------------------------------------------------------------------------------- /.yarn/versions/fee55ccb.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/fee55ccb.yml -------------------------------------------------------------------------------- /.yarn/versions/ff271075.yml: -------------------------------------------------------------------------------- 1 | undecided: 2 | - "@subql/common" 3 | - "@subql/node-core" 4 | -------------------------------------------------------------------------------- /.yarn/versions/ff80eab6.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/.yarn/versions/ff80eab6.yml -------------------------------------------------------------------------------- /.yarnrc.yml: -------------------------------------------------------------------------------- 1 | changesetBaseRefs: 2 | - main 3 | - origin/main 4 | 5 | enableImmutableInstalls: false 6 | 7 | enableProgressBars: false 8 | 9 | nodeLinker: node-modules 10 | 11 | npmAuthToken: "${NPM_TOKEN:-}" 12 | 13 | npmPublishRegistry: "https://registry.npmjs.org" 14 | 15 | plugins: 16 | - path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs 17 | spec: "@yarnpkg/plugin-interactive-tools" 18 | - path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs 19 | spec: "@yarnpkg/plugin-workspace-tools" 20 | - path: .yarn/plugins/@yarnpkg/plugin-typescript.cjs 21 | spec: "@yarnpkg/plugin-typescript" 22 | - path: .yarn/plugins/@yarnpkg/plugin-version.cjs 23 | spec: "@yarnpkg/plugin-version" 24 | 25 | yarnPath: .yarn/releases/yarn-3.2.4.cjs 26 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | [Please see our policy here](https://academy.subquery.network/miscellaneous/vulnerability-reporting.html) 4 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = {presets: ['@babel/preset-env']} 2 | -------------------------------------------------------------------------------- /deploy/logging_debug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/deploy/logging_debug.png -------------------------------------------------------------------------------- /packages/cli/bin/run: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | const pjson = require('../package.json'); 4 | const updateNotifier = require('update-notifier'); 5 | const chalk = require('chalk'); 6 | const semver = require('semver'); 7 | 8 | const notifier = updateNotifier({ pkg: pjson, updateCheckInterval: 0 }); 9 | 10 | if (notifier.update) { 11 | const { current, latest, name } = notifier.update; 12 | 13 | if (semver.lt(current, latest)) { 14 | const message = ` 15 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 16 | Update available ${chalk.dim(current)} → ${chalk.green(latest)} 17 | Run ${chalk.cyan(`npm i -g ${name}`)} to update 18 | ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 19 | `; 20 | console.log(message); 21 | } 22 | } 23 | 24 | const oclif = require('@oclif/core'); 25 | oclif.run().then(oclif.flush).catch(oclif.Errors.handle); -------------------------------------------------------------------------------- /packages/cli/bin/run.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | node "%~dp0\run" %* 4 | -------------------------------------------------------------------------------- /packages/cli/src/controller/migrate/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './migrate-controller'; 5 | export * from './manifest/migrate-manifest.controller'; 6 | export * from './abis/migrate-abis.controller'; 7 | export * from './schema/migrate-schema.controller'; 8 | export * from './constants'; 9 | -------------------------------------------------------------------------------- /packages/cli/src/controller/migrate/mapping/migrate-mapping.controller.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import fs from 'fs'; 5 | import path from 'path'; 6 | import {copyFolderSync} from '../../../utils'; 7 | 8 | export async function migrateMapping(subgraphDir: string, subqlDir: string): Promise { 9 | const subqlSrcPath = path.join(subqlDir, '/src'); 10 | await fs.promises.rm(subqlSrcPath, {force: true, recursive: true}); 11 | // copy over src 12 | copyFolderSync(path.join(subgraphDir, '/src'), subqlSrcPath); 13 | console.log( 14 | `* Mapping handlers have been copied over, they will need to be updated to work with SubQuery. See our documentation for more details https://academy.subquery.network/build/graph-migration.html#codegen` 15 | ); 16 | } 17 | -------------------------------------------------------------------------------- /packages/cli/src/controller/validate.spec.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import {NETWORK_FAMILY} from '@subql/common'; 5 | import {isValidEnum} from '../utils'; 6 | 7 | describe('Tests for validate, CLI', () => { 8 | it('ensure EnumValidator', () => { 9 | expect(isValidEnum(NETWORK_FAMILY, 'Cosmos')).toBe(true); 10 | expect(isValidEnum(NETWORK_FAMILY, 'bad')).toBe(false); 11 | }); 12 | }); 13 | -------------------------------------------------------------------------------- /packages/cli/src/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export {run} from '@oclif/core'; 5 | -------------------------------------------------------------------------------- /packages/cli/src/jsonrpc/client/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './http'; 5 | export * from './ws'; 6 | -------------------------------------------------------------------------------- /packages/cli/src/jsonrpc/client/types.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export interface Message { 5 | jsonrpc: '2.0'; 6 | method: string; 7 | params?: T; 8 | } 9 | 10 | export interface Request extends Message { 11 | id: string | number; 12 | } 13 | 14 | export type Notification = Message; 15 | 16 | export interface ResponseSuccess { 17 | id: string | number | null; 18 | result: T; 19 | } 20 | 21 | export type ResponseSuccessType = string | number | boolean | object | null; 22 | 23 | export interface ResponseError { 24 | id: string | number | null; 25 | error: { 26 | code: number; 27 | message: string; 28 | data?: any; 29 | }; 30 | } 31 | 32 | export type Response = ResponseSuccess | ResponseError; 33 | -------------------------------------------------------------------------------- /packages/cli/src/jsonrpc/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import {HttpJsonRpcClient, WsJsonRpcClient} from './client'; 5 | 6 | export async function getGenesisHash(endpoint: string): Promise { 7 | const client = endpoint.startsWith('ws') ? new WsJsonRpcClient(endpoint) : new HttpJsonRpcClient(endpoint); 8 | const genesisBlock = await client.send('chain_getBlockHash', [0]); 9 | (client as WsJsonRpcClient).destroy?.(); 10 | return genesisBlock; 11 | } 12 | -------------------------------------------------------------------------------- /packages/cli/src/jsonrpc/jsonrpc.test.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import {getGenesisHash} from './index'; 5 | 6 | const WS_ENDPOINT = 'wss://polkadot.api.onfinality.io/public-ws'; 7 | const HTTP_ENDPOINT = 'https://polkadot.api.onfinality.io/public'; 8 | 9 | const GENESIS_HASH = '0x91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3'; 10 | 11 | describe('test jsonrpc client', () => { 12 | it("Query polkadot's genesisHash via ws endpoint", async () => { 13 | const genesisHash = await getGenesisHash(WS_ENDPOINT); 14 | expect(genesisHash).toEqual(GENESIS_HASH); 15 | }, 10000); 16 | 17 | it("Query polkadot's genesisHash via http endpoint", async () => { 18 | const genesisHash = await getGenesisHash(HTTP_ENDPOINT); 19 | expect(genesisHash).toEqual(GENESIS_HASH); 20 | }); 21 | }); 22 | -------------------------------------------------------------------------------- /packages/cli/src/modulars/config.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import {NETWORK_FAMILY, runnerMapping} from '@subql/common'; 5 | 6 | export const networkPackages = Object.entries(runnerMapping).reduce( 7 | (acc, [runner, family]) => { 8 | // Special case because substrate has 2 runners 9 | if (runner === '@subql/node' && family === NETWORK_FAMILY.substrate) { 10 | acc[family] = '@subql/common-substrate'; 11 | return acc; 12 | } 13 | acc[family] = runner.replace('@subql/node-', '@subql/common-'); 14 | return acc; 15 | }, 16 | {} as Record 17 | ); 18 | -------------------------------------------------------------------------------- /packages/cli/src/modulars/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './types'; 5 | export * from './config'; 6 | export * from './moduleLoader'; 7 | -------------------------------------------------------------------------------- /packages/cli/src/modulars/types.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import {NETWORK_FAMILY} from '@subql/common'; 5 | import type {INetworkCommonModule} from '@subql/types-core'; 6 | import type {CosmosNetworkModule} from '@subql/types-cosmos'; 7 | import type {EthereumNetworkModule} from '@subql/types-ethereum'; 8 | import type {SolanaNetworkModule} from '@subql/types-solana'; 9 | 10 | export type ModuleCache = { 11 | [K in Exclude< 12 | NETWORK_FAMILY, 13 | NETWORK_FAMILY.cosmos | NETWORK_FAMILY.ethereum | NETWORK_FAMILY.solana 14 | >]: INetworkCommonModule; 15 | } & { 16 | [NETWORK_FAMILY.cosmos]: CosmosNetworkModule; 17 | [NETWORK_FAMILY.ethereum]: EthereumNetworkModule; 18 | [NETWORK_FAMILY.solana]: SolanaNetworkModule; 19 | }; 20 | -------------------------------------------------------------------------------- /packages/cli/src/modulars/utils.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import {NETWORK_FAMILY, runnerMapping} from '@subql/common'; 5 | -------------------------------------------------------------------------------- /packages/cli/src/template/datasource-templates.ts.ejs: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | 3 | // Auto-generated , DO NOT EDIT 4 | <% props.forEach(function(e){ %> 5 | export function create<%= e.name %>Datasource(<% if (e.args) { %>args: <%- e.args %><% } %>): Promise { 6 | return createDynamicDatasource('<%= e.name %>'<% if (e.args) { %>, args<% } %>); 7 | } 8 | <% }); %> 9 | -------------------------------------------------------------------------------- /packages/cli/src/template/enum.ts.ejs: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | 3 | // Auto-generated , DO NOT EDIT 4 | <% props.enums.forEach(function(e){ %> 5 | export enum <%= e.name %> { 6 | <% e.values.forEach(function(value){ %> 7 | <%= value %> = "<%= value %>", 8 | <% }); %> 9 | } 10 | 11 | <% }); %> 12 | -------------------------------------------------------------------------------- /packages/cli/src/template/interface.ts.ejs: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | 3 | // Auto-generated , DO NOT EDIT 4 | <% props.jsonInterfaces.forEach(function(interface){ %> 5 | export interface <%= helper.upperFirst(interface.interfaceName) %> { 6 | <% interface.fields.forEach(function(field){ %> 7 | <%= field.name %><%= field.required ? "" : "?" %>: <%= field.type %><%= field.isArray ? "[]" : "" %>; 8 | <% }); %> 9 | } 10 | 11 | <% }); %> 12 | -------------------------------------------------------------------------------- /packages/cli/src/template/models-index.ts.ejs: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | 3 | // Auto-generated , DO NOT EDIT 4 | <% props.classNames.forEach(function(className){ %> 5 | export {<%= helper.upperFirst(className) %>} from "./<%= className %>" 6 | <% }); %> 7 | -------------------------------------------------------------------------------- /packages/cli/src/template/scaffold-handlers.ts.ejs: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | 3 | // Auto-generated 4 | <% props.abis.forEach(function (abi) { %> 5 | import {<% abi.handlers.forEach(function (handler) { %><%= handler.argType %>,<% })%>} from "../types/abi-interfaces/<%= abi.name %>"; 6 | <% })%> 7 | <% props.abis.forEach(function (abi) { %><% abi.handlers.forEach(function (handler) { %> 8 | export async function <%=handler.name %>(<%=handler.argName%>: <%=handler.argType %> ): Promise { 9 | // Place your code logic here 10 | } 11 | <% })%><% })%> -------------------------------------------------------------------------------- /packages/cli/src/template/types-index.ts.ejs: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: Apache-2.0 2 | 3 | // Auto-generated , DO NOT EDIT 4 | <%if (props.exportTypes.models){%>export * from "./models"; <% } %> 5 | <%if (props.exportTypes.interfaces){%>export * from "./interfaces";<% } %> 6 | <%if (props.exportTypes.enums){%>export * from "./enums";<% } %> 7 | <%if (props.exportTypes.datasources){%>export * from "./datasources";<% } %> 8 | -------------------------------------------------------------------------------- /packages/cli/src/utils/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './build'; 5 | export * from './utils'; 6 | export * from './networkFamily'; 7 | -------------------------------------------------------------------------------- /packages/cli/src/utils/networkFamily.spec.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import {NETWORK_FAMILY} from '@subql/common'; 5 | import {getNetworkFamily} from './networkFamily'; 6 | 7 | describe('Get network family', () => { 8 | it('convert input to right network family', () => { 9 | expect(getNetworkFamily('ethereum')).toBe(NETWORK_FAMILY.ethereum); 10 | expect(getNetworkFamily('Ethereum')).toBe(NETWORK_FAMILY.ethereum); 11 | expect(() => getNetworkFamily('fakeNetwork')).toThrow(`Network not found or unsupported network fakeNetwork`); 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /packages/cli/test/abiTest1/project.yaml: -------------------------------------------------------------------------------- 1 | specVersion: '1.0.0' 2 | name: 'example' 3 | 4 | version: '0.0.1' 5 | runner: 6 | node: 7 | name: '@subql/node-ethereum' 8 | version: '*' 9 | query: 10 | name: '@subql/query' 11 | version: '*' 12 | description: '' 13 | repository: '' 14 | schema: 15 | file: './schema.graphql' 16 | network: 17 | chainId: '1' 18 | endpoint: 'aaa' 19 | dictionary: '' 20 | 21 | customDs: 22 | assets: 23 | abis: 24 | file: ./abis.json 25 | artifact: 26 | file: ./abis/artifact.sol/artifact.json 27 | dataSources: 28 | - kind: ethereum/Runtime 29 | startBlock: 1 30 | mapping: 31 | file: '' 32 | handlers: 33 | - handler: handleTransaction 34 | kind: ethereum/BlockHandler 35 | -------------------------------------------------------------------------------- /packages/cli/test/abiTest2/project.yaml: -------------------------------------------------------------------------------- 1 | specVersion: '1.0.0' 2 | name: 'example' 3 | 4 | schema: 5 | file: './schema.graphql' 6 | 7 | customDs: 8 | assets: 9 | artifact: 10 | file: ./artifact.json 11 | dataSources: 12 | - kind: ethereum/Runtime 13 | startBlock: 1 14 | mapping: 15 | handlers: 16 | - handler: handleTransaction 17 | kind: ethereum/BlockHandler 18 | -------------------------------------------------------------------------------- /packages/cli/test/build/src/chainTypes.ts: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/packages/cli/test/build/src/chainTypes.ts -------------------------------------------------------------------------------- /packages/cli/test/build/src/index.ts: -------------------------------------------------------------------------------- 1 | //Exports all handler functions 2 | // export * from "./mappings/mappingHandlers"; 3 | import '@polkadot/api-augment'; 4 | -------------------------------------------------------------------------------- /packages/cli/test/build/src/test/mappingHandler.test.ts: -------------------------------------------------------------------------------- 1 | import {subqlTest} from '@subql/testing'; 2 | 3 | // See https://academy.subquery.network/build/testing.html 4 | 5 | subqlTest( 6 | 'handleTransfer test', // Test name 7 | 191, // Block height to test at 8 | [], // Dependent entities 9 | [], // Expected entities 10 | 'handleEvent' // handler name 11 | ); 12 | -------------------------------------------------------------------------------- /packages/cli/test/build/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "emitDecoratorMetadata": true, 4 | "experimentalDecorators": true, 5 | "esModuleInterop": true, 6 | "declaration": true, 7 | "importHelpers": true, 8 | "resolveJsonModule": true, 9 | "module": "commonjs", 10 | "outDir": "dist", 11 | "rootDir": "src", 12 | "target": "es2017", 13 | "strict": true 14 | }, 15 | "include": [ 16 | "src/**/*", 17 | "node_modules/@subql/types-core/dist/global.d.ts", 18 | "node_modules/@subql/types/dist/global.d.ts" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /packages/cli/test/jsoncConfig/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "emitDecoratorMetadata": true, 4 | "experimentalDecorators": true, 5 | "esModuleInterop": true, 6 | "declaration": true, 7 | "importHelpers": true, 8 | "resolveJsonModule": true, 9 | "module": "commonjs", 10 | "outDir": "dist", 11 | "rootDir": "src", 12 | "target": "es2017", 13 | "strict": true 14 | }, 15 | "include": [ 16 | "src/**/*" 17 | // "node_modules/@subql/types-core/dist/global.d.ts", 18 | // "node_modules/@subql/types/dist/global.d.ts", 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /packages/cli/test/schemaTest/badEntity.graphql: -------------------------------------------------------------------------------- 1 | type exampleEntity @entity { 2 | id: ID! 3 | filter: exampleEntityFilter 4 | filters: exampleEntityFilters 5 | } 6 | 7 | type exampleEntityFilter @entity { 8 | id: ID! 9 | minSore: Int 10 | } 11 | 12 | type exampleEntityFilters @entity { 13 | id: ID! 14 | maxSore: Int 15 | } 16 | -------------------------------------------------------------------------------- /packages/cli/test/schemaTest/badschema.graphql: -------------------------------------------------------------------------------- 1 | type badEntity @entity { 2 | id: ID! 3 | value: BigDecimal 4 | } 5 | -------------------------------------------------------------------------------- /packages/cli/test/schemaTest/camelcaseEntityName.graphql: -------------------------------------------------------------------------------- 1 | type exampleField @entity { 2 | id: ID! 3 | } 4 | -------------------------------------------------------------------------------- /packages/cli/test/schemaTest/dbTypeSchema.graphql: -------------------------------------------------------------------------------- 1 | type BlockMeta @entity { 2 | id: ID! @dbType(type: "BigInt") 3 | 4 | height: Int! 5 | } 6 | 7 | type Block @entity { 8 | id: ID! 9 | 10 | meta: BlockMeta! 11 | } 12 | -------------------------------------------------------------------------------- /packages/cli/test/schemaTest/duplicateEnum.graphql: -------------------------------------------------------------------------------- 1 | enum Bar { 2 | FOO 3 | BAR 4 | } 5 | 6 | type Foo @entity { 7 | id: ID! 8 | a: Bar! 9 | b: Bar! 10 | } 11 | -------------------------------------------------------------------------------- /packages/cli/test/schemaTest/non-evm-project.yaml: -------------------------------------------------------------------------------- 1 | specVersion: '1.0.0' 2 | name: 'example' 3 | 4 | schema: 5 | file: './schema.graphql' 6 | runner: 7 | node: 8 | name: '@subql/node' 9 | version: '>=3.0.1' 10 | query: 11 | name: '@subql/query' 12 | version: '*' 13 | customDs: 14 | kind: substrate/Wasm 15 | assets: 16 | erc721: 17 | file: ./abis/erc721.json 18 | -------------------------------------------------------------------------------- /packages/cli/test/schemaTest/project-bad-entity.yaml: -------------------------------------------------------------------------------- 1 | specVersion: '1.0.0' 2 | description: '' 3 | repository: 'https://github.com/subquery/subql-starter' 4 | schema: 5 | file: './badEntity.graphql' 6 | runner: 7 | node: 8 | name: '@subql/node' 9 | version: '>=3.0.1' 10 | query: 11 | name: '@subql/query' 12 | version: '*' 13 | network: 14 | endpoint: 'wss://polkadot.api.onfinality.io/public-ws' 15 | 16 | dataSources: 17 | - name: main 18 | kind: substrate/Runtime 19 | startBlock: 1 20 | mapping: 21 | handlers: 22 | - handler: handleBlock 23 | kind: substrate/BlockHandler 24 | -------------------------------------------------------------------------------- /packages/cli/test/schemaTest/project-bad-schema.yaml: -------------------------------------------------------------------------------- 1 | specVersion: '1.0.0' 2 | description: '' 3 | repository: 'https://github.com/subquery/subql-starter' 4 | schema: 5 | file: './badschema.graphql' 6 | runner: 7 | node: 8 | name: '@subql/node' 9 | version: '>=3.0.1' 10 | query: 11 | name: '@subql/query' 12 | version: '*' 13 | network: 14 | endpoint: 'wss://polkadot.api.onfinality.io/public-ws' 15 | 16 | dataSources: 17 | - name: main 18 | kind: substrate/Runtime 19 | startBlock: 1 20 | mapping: 21 | handlers: 22 | - handler: handleBlock 23 | kind: substrate/BlockHandler 24 | -------------------------------------------------------------------------------- /packages/cli/test/schemaTest/project-case-sensitive-import-entity.yaml: -------------------------------------------------------------------------------- 1 | specVersion: '1.0.0' 2 | description: '' 3 | repository: 'https://github.com/subquery/subql-starter' 4 | schema: 5 | file: './camelcaseEntityName.graphql' 6 | runner: 7 | node: 8 | name: '@subql/node' 9 | version: '>=3.0.1' 10 | query: 11 | name: '@subql/query' 12 | version: '*' 13 | network: 14 | endpoint: 'wss://polkadot.api.onfinality.io/public-ws' 15 | 16 | dataSources: 17 | - name: main 18 | kind: substrate/Runtime 19 | startBlock: 1 20 | mapping: 21 | handlers: 22 | - handler: handleBlock 23 | kind: substrate/BlockHandler 24 | -------------------------------------------------------------------------------- /packages/cli/test/schemaTest/project-duplicate-enum.yaml: -------------------------------------------------------------------------------- 1 | specVersion: '1.0.0' 2 | description: '' 3 | repository: 'https://github.com/subquery/subql-starter' 4 | schema: 5 | file: './duplicateEnum.graphql' 6 | runner: 7 | node: 8 | name: '@subql/node' 9 | version: '>=3.0.1' 10 | query: 11 | name: '@subql/query' 12 | version: '*' 13 | network: 14 | endpoint: 'wss://polkadot.api.onfinality.io/public-ws' 15 | 16 | dataSources: 17 | - name: main 18 | kind: substrate/Runtime 19 | startBlock: 1 20 | mapping: 21 | handlers: 22 | - handler: handleBlock 23 | kind: substrate/BlockHandler 24 | -------------------------------------------------------------------------------- /packages/cli/test/schemaTest/project-id-type.yaml: -------------------------------------------------------------------------------- 1 | specVersion: '1.0.0' 2 | name: 'example' 3 | 4 | schema: 5 | file: './dbTypeSchema.graphql' 6 | runner: 7 | node: 8 | name: '@subql/node' 9 | version: '>=3.0.1' 10 | query: 11 | name: '@subql/query' 12 | version: '*' 13 | customDs: 14 | kind: substrate/FrontierEvm 15 | assets: 16 | erc721: 17 | file: ./abis/erc721.json 18 | dataSources: 19 | - kind: ethereum/Runtime 20 | startBlock: 1 21 | mapping: 22 | handlers: 23 | - handler: handleTransaction 24 | kind: ethereum/BlockHandler 25 | -------------------------------------------------------------------------------- /packages/cli/test/schemaTest/project-no-abi.yaml: -------------------------------------------------------------------------------- 1 | specVersion: '1.0.0' 2 | name: 'example' 3 | 4 | schema: 5 | file: './schema.graphql' 6 | runner: 7 | node: 8 | name: '@subql/node-ethereum' 9 | version: '>=3.0.1' 10 | query: 11 | name: '@subql/query' 12 | version: '*' 13 | dataSources: 14 | - kind: ethereum/Runtime 15 | startBlock: 1 16 | mapping: 17 | handlers: 18 | - handler: handleTransaction 19 | kind: ethereum/BlockHandler 20 | -------------------------------------------------------------------------------- /packages/cli/test/schemaTest/project-no-assets.yaml: -------------------------------------------------------------------------------- 1 | specVersion: '1.0.0' 2 | name: 'example' 3 | runner: 4 | node: 5 | name: '@subql/node-ethereum' 6 | version: '>=3.0.1' 7 | query: 8 | name: '@subql/query' 9 | version: '*' 10 | schema: 11 | file: './schema.graphql' 12 | 13 | goodDs: 14 | 15 | dataSources: 16 | - kind: ethereum/Runtime 17 | startBlock: 1 18 | mapping: 19 | handlers: 20 | - handler: handleTransaction 21 | kind: ethereum/BlockHandler 22 | templates: 23 | - name: ERC721 24 | kind: ethereum/Runtime 25 | mapping: 26 | handlers: 27 | - handler: handleERC721 28 | kind: ethereum/LogHandler 29 | filter: 30 | topics: 31 | - Transfer(address, address, uint256) 32 | -------------------------------------------------------------------------------- /packages/cli/test/schemaTest/project-templates-abi.yaml: -------------------------------------------------------------------------------- 1 | specVersion: '1.0.0' 2 | name: 'example' 3 | 4 | schema: 5 | file: './schema.graphql' 6 | runner: 7 | node: 8 | name: '@subql/node-ethereum' 9 | version: '>=3.0.1' 10 | query: 11 | name: '@subql/query' 12 | version: '*' 13 | dataSources: 14 | - kind: ethereum/Runtime 15 | startBlock: 1 16 | mapping: 17 | handlers: 18 | - handler: handleTransaction 19 | kind: ethereum/BlockHandler 20 | templates: 21 | - name: ERC721 22 | kind: ethereum/Runtime 23 | options: 24 | abi: erc721 25 | assets: 26 | erc721: 27 | file: './abis/erc721.json' 28 | mapping: 29 | handlers: 30 | - handler: handleERC721 31 | kind: ethereum/LogHandler 32 | filter: 33 | topics: 34 | - Transfer(address, address, uint256) 35 | -------------------------------------------------------------------------------- /packages/cli/test/schemaTest/project.yaml: -------------------------------------------------------------------------------- 1 | specVersion: '1.0.0' 2 | name: 'example' 3 | 4 | schema: 5 | file: './schema.graphql' 6 | runner: 7 | node: 8 | name: '@subql/node-ethereum' 9 | version: '>=3.0.1' 10 | query: 11 | name: '@subql/query' 12 | version: '*' 13 | customDs: 14 | kind: substrate/FrontierEvm 15 | assets: 16 | erc721: 17 | file: ./abis/erc721.json 18 | dataSources: 19 | - kind: ethereum/Runtime 20 | startBlock: 1 21 | mapping: 22 | handlers: 23 | - handler: handleTransaction 24 | kind: ethereum/BlockHandler 25 | -------------------------------------------------------------------------------- /packages/cli/test/schemaTest/schema.graphql: -------------------------------------------------------------------------------- 1 | enum Test { 2 | FOO 3 | BAR 4 | } 5 | type goodEntity @entity { 6 | id: ID! #id is a required field 7 | field1: Int! 8 | 9 | field2: String #filed2 is an optional field 10 | field3: BigInt 11 | 12 | field4: Date 13 | 14 | field5: Test 15 | 16 | field6: Float 17 | } 18 | -------------------------------------------------------------------------------- /packages/cli/test/schemaTest/typechain-test.yaml: -------------------------------------------------------------------------------- 1 | specVersion: '1.0.0' 2 | name: 'example' 3 | 4 | schema: 5 | file: './schema.graphql' 6 | 7 | runner: 8 | node: 9 | name: '@subql/node-ethereum' 10 | version: '>=3.0.1' 11 | query: 12 | name: '@subql/query' 13 | version: '*' 14 | 15 | dataSources: 16 | - kind: ethereum/Runtime 17 | startBlock: 1 18 | assets: 19 | erc721: 20 | file: ./abis/erc721.json 21 | mapping: 22 | handlers: 23 | - handler: handleTransaction 24 | kind: ethereum/BlockHandler 25 | - kind: ethereum/Runtime 26 | startBlock: 2 27 | assets: 28 | artifact: 29 | file: ../abiTest1/abis/artifact.sol/artifact.json 30 | mapping: 31 | handlers: 32 | - handler: handleTransaction 33 | kind: ethereum/BlockHandler 34 | -------------------------------------------------------------------------------- /packages/cli/test/tsManifestTest/subquery-multichain.ts: -------------------------------------------------------------------------------- 1 | import {MultichainProjectManifest} from '@subql/types-core'; 2 | 3 | const project: MultichainProjectManifest = { 4 | specVersion: '1.0.0', 5 | query: { 6 | name: '@subql/query', 7 | version: '*', 8 | }, 9 | projects: ['project1.ts', 'project2.ts'], 10 | }; 11 | 12 | export default project; 13 | -------------------------------------------------------------------------------- /packages/cli/test/tsManifestTest/subquery-multichain2.ts: -------------------------------------------------------------------------------- 1 | import {MultichainProjectManifest} from '@subql/types-core'; 2 | 3 | const project: MultichainProjectManifest = { 4 | specVersion: '1.0.0', 5 | query: { 6 | name: '@subql/query', 7 | version: '*', 8 | }, 9 | projects: ['project1.ts', 'project3.ts'], 10 | }; 11 | 12 | export default project; 13 | -------------------------------------------------------------------------------- /packages/cli/test/tsManifestTest/subquery-multichain3.ts: -------------------------------------------------------------------------------- 1 | import {MultichainProjectManifest} from '@subql/types-core'; 2 | 3 | const project: MultichainProjectManifest = { 4 | specVersion: '1.0.0', 5 | query: { 6 | name: '@subql/query', 7 | version: '*', 8 | }, 9 | projects: ['project1.ts', 'project3.yaml'], 10 | }; 11 | 12 | export default project; 13 | -------------------------------------------------------------------------------- /packages/cli/test/tsManifestTest/subquery-multichain4.yaml: -------------------------------------------------------------------------------- 1 | specVersion: 1.0.0 2 | query: 3 | name: '@subql/query' 4 | version: '*' 5 | projects: 6 | - project1.ts 7 | - project2.ts 8 | -------------------------------------------------------------------------------- /packages/cli/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "emitDecoratorMetadata": true, 5 | "experimentalDecorators": true, 6 | "esModuleInterop": true, 7 | "importHelpers": true, 8 | "rootDir": "src", 9 | "tsBuildInfoFile": "lib/.tsbuildinfo", 10 | "outDir": "lib", 11 | "noImplicitAny": true 12 | }, 13 | "references": [{"path": "../common"}, {"path": "../common-substrate"}, {"path": "../utils"}], 14 | "include": ["src/**/*"], 15 | "exclude": ["test/schemaTest/project.ts"] 16 | } 17 | -------------------------------------------------------------------------------- /packages/common-substrate/src/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './project'; 5 | 6 | import {SubstrateCustomDatasource, SubstrateDatasource, SubstrateRuntimeDatasource} from '@subql/types'; 7 | import {INetworkCommonModule} from '@subql/types-core'; 8 | import * as p from './project'; 9 | 10 | // This provides a compiled time check to ensure that the correct exports are provided 11 | // eslint-disable-next-line @typescript-eslint/no-unused-vars 12 | const _ = { 13 | ...p, 14 | } satisfies INetworkCommonModule; 15 | -------------------------------------------------------------------------------- /packages/common-substrate/src/project/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './load'; 5 | export * from './models'; 6 | export * from './types'; 7 | export * from './utils'; 8 | export * from './versioned'; 9 | 10 | import {parseSubstrateProjectManifest} from './load'; 11 | export {parseSubstrateProjectManifest as parseProjectManifest}; 12 | -------------------------------------------------------------------------------- /packages/common-substrate/src/project/versioned/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './ProjectManifestVersioned'; 5 | export * from './v1_0_0'; 6 | -------------------------------------------------------------------------------- /packages/common-substrate/src/project/versioned/v1_0_0/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './model'; 5 | -------------------------------------------------------------------------------- /packages/common-substrate/test/project_invalid_version.yaml: -------------------------------------------------------------------------------- 1 | # project.yaml 2 | specVersion: '0.0.0' 3 | description: '' 4 | repository: 'https://github.com/subquery/subql-starter' 5 | 6 | schema: 7 | file: ./schema.graphql 8 | 9 | network: 10 | genesisHash: '0x' 11 | chaintypes: 12 | file: ./types.json 13 | 14 | dataSources: 15 | - name: main 16 | kind: substrate/Runtime 17 | startBlock: 1 18 | mapping: 19 | file: dist/index.js 20 | handlers: 21 | - handler: handleBlock 22 | kind: substrate/BlockHandler 23 | - handler: handleEvent 24 | kind: substrate/EventHandler 25 | filter: #Filter is optional 26 | module: balances 27 | method: Deposit 28 | - handler: handleCall 29 | kind: substrate/CallHandler 30 | -------------------------------------------------------------------------------- /packages/common-substrate/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "rootDir": "src", 5 | "tsBuildInfoFile": "dist/.tsbuildinfo", 6 | "outDir": "dist", 7 | "noImplicitAny": true 8 | }, 9 | "references": [{"path": "../types"}, {"path": "../common"}], 10 | "include": ["src/**/*"] 11 | } 12 | -------------------------------------------------------------------------------- /packages/common/fixtures/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "subquery-starter", 3 | "version": "0.0.3", 4 | "description": "This project can be use as a starting point for developing your SubQuery project", 5 | "main": "dist/index.js", 6 | "scripts": { 7 | "build": "tsc -b", 8 | "prepack": "rm -rf dist && npm build", 9 | "test": "jest", 10 | "codegen": "./node_modules/.bin/subql codegen" 11 | }, 12 | "homepage": "https://github.com/subquery/subql-starter", 13 | "repository": "github:subquery/subql-starter", 14 | "files": [ 15 | "dist", 16 | "schema.graphql", 17 | "project.yaml" 18 | ], 19 | "author": "Ian He & Jay Ji", 20 | "license": "Apache-2.0", 21 | "devDependencies": { 22 | "@polkadot/api": "^15.6.1", 23 | "@subql/types": "latest", 24 | "typescript": "^4.9.5", 25 | "@subql/cli": "latest" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /packages/common/fixtures/project.yaml: -------------------------------------------------------------------------------- 1 | specVersion: "0.0.1" 2 | description: "" 3 | repository: "https://github.com/subquery/subql-starter" 4 | 5 | schema: "./schema.graphql" 6 | 7 | network: 8 | endpoint: "wss://polkadot.api.onfinality.io/public-ws" 9 | 10 | dataSources: 11 | - name: main 12 | kind: substrate/Runtime 13 | startBlock: 1 14 | mapping: 15 | handlers: 16 | - handler: handleBlock 17 | kind: substrate/BlockHandler 18 | - handler: handleEvent 19 | kind: substrate/EventHandler 20 | filter: #Filter is optional 21 | module: balances 22 | method: Deposit 23 | - handler: handleCall 24 | kind: substrate/CallHandler 25 | -------------------------------------------------------------------------------- /packages/common/src/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import 'reflect-metadata'; 5 | 6 | export * from './project'; 7 | export * from './constants'; 8 | export * from './multichain'; 9 | -------------------------------------------------------------------------------- /packages/common/src/multichain/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './models'; 5 | -------------------------------------------------------------------------------- /packages/common/src/multichain/models.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import {MultichainProjectManifest, QuerySpec} from '@subql/types-core'; 5 | import {Type} from 'class-transformer'; 6 | import {Equals, IsObject, IsString} from 'class-validator'; 7 | import {RunnerQueryBaseModel} from '../project'; 8 | 9 | export class MultichainProjectManifestModel implements MultichainProjectManifest { 10 | @Equals('1.0.0') 11 | specVersion!: string; 12 | @IsString({each: true}) 13 | projects!: string[]; 14 | @IsObject() 15 | @Type(() => RunnerQueryBaseModel) 16 | query!: QuerySpec; 17 | } 18 | -------------------------------------------------------------------------------- /packages/common/src/project/IpfsHttpClientLite/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './IPFSHTTPClientLite'; 5 | -------------------------------------------------------------------------------- /packages/common/src/project/IpfsHttpClientLite/utils.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import axios from 'axios'; 5 | 6 | export async function* streamCat(baseUrl: string, ipfsCID: string): AsyncIterable { 7 | const url = new URL(`${baseUrl}/cat?progress=true`); 8 | url.searchParams.append('arg', ipfsCID); 9 | 10 | try { 11 | const res = await axios.post( 12 | url.toString(), 13 | {}, 14 | { 15 | responseType: 'stream', 16 | } 17 | ); 18 | // Iterate over the stream and yield data 19 | for await (const chunk of res.data) { 20 | yield chunk; 21 | } 22 | } catch (error) { 23 | throw new Error(`Failed to fetch data from IPFS for CID ${ipfsCID}`); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /packages/common/src/project/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './load'; 5 | export * from './versioned'; 6 | export * from './readers'; 7 | export * from './utils'; 8 | export * from './IpfsHttpClientLite'; 9 | -------------------------------------------------------------------------------- /packages/common/src/project/readers/github-reader.spec.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import {Reader} from '@subql/types-core'; 5 | import {GithubReader} from './github-reader'; 6 | 7 | describe('GithubReader', () => { 8 | let reader: Reader; 9 | 10 | beforeAll(() => { 11 | const key = 'subquery/tutorials-block-timestamp'; 12 | reader = new GithubReader(key); 13 | }); 14 | 15 | it('should return the package json object', async () => { 16 | const data = await reader.getPkg(); 17 | expect(data?.name).toBe('block-timestamp'); 18 | }); 19 | 20 | it('should return the project schema object', async () => { 21 | const data: any = await reader.getProjectSchema(); 22 | expect(data.repository).toBe('https://github.com/subquery/subql-examples'); 23 | }); 24 | }); 25 | -------------------------------------------------------------------------------- /packages/common/src/project/readers/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './reader'; 5 | export * from './github-reader'; 6 | export * from './ipfs-reader'; 7 | export * from './local-reader'; 8 | -------------------------------------------------------------------------------- /packages/common/src/project/versioned/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './base'; 5 | export * from './v1_0_0'; 6 | -------------------------------------------------------------------------------- /packages/common/src/project/versioned/v1_0_0/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './models'; 5 | -------------------------------------------------------------------------------- /packages/common/test/mockedSubqueryProject.tgz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/packages/common/test/mockedSubqueryProject.tgz -------------------------------------------------------------------------------- /packages/common/test/project_0.2.0.yaml: -------------------------------------------------------------------------------- 1 | # project.yaml 2 | specVersion: '0.2.0' 3 | description: '' 4 | repository: 'https://github.com/subquery/subql-starter' 5 | name: Test 6 | version: '0.0.0' 7 | 8 | schema: 9 | file: ./schema.graphql 10 | 11 | network: 12 | genesisHash: '0x' 13 | dictionary: 'https://api.subquery.network/sq/subquery/dictionary-polkadot' 14 | chaintypes: 15 | file: ./types.json 16 | 17 | dataSources: 18 | - kind: substrate/Runtime 19 | startBlock: 1 20 | mapping: 21 | file: dist/index.js 22 | handlers: 23 | - handler: handleBlock 24 | kind: substrate/BlockHandler 25 | - handler: handleEvent 26 | kind: substrate/EventHandler 27 | filter: #Filter is optional 28 | module: balances 29 | method: Deposit 30 | - handler: handleCall 31 | kind: substrate/CallHandler 32 | -------------------------------------------------------------------------------- /packages/common/test/project_0.2.0_custom_ds.yaml: -------------------------------------------------------------------------------- 1 | # project.yaml 2 | specVersion: '0.2.0' 3 | description: '' 4 | repository: 'https://github.com/subquery/subql-starter' 5 | name: Test 6 | version: '0.0.0' 7 | 8 | schema: 9 | file: ./schema.graphql 10 | 11 | network: 12 | genesisHash: '0x' 13 | chaintypes: 14 | file: ./types.json 15 | 16 | dataSources: 17 | - kind: substrate/Jsonfy 18 | startBlock: 1 19 | processor: 20 | file: '@subql/contract-processors/jsonfy.js' 21 | assets: 22 | test: 23 | file: './abi.json' 24 | mapping: 25 | file: dist/index.js 26 | handlers: 27 | - handler: handleEvent 28 | kind: substrate/JsonfyEvent 29 | -------------------------------------------------------------------------------- /packages/common/test/project_0.2.0_invalid_custom_ds.yaml: -------------------------------------------------------------------------------- 1 | # project.yaml 2 | specVersion: '0.2.0' 3 | description: '' 4 | repository: 'https://github.com/subquery/subql-starter' 5 | name: Test 6 | version: '0.0.0' 7 | 8 | schema: 9 | file: ./schema.graphql 10 | 11 | network: 12 | genesisHash: '0x' 13 | chaintypes: 14 | file: ./types.json 15 | 16 | dataSources: 17 | - kind: substrate/Jsonfy 18 | startBlock: 1 19 | # processor: 20 | # file: '@subql/contract-processors/jsonfy.js' 21 | mapping: 22 | file: dist/index.js 23 | handlers: 24 | - handler: handleEvent 25 | kind: substrate/JsonfyEvent 26 | -------------------------------------------------------------------------------- /packages/common/test/project_falsy.yaml: -------------------------------------------------------------------------------- 1 | specVersion: '0.0.1' 2 | description: '' 3 | repository: 'https://github.com/OnFinality-io/subql-examples' 4 | 5 | schema: './schema.graphql' 6 | 7 | #network: 8 | # endpoint: 'wss://polkadot.api.onfinality.io/public-ws' 9 | 10 | dataSources: 11 | - name: main 12 | kind: substrate/SmartContract 13 | mapping: 14 | handlers: 15 | - handler: handleBlock 16 | kind: substrate/XXXHandler 17 | filter: 18 | module: xxx 19 | - name: handleEvent 20 | kind: substrate/CallHandler 21 | -------------------------------------------------------------------------------- /packages/common/test/project_invalid_version.yaml: -------------------------------------------------------------------------------- 1 | # project.yaml 2 | specVersion: "0.0.0" 3 | description: "" 4 | repository: "https://github.com/subquery/subql-starter" 5 | 6 | schema: 7 | file: ./schema.graphql 8 | 9 | network: 10 | genesisHash: '0x' 11 | chaintypes: 12 | file: ./types.json 13 | 14 | dataSources: 15 | - name: main 16 | kind: substrate/Runtime 17 | startBlock: 1 18 | mapping: 19 | file: dist/index.js 20 | handlers: 21 | - handler: handleBlock 22 | kind: substrate/BlockHandler 23 | - handler: handleEvent 24 | kind: substrate/EventHandler 25 | filter: #Filter is optional 26 | module: balances 27 | method: Deposit 28 | - handler: handleCall 29 | kind: substrate/CallHandler 30 | 31 | 32 | -------------------------------------------------------------------------------- /packages/common/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "rootDir": "src", 5 | "tsBuildInfoFile": "dist/.tsbuildinfo", 6 | "outDir": "dist", 7 | "noImplicitAny": true 8 | }, 9 | "references": [{"path": "../types"}], 10 | "include": ["src/**/*"] 11 | } 12 | -------------------------------------------------------------------------------- /packages/node-core/logger.js: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | // A standalone entrypoint for logger so we can import `@subql/node-core/logger` 5 | const logger = require('./dist/logger'); 6 | 7 | module.exports = logger; 8 | -------------------------------------------------------------------------------- /packages/node-core/src/admin/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './blockRange'; 5 | -------------------------------------------------------------------------------- /packages/node-core/src/configure/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './configure.module'; 5 | export * from './NodeConfig'; 6 | export * from './ProjectUpgrade.service'; 7 | export * from './SubqueryProject'; 8 | -------------------------------------------------------------------------------- /packages/node-core/src/db/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './db.module'; 5 | export * from './migration-service'; 6 | export * from './sync-helper'; 7 | -------------------------------------------------------------------------------- /packages/node-core/src/db/migration-service/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './migration'; 5 | export * from './SchemaMigration.service'; 6 | -------------------------------------------------------------------------------- /packages/node-core/src/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import './utils/bigint'; 5 | 6 | export * from './api.service'; 7 | export * from './api.connection.error'; 8 | export * from './logger'; 9 | export * from './process'; 10 | export * from './profiler'; 11 | export * from './events'; 12 | export * from './configure'; 13 | export * from './db'; 14 | export * from './meta'; 15 | export * from './utils'; 16 | export * from './indexer'; 17 | export * from './subcommands'; 18 | export * from './yargs'; 19 | export * from './admin'; 20 | export * from './blockchain.service'; 21 | -------------------------------------------------------------------------------- /packages/node-core/src/indexer/blockDispatcher/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './base-block-dispatcher'; 5 | export * from './block-dispatcher'; 6 | export * from './worker-block-dispatcher'; 7 | export * from './factory'; 8 | -------------------------------------------------------------------------------- /packages/node-core/src/indexer/dictionary/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './v1'; 5 | export * from './v2'; 6 | export * from './types'; 7 | export * from './dictionary.service'; 8 | export * from './utils'; 9 | -------------------------------------------------------------------------------- /packages/node-core/src/indexer/dictionary/v1/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './dictionaryV1'; 5 | export * from './utils'; 6 | -------------------------------------------------------------------------------- /packages/node-core/src/indexer/dictionary/v2/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './types'; 5 | export * from './dictionaryV2'; 6 | -------------------------------------------------------------------------------- /packages/node-core/src/indexer/dictionary/v2/types.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export interface V2MetadataFilters { 5 | [key: string]: string[]; 6 | } 7 | 8 | export interface FieldSelector { 9 | [key: string]: boolean | FieldSelector; 10 | } 11 | 12 | export interface RawDictionaryResponseData { 13 | blocks: RFB[]; //raw fat blocks 14 | blockRange: [string, string]; // Hex encoded numbers 15 | genesisHash: string; 16 | } 17 | 18 | export interface DictionaryV2Metadata { 19 | start: number; 20 | end: number; 21 | genesisHash: string; 22 | chainId: string; 23 | filters: V2MetadataFilters; 24 | supported: string[]; 25 | } 26 | 27 | export type DictionaryV2QueryEntry = Record; 28 | -------------------------------------------------------------------------------- /packages/node-core/src/indexer/entities/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './Poi.entity'; 5 | export * from './Metadata.entity'; 6 | export * from './GlobalData.entity'; 7 | -------------------------------------------------------------------------------- /packages/node-core/src/indexer/poi/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './poi.service'; 5 | export * from './poiSync.service'; 6 | export * from './PoiBlock'; 7 | -------------------------------------------------------------------------------- /packages/node-core/src/indexer/store/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './store'; 5 | -------------------------------------------------------------------------------- /packages/node-core/src/indexer/storeModelProvider/cacheable.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import {Transaction} from '@subql/x-sequelize'; 5 | import {Mutex} from 'async-mutex'; 6 | 7 | export abstract class Cacheable { 8 | protected mutex = new Mutex(); 9 | 10 | abstract clear(historicalUnit?: number): void; 11 | protected abstract runFlush(tx: Transaction, historicalUnit: number): Promise; 12 | 13 | async flush(tx: Transaction, historicalUnit: number): Promise { 14 | const release = await this.mutex.acquire(); 15 | 16 | try { 17 | tx.afterCommit(() => { 18 | this.clear(historicalUnit); 19 | release(); 20 | }); 21 | 22 | await this.runFlush(tx, historicalUnit); 23 | } catch (e) { 24 | release(); 25 | throw e; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /packages/node-core/src/indexer/storeModelProvider/exporters/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './exporter'; 5 | export * from './csvStore'; 6 | -------------------------------------------------------------------------------- /packages/node-core/src/indexer/storeModelProvider/global/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export {IGlobalData} from './global'; 5 | -------------------------------------------------------------------------------- /packages/node-core/src/indexer/storeModelProvider/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './storeCache.service'; 5 | export * from './types'; 6 | export * from './model'; 7 | export * from './metadata'; 8 | export * from './storeModel.service'; 9 | export * from './utils'; 10 | -------------------------------------------------------------------------------- /packages/node-core/src/indexer/storeModelProvider/metadata/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './cacheMetadata'; 5 | export {IMetadata} from './metadata'; 6 | -------------------------------------------------------------------------------- /packages/node-core/src/indexer/storeModelProvider/model/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './cacheModel'; 5 | export {IModel, BaseEntity} from './model'; 6 | -------------------------------------------------------------------------------- /packages/node-core/src/indexer/storeModelProvider/model/utils.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import {FieldOperators, GetOptions} from '@subql/types-core'; 5 | import {Op} from '@subql/x-sequelize'; 6 | 7 | export const operatorsMap: Record = { 8 | '=': Op.eq, 9 | '!=': Op.ne, 10 | in: Op.in, 11 | '!in': Op.notIn, 12 | }; 13 | 14 | const defaultOptions: Required> = { 15 | offset: 0, 16 | limit: 100, 17 | orderBy: 'id', 18 | orderDirection: 'ASC', 19 | }; 20 | 21 | // Ensure we have all the options 22 | export const getFullOptions = (options?: GetOptions): Required> => 23 | ({ 24 | ...(defaultOptions as GetOptions), 25 | ...options, 26 | }) as Required>; 27 | -------------------------------------------------------------------------------- /packages/node-core/src/indexer/storeModelProvider/poi/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './cachePoi'; 5 | export * from './poi'; 6 | -------------------------------------------------------------------------------- /packages/node-core/src/indexer/worker/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './worker.builder'; 5 | export * from './worker.store.service'; 6 | export * from './worker.cache.service'; 7 | export * from './worker.dynamic-ds.service'; 8 | export * from './worker.connectionPoolState.manager'; 9 | export * from './worker.unfinalizedBlocks.service'; 10 | export * from './worker.monitor.service'; 11 | export * from './worker.service'; 12 | export * from './worker'; 13 | export * from './utils'; 14 | export * from './worker.core.module'; 15 | -------------------------------------------------------------------------------- /packages/node-core/src/indexer/worker/test.store.worker.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import {Store} from '@subql/types-core'; 5 | import {WorkerHost} from './worker.builder'; 6 | import {hostStoreKeys, hostStoreToStore} from './worker.store.service'; 7 | 8 | let store: Store | null = null; 9 | 10 | async function callStoreFunction(name: string, args: any[]) { 11 | if (store === null) { 12 | throw new Error('Store is null'); 13 | } 14 | const res = await (store as any)[name as any](...args); 15 | } 16 | 17 | const host = WorkerHost.create( 18 | hostStoreKeys, 19 | { 20 | callStoreFunction, 21 | }, 22 | null as any 23 | ); 24 | 25 | store = hostStoreToStore(host as any); 26 | -------------------------------------------------------------------------------- /packages/node-core/src/meta/health.controller.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import {Controller, Get, HttpException, HttpStatus} from '@nestjs/common'; 5 | import {getLogger} from '../logger'; 6 | import {HealthService} from './health.service'; 7 | 8 | const logger = getLogger('health'); 9 | 10 | @Controller('health') 11 | export class HealthController { 12 | constructor(private healthService: HealthService) {} 13 | 14 | @Get() 15 | getHealth(): void { 16 | try { 17 | this.healthService.getHealth(); 18 | } catch (e: any) { 19 | logger.error(e); 20 | throw new HttpException( 21 | { 22 | status: HttpStatus.INTERNAL_SERVER_ERROR, 23 | error: e.message, 24 | }, 25 | HttpStatus.INTERNAL_SERVER_ERROR 26 | ); 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /packages/node-core/src/meta/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './meta.module'; 5 | -------------------------------------------------------------------------------- /packages/node-core/src/meta/meta.controller.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import {Controller, Get} from '@nestjs/common'; 5 | import {MetaService} from './meta.service'; 6 | 7 | @Controller('meta') 8 | export class MetaController { 9 | constructor(private metaService: MetaService) {} 10 | 11 | @Get() 12 | getMeta() { 13 | return this.metaService.getMeta(); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /packages/node-core/src/meta/ready.controller.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import {Controller, Get, HttpException, HttpStatus} from '@nestjs/common'; 5 | import {ReadyService} from './ready.service'; 6 | 7 | @Controller('ready') 8 | export class ReadyController { 9 | constructor(private readyService: ReadyService) {} 10 | 11 | @Get() 12 | getReady() { 13 | if (!this.readyService.ready) { 14 | throw new HttpException( 15 | { 16 | status: HttpStatus.SERVICE_UNAVAILABLE, 17 | error: 'Database schema is not created or ready', 18 | }, 19 | HttpStatus.SERVICE_UNAVAILABLE 20 | ); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /packages/node-core/src/meta/ready.service.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import {Injectable} from '@nestjs/common'; 5 | import {OnEvent} from '@nestjs/event-emitter'; 6 | import {EventPayload, IndexerEvent} from '../events'; 7 | 8 | @Injectable() 9 | export class ReadyService { 10 | private _ready: boolean; 11 | 12 | constructor() { 13 | this._ready = false; 14 | } 15 | 16 | @OnEvent(IndexerEvent.Ready) 17 | handleReady({value}: EventPayload): void { 18 | this._ready = value; 19 | } 20 | 21 | get ready(): boolean { 22 | return this._ready; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /packages/node-core/src/subcommands/forceClean.module.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import {Module} from '@nestjs/common'; 5 | import {SchedulerRegistry} from '@nestjs/schedule'; 6 | import {ForceCleanService} from './forceClean.service'; 7 | 8 | @Module({ 9 | providers: [ForceCleanService, SchedulerRegistry], 10 | controllers: [], 11 | }) 12 | export class ForceCleanFeatureModule {} 13 | -------------------------------------------------------------------------------- /packages/node-core/src/subcommands/foreceClean.init.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import {NestFactory} from '@nestjs/core'; 5 | import {getLogger} from '../logger'; 6 | import {exitWithError} from '../process'; 7 | import {ForceCleanService} from './forceClean.service'; 8 | 9 | const logger = getLogger('CLI'); 10 | export async function forceClean(forceCleanModule: any): Promise { 11 | try { 12 | const app = await NestFactory.create(forceCleanModule); 13 | await app.init(); 14 | const forceCleanService = app.get(ForceCleanService); 15 | await forceCleanService.forceClean(); 16 | } catch (e: any) { 17 | exitWithError(new Error(`Force-clean failed to execute`, {cause: e}), logger); 18 | } 19 | 20 | process.exit(0); 21 | } 22 | -------------------------------------------------------------------------------- /packages/node-core/src/subcommands/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './forceClean.service'; 5 | export * from './forceClean.module'; 6 | export * from './foreceClean.init'; 7 | export * from './reindex.init'; 8 | export * from './reindex.service'; 9 | export * from './testing.core.module'; 10 | -------------------------------------------------------------------------------- /packages/node-core/src/utils/bigint.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | interface BigInt { 5 | toJSON(): string; 6 | } 7 | 8 | // Make BigInt json serializable, note this doesn't go from string -> BigInt when parsing 9 | BigInt.prototype.toJSON = function () { 10 | return `${this.toString()}n`; 11 | }; 12 | -------------------------------------------------------------------------------- /packages/node-core/src/utils/decorators.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import {isMainThread} from 'worker_threads'; 5 | import {getLogger} from '../logger'; 6 | 7 | const logger = getLogger('main'); 8 | export function mainThreadOnly(): MethodDecorator { 9 | return (target, name: string | symbol, descriptor: PropertyDescriptor): void => { 10 | if (!!descriptor && typeof descriptor.value === 'function') { 11 | const orig = descriptor.value; 12 | // tslint:disable no-function-expression no-invalid-this 13 | descriptor.value = function (...args: any[]): any { 14 | if (!isMainThread) { 15 | logger.warn(`${name?.toString()} should only run in main thread`); 16 | } 17 | return orig.bind(this)(...args); 18 | }; 19 | } 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /packages/node-core/src/utils/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './decorators'; 5 | export * from './object'; 6 | export * from './promise'; 7 | export * from './graphql'; 8 | export * from './queues'; 9 | export * from './project'; 10 | export * from './fetchHelpers'; 11 | export * from './configure'; 12 | export * from './reindex'; 13 | export * from './blocks'; 14 | export * from './blockHeightMap'; 15 | export * from './string'; 16 | -------------------------------------------------------------------------------- /packages/node-core/src/utils/object.spec.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import {camelCaseObjectKey} from './object'; 5 | 6 | it('Convert objects key to camelCase', () => { 7 | const object = { 8 | entity: 'someEntity', 9 | active_for_auction: 'someAuction', 10 | }; 11 | 12 | const result = camelCaseObjectKey(object); 13 | 14 | expect(result).toEqual({ 15 | entity: 'someEntity', 16 | activeForAuction: 'someAuction', 17 | }); 18 | }); 19 | -------------------------------------------------------------------------------- /packages/node-core/src/utils/queues/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './autoQueue'; 5 | export * from './queue'; 6 | export * from './rampQueue'; 7 | -------------------------------------------------------------------------------- /packages/node-core/test/config.json: -------------------------------------------------------------------------------- 1 | { 2 | "subquery": "../../../../subql-example/extrinsics", 3 | "subqueryName": "extrinsics" 4 | } 5 | -------------------------------------------------------------------------------- /packages/node-core/test/config.toml: -------------------------------------------------------------------------------- 1 | { 2 | "subquery": "../../../../subql-example/extrinsics", 3 | "subqueryName": "extrinsics" 4 | } 5 | -------------------------------------------------------------------------------- /packages/node-core/test/config.yml: -------------------------------------------------------------------------------- 1 | subquery: ../../../../subql-example/extrinsics 2 | subqueryName: extrinsics 3 | -------------------------------------------------------------------------------- /packages/node-core/test/migration-schemas/test_14_1.graphql: -------------------------------------------------------------------------------- 1 | type Transfer @entity { 2 | id: ID! 3 | amount: BigInt! 4 | blockNumber: Int! 5 | date: Date! 6 | from: Account! 7 | to: Account! 8 | } 9 | 10 | type Account @entity { 11 | id: ID! 12 | publicKey: String! 13 | firstTransferBlock: Int 14 | lastTransferBlock: Int 15 | sentTransfers: [Transfer] @derivedFrom(field: "from") # These are virtual properties to help us navigate to the correct foreign key of Transfer 16 | recievedTransfers: [Transfer] @derivedFrom(field: "to") # These are virtual properties to help us navigate to the correct foreign key of Transfer 17 | } 18 | -------------------------------------------------------------------------------- /packages/node-core/test/migration-schemas/test_14_1000.graphql: -------------------------------------------------------------------------------- 1 | type Transfer @entity { 2 | id: ID! 3 | amount: BigInt! 4 | blockNumber: Int! 5 | date: Date! 6 | # from: Account! 7 | # to: Account! 8 | } 9 | -------------------------------------------------------------------------------- /packages/node-core/test/migration-schemas/test_19_1.graphql: -------------------------------------------------------------------------------- 1 | type Transfer @entity { 2 | """ 3 | id field is always required and must look like this 4 | """ 5 | id: ID! 6 | """ 7 | Amount that is transferred 8 | """ 9 | amount: BigInt! 10 | """ 11 | The block height of the transfer 12 | """ 13 | blockNumber: Int! 14 | """ 15 | The date of the transfer 16 | """ 17 | date: Date! 18 | """ 19 | The account that transfers are made from 20 | """ 21 | # from: Account! 22 | from: String 23 | """ 24 | The account that transfers are made to 25 | """ 26 | # to: Account! 27 | 28 | to: String 29 | # accountValue: Account 30 | } 31 | 32 | type ManyToManyTestEntity @entity { 33 | id: ID! 34 | transfer: Transfer! 35 | exampleEnum: ModifyEnumType 36 | } 37 | 38 | enum ModifyEnumType { 39 | GOOD 40 | BAD 41 | NEUTRAL 42 | CHAOS 43 | } 44 | -------------------------------------------------------------------------------- /packages/node-core/test/migration-schemas/test_20_1.graphql: -------------------------------------------------------------------------------- 1 | type Transfer @entity { 2 | """ 3 | id field is always required and must look like this 4 | """ 5 | id: ID! 6 | """ 7 | Amount that is transferred 8 | """ 9 | amount: BigInt! 10 | """ 11 | The block height of the transfer 12 | """ 13 | blockNumber: Int! 14 | """ 15 | The date of the transfer 16 | """ 17 | date: Date! 18 | """ 19 | The account that transfers are made from 20 | """ 21 | # from: Account! 22 | from: String 23 | """ 24 | The account that transfers are made to 25 | """ 26 | # to: Account! 27 | 28 | to: String 29 | # accountValue: Account 30 | } 31 | 32 | type ManyToManyTestEntity @entity { 33 | id: ID! 34 | transfer: Transfer! 35 | exampleEnum: ModifyEnumType 36 | } 37 | 38 | enum ModifyEnumType { 39 | GOOD 40 | BAD 41 | NEUTRAL 42 | CHAOS 43 | } 44 | -------------------------------------------------------------------------------- /packages/node-core/test/migration-schemas/test_20_2000.graphql: -------------------------------------------------------------------------------- 1 | type Transfer @entity { 2 | """ 3 | id field is always required and must look like this 4 | """ 5 | id: ID! 6 | """ 7 | Amount that is transferred 8 | """ 9 | amount: BigInt! 10 | """ 11 | The block height of the transfer 12 | """ 13 | blockNumber: Int! 14 | """ 15 | The date of the transfer 16 | """ 17 | date: Date! 18 | """ 19 | The account that transfers are made from 20 | """ 21 | # from: Account! 22 | from: String 23 | """ 24 | The account that transfers are made to 25 | """ 26 | # to: Account! 27 | 28 | to: String 29 | # accountValue: Account 30 | } 31 | 32 | type ManyToManyTestEntity @entity { 33 | id: ID! 34 | transfer: Transfer! 35 | exampleEnum: ModifyEnumType 36 | } 37 | 38 | # Order is reversed 39 | enum ModifyEnumType { 40 | CHAOS 41 | NEUTRAL 42 | BAD 43 | GOOD 44 | } 45 | -------------------------------------------------------------------------------- /packages/node-core/test/sandbox/atob-test.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | // SPDX-License-Identifier: GPL-3.0 3 | Object.defineProperty(exports, '__esModule', {value: true}); 4 | exports.testSandbox = void 0; 5 | async function testSandbox() { 6 | try { 7 | const base64String = 'SGVsbG8sIFdvcmxkIQ=='; 8 | console.log(atob(base64String)); //expect to be `Hello, World!` 9 | } catch (e) { 10 | throw new Error(`atob in sandbox failed, ${e}`); 11 | } 12 | } 13 | exports.testSandbox = testSandbox; 14 | //# sourceMappingURL=atob-test.js.map 15 | -------------------------------------------------------------------------------- /packages/node-core/test/sandbox/atob-test.ts: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: GPL-3.0 2 | 3 | export async function testSandbox(): Promise { 4 | try { 5 | const base64String = 'SGVsbG8sIFdvcmxkIQ=='; 6 | console.log(atob(base64String)); //expect to be `Hello, World!` 7 | } catch (e) { 8 | throw new Error(`atob in sandbox failed, ${e}`); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /packages/node-core/test/sandbox/main.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 3 | // SPDX-License-Identifier: GPL-3.0 4 | Object.defineProperty(exports, '__esModule', {value: true}); 5 | exports.testSandbox = void 0; 6 | async function testSandbox() { 7 | await new Promise((resolve) => setTimeout(resolve, 3000)); 8 | console.log('OK'); 9 | } 10 | exports.testSandbox = testSandbox; 11 | -------------------------------------------------------------------------------- /packages/node-core/test/sandbox/main.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export async function testSandbox(): Promise { 5 | await new Promise((resolve) => setTimeout(resolve, 3000)); 6 | console.log('OK'); 7 | } 8 | -------------------------------------------------------------------------------- /packages/node-core/test/sandbox/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "sandbox", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "main.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC" 11 | } 12 | -------------------------------------------------------------------------------- /packages/node-core/test/sandbox/schema.graphql: -------------------------------------------------------------------------------- 1 | type StarterEntity @entity { 2 | id: ID! #id is a required field 3 | field1: Int! 4 | 5 | field2: String #filed2 is an optional field 6 | field3: BigInt 7 | 8 | field4: Date 9 | 10 | field5: Boolean 11 | } 12 | -------------------------------------------------------------------------------- /packages/node-core/test/sandbox/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es2017", 5 | "noImplicitAny": false, 6 | "moduleResolution": "node", 7 | "baseUrl": ".", 8 | "types": ["node", "jest"], 9 | "experimentalDecorators": true, 10 | "esModuleInterop": true, 11 | "allowSyntheticDefaultImports": true, 12 | "lib": ["ES2017"], 13 | "emitDecoratorMetadata": true, 14 | "sourceMap": false, 15 | "rootDir": ".", 16 | "outDir": "." 17 | }, 18 | "exclude": [], 19 | "include": ["./main.ts", "./project.ts"] 20 | } 21 | -------------------------------------------------------------------------------- /packages/node-core/test/schemas/badschema-2.graphql: -------------------------------------------------------------------------------- 1 | type EntityOne @entity { 2 | id: ID! #id is a required field 3 | field1: Int! 4 | field2: Int! # no nullability changes, but dataType change 5 | } 6 | 7 | type EntityTwo @entity { 8 | id: ID! 9 | field1: Int! 10 | field2: String 11 | field3: BigInt 12 | field5: FieldTypeOld! 13 | } 14 | 15 | enum FieldTypeOld { 16 | VALUE1 17 | VALUE2 18 | } 19 | 20 | enum FieldTypeMod { 21 | VALUE1 22 | VALUE2 23 | } 24 | -------------------------------------------------------------------------------- /packages/node-core/test/schemas/oldSchema.graphql: -------------------------------------------------------------------------------- 1 | type EntityOne @entity { 2 | id: ID! #id is a required field 3 | field1: Int! 4 | field2: String! 5 | field3: EntityThree! 6 | } 7 | 8 | type EntityTwo @entity { 9 | id: ID! #id is a required field 10 | field1: Int! 11 | field2: String #filed2 is an optional field 12 | field3: BigInt 13 | field5: FieldTypeOld! 14 | } 15 | 16 | type ExampleJsonOne @jsonField { 17 | one: String! 18 | two: Int! 19 | } 20 | 21 | type ExampleJsonTwo @jsonField { 22 | one: String! 23 | two: ExampleJsonOne! # Nested Json 24 | } 25 | 26 | type EntityThree @entity { 27 | id: ID! #id is a required field 28 | field1: [ExampleJsonTwo] 29 | } 30 | 31 | enum FieldTypeOld { 32 | VALUE1 33 | VALUE2 34 | } 35 | 36 | enum FieldTypeMod { 37 | VALUE1 38 | VALUE2 39 | } 40 | -------------------------------------------------------------------------------- /packages/node-core/test/v1.0.0/distMock/chaintypes.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | exports.default = {typesBundle: {}}; 4 | -------------------------------------------------------------------------------- /packages/node-core/test/v1.0.0/distMock/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | Object.defineProperty(exports, '__esModule', {value: true}); 3 | const tslib_1 = require('tslib'); 4 | //Exports all handler functions 5 | require('@polkadot/api-augment'); 6 | (0, tslib_1.__exportStar)(require('./mappings/mappingHandlers'), exports); 7 | -------------------------------------------------------------------------------- /packages/node-core/test/v1.0.0/schema.graphql: -------------------------------------------------------------------------------- 1 | type StarterEntity @entity { 2 | id: ID! #id is a required field 3 | field1: Int! 4 | 5 | field2: String #filed2 is an optional field 6 | field3: BigInt 7 | 8 | field4: Date 9 | 10 | field5: Boolean 11 | } 12 | -------------------------------------------------------------------------------- /packages/node-core/test/v1.0.0/types.yaml: -------------------------------------------------------------------------------- 1 | types: 2 | TestType: u32 3 | typesAlias: 4 | Alias: 5 | TestType2: test 6 | typesBundle: 7 | spec: 8 | '2312': 9 | types: 10 | - minmax: 11 | - 232 12 | - 122 13 | types: 14 | TestType3: test3 15 | chain: 16 | mockchain: 17 | types: 18 | - minmax: 19 | - 232 20 | - 122 21 | types: 22 | TestType4: test4 23 | typesChain: 24 | chain2: 25 | TestType5: test 26 | typesSpec: 27 | spec3: 28 | TestType6: test 29 | -------------------------------------------------------------------------------- /packages/node-core/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "tsBuildInfoFile": "dist/.tsbuildinfo", 5 | "rootDir": "src", 6 | "outDir": "dist", 7 | "esModuleInterop": true, 8 | "importHelpers": true, 9 | "noImplicitAny": true 10 | }, 11 | "references": [{"path": "../common"}, {"path": "../utils"}, {"path": "../testing"}], 12 | "include": ["src/**/*"] 13 | } 14 | -------------------------------------------------------------------------------- /packages/node-core/yargs.js: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | // A standalone entrypoint for logger so we can import `@subql/node-core/logger` 5 | const yargs = require('./dist/yargs'); 6 | 7 | module.exports = yargs; 8 | -------------------------------------------------------------------------------- /packages/node/.gitignore: -------------------------------------------------------------------------------- 1 | # compiled output 2 | /dist 3 | /node_modules 4 | 5 | # Logs 6 | logs 7 | *.log 8 | npm-debug.log* 9 | yarn-debug.log* 10 | yarn-error.log* 11 | lerna-debug.log* 12 | 13 | # OS 14 | .DS_Store 15 | 16 | # Tests 17 | /coverage 18 | /.nyc_output 19 | 20 | # IDEs and editors 21 | /.idea 22 | .project 23 | .classpath 24 | .c9/ 25 | *.launch 26 | .settings/ 27 | *.sublime-workspace 28 | 29 | # IDE - VSCode 30 | .vscode/* 31 | !.vscode/settings.json 32 | !.vscode/tasks.json 33 | !.vscode/launch.json 34 | !.vscode/extensions.json -------------------------------------------------------------------------------- /packages/node/.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true, 3 | "trailingComma": "all" 4 | } 5 | -------------------------------------------------------------------------------- /packages/node/.trigger: -------------------------------------------------------------------------------- 1 | 0.8.1 2 | -------------------------------------------------------------------------------- /packages/node/bin/run: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | require('../dist/main.js') 4 | 5 | -------------------------------------------------------------------------------- /packages/node/bin/run.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | node "%~dp0\run" %* 4 | -------------------------------------------------------------------------------- /packages/node/docker/cockroach-db/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.5' 2 | 3 | services: 4 | crdb: 5 | image: cockroachdb/cockroach:latest-v22.1 6 | ports: 7 | - '26257:26257' 8 | - '8080:8080' 9 | command: start-single-node --insecure 10 | volumes: 11 | - '${PWD}/cockroach-data/crdb:/cockroach/cockroach-data' 12 | -------------------------------------------------------------------------------- /packages/node/docker/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3' 2 | 3 | services: 4 | postgres: 5 | build: 6 | context: . 7 | dockerfile: pg-Dockerfile 8 | ports: 9 | - 5432:5432 10 | volumes: 11 | - .data/postgres:/var/lib/postgresql/data 12 | environment: 13 | POSTGRES_PASSWORD: postgres 14 | -------------------------------------------------------------------------------- /packages/node/docker/load-extensions.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" < => forceClean(ForceCleanModule); 8 | -------------------------------------------------------------------------------- /packages/node/src/subcommands/forceClean.module.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import { Module } from '@nestjs/common'; 5 | import { DbModule, ForceCleanFeatureModule } from '@subql/node-core'; 6 | import { ConfigureModule } from '../configure/configure.module'; 7 | 8 | @Module({ 9 | imports: [ 10 | DbModule.forRoot(), 11 | ConfigureModule.register(), 12 | ForceCleanFeatureModule, 13 | ], 14 | controllers: [], 15 | }) 16 | export class ForceCleanModule {} 17 | -------------------------------------------------------------------------------- /packages/node/src/subcommands/reindex.init.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import { Module } from '@nestjs/common'; 5 | import { EventEmitterModule } from '@nestjs/event-emitter'; 6 | import { reindexInit as baseReindexInit, DbModule } from '@subql/node-core'; 7 | import { ConfigureModule } from '../configure/configure.module'; 8 | import { ReindexFeatureModule } from './reindex.module'; 9 | 10 | @Module({ 11 | imports: [ 12 | DbModule.forRoot(), 13 | ConfigureModule.register(), 14 | ReindexFeatureModule, 15 | EventEmitterModule.forRoot(), 16 | ], 17 | controllers: [], 18 | }) 19 | export class ReindexModule {} 20 | 21 | export const reindexInit = (targetHeight: number): Promise => 22 | baseReindexInit(ReindexModule, targetHeight); 23 | -------------------------------------------------------------------------------- /packages/node/src/subcommands/testing.init.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import { exitWithError, getLogger } from '@subql/node-core'; 5 | import { ConfigureModule } from '../configure/configure.module'; 6 | import { TestingService } from './testing.service'; 7 | 8 | const logger = getLogger('Testing'); 9 | export async function testingInit(): Promise { 10 | try { 11 | const { nodeConfig, project } = await ConfigureModule.getInstance(); 12 | 13 | const testingService = new TestingService(nodeConfig, project); 14 | await testingService.run(); 15 | } catch (e) { 16 | exitWithError(new Error('Testing failed', { cause: e }), logger); 17 | } 18 | process.exit(0); 19 | } 20 | -------------------------------------------------------------------------------- /packages/node/test/jest-e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "moduleFileExtensions": ["js", "json", "ts"], 3 | "rootDir": ".", 4 | "testEnvironment": "node", 5 | "testRegex": ".e2e-spec.ts$", 6 | "transform": { 7 | "^.+\\.(t|j)s$": "ts-jest" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /packages/node/test/projectFixture/bad.json: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/subquery/subql/48a1cb1eb53be29cc2928f4513bb9268c37092bb/packages/node/test/projectFixture/bad.json -------------------------------------------------------------------------------- /packages/node/test/projectFixture/template-v1.0.0/distMock/chaintypes.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | exports.default = { typesBundle: {} }; 4 | -------------------------------------------------------------------------------- /packages/node/test/projectFixture/template-v1.0.0/distMock/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | Object.defineProperty(exports, '__esModule', { value: true }); 3 | const tslib_1 = require('tslib'); 4 | //Exports all handler functions 5 | require('@polkadot/api-augment'); 6 | (0, tslib_1.__exportStar)(require('./mappings/mappingHandlers'), exports); 7 | -------------------------------------------------------------------------------- /packages/node/test/projectFixture/template-v1.0.0/js/test1/project.yaml: -------------------------------------------------------------------------------- 1 | # project.yaml 2 | specVersion: '0.2.0' 3 | 4 | name: '' 5 | version: '0.0.0' 6 | description: '' 7 | repository: 'https://github.com/subquery/subql-starter' 8 | 9 | schema: 10 | file: ./schema.graphql 11 | 12 | network: 13 | genesisHash: '0x' 14 | endpoint: 'wss://polkadot.api.onfinality.io/public-ws' 15 | chaintypes: 16 | file: ./types.js 17 | 18 | dataSources: 19 | - kind: substrate/Runtime 20 | startBlock: 1 21 | mapping: 22 | file: dist/index.js 23 | handlers: 24 | - handler: handleBlock 25 | kind: substrate/BlockHandler 26 | - handler: handleEvent 27 | kind: substrate/EventHandler 28 | filter: #Filter is optional 29 | module: balances 30 | method: Deposit 31 | - handler: handleCall 32 | kind: substrate/CallHandler 33 | -------------------------------------------------------------------------------- /packages/node/test/projectFixture/template-v1.0.0/js/test2/project.yaml: -------------------------------------------------------------------------------- 1 | # project.yaml 2 | specVersion: '0.2.0' 3 | 4 | name: '' 5 | version: '0.0.0' 6 | description: '' 7 | repository: 'https://github.com/subquery/subql-starter' 8 | 9 | schema: 10 | file: ./schema.graphql 11 | 12 | network: 13 | genesisHash: '0x' 14 | endpoint: 'wss://polkadot.api.onfinality.io/public-ws' 15 | chaintypes: 16 | file: ./types.js 17 | 18 | dataSources: 19 | - kind: substrate/Runtime 20 | startBlock: 1 21 | mapping: 22 | file: dist/index.js 23 | handlers: 24 | - handler: handleBlock 25 | kind: substrate/BlockHandler 26 | - handler: handleEvent 27 | kind: substrate/EventHandler 28 | filter: #Filter is optional 29 | module: balances 30 | method: Deposit 31 | - handler: handleCall 32 | kind: substrate/CallHandler 33 | -------------------------------------------------------------------------------- /packages/node/test/projectFixture/template-v1.0.0/js/test3/project.yaml: -------------------------------------------------------------------------------- 1 | # project.yaml 2 | specVersion: '0.2.0' 3 | 4 | name: '' 5 | version: '0.0.0' 6 | description: '' 7 | repository: 'https://github.com/subquery/subql-starter' 8 | 9 | schema: 10 | file: ./schema.graphql 11 | 12 | network: 13 | genesisHash: '0x' 14 | endpoint: 'wss://polkadot.api.onfinality.io/public-ws' 15 | chaintypes: 16 | file: ./types.js 17 | 18 | dataSources: 19 | - kind: substrate/Runtime 20 | startBlock: 1 21 | mapping: 22 | file: dist/index.js 23 | handlers: 24 | - handler: handleBlock 25 | kind: substrate/BlockHandler 26 | - handler: handleEvent 27 | kind: substrate/EventHandler 28 | filter: #Filter is optional 29 | module: balances 30 | method: Deposit 31 | - handler: handleCall 32 | kind: substrate/CallHandler 33 | -------------------------------------------------------------------------------- /packages/node/test/projectFixture/template-v1.0.0/js/test4/project.yaml: -------------------------------------------------------------------------------- 1 | # project.yaml 2 | specVersion: '0.2.0' 3 | 4 | name: '' 5 | version: '0.0.0' 6 | description: '' 7 | repository: 'https://github.com/subquery/subql-starter' 8 | 9 | schema: 10 | file: ./schema.graphql 11 | 12 | network: 13 | genesisHash: '0x' 14 | endpoint: 'wss://polkadot.api.onfinality.io/public-ws' 15 | chaintypes: 16 | file: ./types.js 17 | 18 | dataSources: 19 | - kind: substrate/Runtime 20 | startBlock: 1 21 | mapping: 22 | file: dist/index.js 23 | handlers: 24 | - handler: handleBlock 25 | kind: substrate/BlockHandler 26 | - handler: handleEvent 27 | kind: substrate/EventHandler 28 | filter: #Filter is optional 29 | module: balances 30 | method: Deposit 31 | - handler: handleCall 32 | kind: substrate/CallHandler 33 | -------------------------------------------------------------------------------- /packages/node/test/projectFixture/template-v1.0.0/schema.graphql: -------------------------------------------------------------------------------- 1 | type StarterEntity @entity { 2 | id: ID! #id is a required field 3 | field1: Int! 4 | 5 | field2: String #filed2 is an optional field 6 | field3: BigInt 7 | 8 | field4: Date 9 | 10 | field5: Boolean 11 | } 12 | -------------------------------------------------------------------------------- /packages/node/test/projectFixture/template-v1.0.0/types.yaml: -------------------------------------------------------------------------------- 1 | types: 2 | TestType: u32 3 | typesAlias: 4 | Alias: 5 | TestType2: test 6 | typesBundle: 7 | spec: 8 | '2312': 9 | types: 10 | - minmax: 11 | - 232 12 | - 122 13 | types: 14 | TestType3: test3 15 | chain: 16 | mockchain: 17 | types: 18 | - minmax: 19 | - 232 20 | - 122 21 | types: 22 | TestType4: test4 23 | typesChain: 24 | chain2: 25 | TestType5: test 26 | typesSpec: 27 | spec3: 28 | TestType6: test 29 | -------------------------------------------------------------------------------- /packages/node/test/projectFixture/v1.0.0/distMock/chaintypes.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | exports.default = { typesBundle: {} }; 4 | -------------------------------------------------------------------------------- /packages/node/test/projectFixture/v1.0.0/distMock/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | Object.defineProperty(exports, '__esModule', { value: true }); 3 | const tslib_1 = require('tslib'); 4 | //Exports all handler functions 5 | require('@polkadot/api-augment'); 6 | (0, tslib_1.__exportStar)(require('./mappings/mappingHandlers'), exports); 7 | -------------------------------------------------------------------------------- /packages/node/test/projectFixture/v1.0.0/js/test1/project.yaml: -------------------------------------------------------------------------------- 1 | # project.yaml 2 | specVersion: '0.2.0' 3 | 4 | name: '' 5 | version: '0.0.0' 6 | description: '' 7 | repository: 'https://github.com/subquery/subql-starter' 8 | 9 | schema: 10 | file: ./schema.graphql 11 | 12 | network: 13 | genesisHash: '0x' 14 | endpoint: 'wss://polkadot.api.onfinality.io/public-ws' 15 | chaintypes: 16 | file: ./types.js 17 | 18 | dataSources: 19 | - kind: substrate/Runtime 20 | startBlock: 1 21 | mapping: 22 | file: dist/index.js 23 | handlers: 24 | - handler: handleBlock 25 | kind: substrate/BlockHandler 26 | - handler: handleEvent 27 | kind: substrate/EventHandler 28 | filter: #Filter is optional 29 | module: balances 30 | method: Deposit 31 | - handler: handleCall 32 | kind: substrate/CallHandler 33 | -------------------------------------------------------------------------------- /packages/node/test/projectFixture/v1.0.0/js/test2/project.yaml: -------------------------------------------------------------------------------- 1 | # project.yaml 2 | specVersion: '0.2.0' 3 | 4 | name: '' 5 | version: '0.0.0' 6 | description: '' 7 | repository: 'https://github.com/subquery/subql-starter' 8 | 9 | schema: 10 | file: ./schema.graphql 11 | 12 | network: 13 | genesisHash: '0x' 14 | endpoint: 'wss://polkadot.api.onfinality.io/public-ws' 15 | chaintypes: 16 | file: ./types.js 17 | 18 | dataSources: 19 | - kind: substrate/Runtime 20 | startBlock: 1 21 | mapping: 22 | file: dist/index.js 23 | handlers: 24 | - handler: handleBlock 25 | kind: substrate/BlockHandler 26 | - handler: handleEvent 27 | kind: substrate/EventHandler 28 | filter: #Filter is optional 29 | module: balances 30 | method: Deposit 31 | - handler: handleCall 32 | kind: substrate/CallHandler 33 | -------------------------------------------------------------------------------- /packages/node/test/projectFixture/v1.0.0/js/test3/project.yaml: -------------------------------------------------------------------------------- 1 | # project.yaml 2 | specVersion: '0.2.0' 3 | 4 | name: '' 5 | version: '0.0.0' 6 | description: '' 7 | repository: 'https://github.com/subquery/subql-starter' 8 | 9 | schema: 10 | file: ./schema.graphql 11 | 12 | network: 13 | genesisHash: '0x' 14 | endpoint: 'wss://polkadot.api.onfinality.io/public-ws' 15 | chaintypes: 16 | file: ./types.js 17 | 18 | dataSources: 19 | - kind: substrate/Runtime 20 | startBlock: 1 21 | mapping: 22 | file: dist/index.js 23 | handlers: 24 | - handler: handleBlock 25 | kind: substrate/BlockHandler 26 | - handler: handleEvent 27 | kind: substrate/EventHandler 28 | filter: #Filter is optional 29 | module: balances 30 | method: Deposit 31 | - handler: handleCall 32 | kind: substrate/CallHandler 33 | -------------------------------------------------------------------------------- /packages/node/test/projectFixture/v1.0.0/js/test4/project.yaml: -------------------------------------------------------------------------------- 1 | # project.yaml 2 | specVersion: '0.2.0' 3 | 4 | name: '' 5 | version: '0.0.0' 6 | description: '' 7 | repository: 'https://github.com/subquery/subql-starter' 8 | 9 | schema: 10 | file: ./schema.graphql 11 | 12 | network: 13 | genesisHash: '0x' 14 | endpoint: 'wss://polkadot.api.onfinality.io/public-ws' 15 | chaintypes: 16 | file: ./types.js 17 | 18 | dataSources: 19 | - kind: substrate/Runtime 20 | startBlock: 1 21 | mapping: 22 | file: dist/index.js 23 | handlers: 24 | - handler: handleBlock 25 | kind: substrate/BlockHandler 26 | - handler: handleEvent 27 | kind: substrate/EventHandler 28 | filter: #Filter is optional 29 | module: balances 30 | method: Deposit 31 | - handler: handleCall 32 | kind: substrate/CallHandler 33 | -------------------------------------------------------------------------------- /packages/node/test/projectFixture/v1.0.0/schema.graphql: -------------------------------------------------------------------------------- 1 | type StarterEntity @entity { 2 | id: ID! #id is a required field 3 | field1: Int! 4 | 5 | field2: String #filed2 is an optional field 6 | field3: BigInt 7 | 8 | field4: Date 9 | 10 | field5: Boolean 11 | } 12 | -------------------------------------------------------------------------------- /packages/node/test/projectFixture/v1.0.0/types.yaml: -------------------------------------------------------------------------------- 1 | types: 2 | TestType: u32 3 | typesAlias: 4 | Alias: 5 | TestType2: test 6 | typesBundle: 7 | spec: 8 | '2312': 9 | types: 10 | - minmax: 11 | - 232 12 | - 122 13 | types: 14 | TestType3: test3 15 | chain: 16 | mockchain: 17 | types: 18 | - minmax: 19 | - 232 20 | - 122 21 | types: 22 | TestType4: test4 23 | typesChain: 24 | chain2: 25 | TestType5: test 26 | typesSpec: 27 | spec3: 28 | TestType6: test 29 | -------------------------------------------------------------------------------- /packages/node/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "exclude": ["node_modules", "test", "dist", "**/*spec.ts"] 4 | } 5 | -------------------------------------------------------------------------------- /packages/node/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "sourceMap": true, 5 | "tsBuildInfoFile": "dist/.tsbuildinfo", 6 | "rootDir": "src", 7 | "outDir": "./dist", 8 | "noImplicitAny": true 9 | }, 10 | "references": [ 11 | { "path": "../common" }, 12 | { "path": "../common-substrate" }, 13 | { "path": "../node-core" }, 14 | { "path": "../types-core" }, 15 | { "path": "../types" }, 16 | { "path": "../utils" }, 17 | { "path": "../testing" } 18 | ], 19 | "include": ["src/**/*"], 20 | "exclude": ["node_modules", "test", "dist"] 21 | } 22 | -------------------------------------------------------------------------------- /packages/query/.env.example: -------------------------------------------------------------------------------- 1 | DB_USER=postgres 2 | DB_PASS=postgres 3 | DB_DATABASE=postgres 4 | DB_HOST=localhost 5 | DB_PORT=5432 6 | PORT=3001 7 | -------------------------------------------------------------------------------- /packages/query/.gitignore: -------------------------------------------------------------------------------- 1 | # compiled output 2 | /dist 3 | /node_modules 4 | 5 | # Logs 6 | logs 7 | *.log 8 | npm-debug.log* 9 | yarn-debug.log* 10 | yarn-error.log* 11 | lerna-debug.log* 12 | 13 | # OS 14 | .DS_Store 15 | 16 | # Tests 17 | /coverage 18 | /.nyc_output 19 | 20 | # IDEs and editors 21 | /.idea 22 | .project 23 | .classpath 24 | .c9/ 25 | *.launch 26 | .settings/ 27 | *.sublime-workspace 28 | 29 | # IDE - VSCode 30 | .vscode/* 31 | !.vscode/settings.json 32 | !.vscode/tasks.json 33 | !.vscode/launch.json 34 | !.vscode/extensions.json 35 | 36 | .env 37 | -------------------------------------------------------------------------------- /packages/query/README.md: -------------------------------------------------------------------------------- 1 | # @subql/query 2 | 3 | ## Run this package 4 | 5 | To quickly setup the project, add a `.env` file in the `subql/packages/query` folder with the following content: 6 | 7 | ```env 8 | DB_HOST=localhost 9 | DB_PORT=5432 10 | DB_USER=postgres 11 | DB_PASS=postgres 12 | DB_DATABASE=postgres 13 | ``` 14 | 15 | then run the following command 16 | 17 | ```sh 18 | NODE_OPTIONS="-r dotenv/config" yarn start:dev -- --name --playground 19 | ``` 20 | -------------------------------------------------------------------------------- /packages/query/bin/run: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | require('../dist/main.js') 4 | 5 | -------------------------------------------------------------------------------- /packages/query/bin/run.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | node "%~dp0\run" %* 4 | -------------------------------------------------------------------------------- /packages/query/nest-cli.json: -------------------------------------------------------------------------------- 1 | { 2 | "collection": "@nestjs/schematics", 3 | "sourceRoot": "src" 4 | } 5 | -------------------------------------------------------------------------------- /packages/query/nodemon.json: -------------------------------------------------------------------------------- 1 | { 2 | "watch": ["src"], 3 | "ext": "ts", 4 | "ignore": ["src/**/*.spec.ts"], 5 | "exec": "node -r dotenv/config -r tsconfig-paths/register -r ts-node/register src/main.ts" 6 | } 7 | -------------------------------------------------------------------------------- /packages/query/src/app.module.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import {Module} from '@nestjs/common'; 5 | import {ConfigureModule} from './configure/configure.module'; 6 | import {GraphqlModule} from './graphql/graphql.module'; 7 | 8 | @Module({ 9 | imports: [ConfigureModule.register(), GraphqlModule], 10 | controllers: [], 11 | }) 12 | export class AppModule {} 13 | -------------------------------------------------------------------------------- /packages/query/src/configure/config.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import {get} from 'lodash'; 5 | 6 | export class Config { 7 | constructor(private readonly store: Record) {} 8 | 9 | get(key: string, defaultValue?: T): T | undefined { 10 | return (process.env[key.toUpperCase()] as unknown as T) ?? get(this.store, key, defaultValue); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /packages/query/src/configure/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './config'; 5 | -------------------------------------------------------------------------------- /packages/query/src/graphql/plugins/historical/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import {PgBlockHeightPlugin} from './PgBlockHeightPlugin'; 5 | import PgConnectionArgFilterBackwardRelationsPlugin from './PgConnectionArgFilterBackwardRelationsPlugin'; 6 | import PgConnectionArgFilterForwardRelationsPlugin from './PgConnectionArgFilterForwardRelationsPlugin'; 7 | 8 | const historicalPlugins = [ 9 | PgBlockHeightPlugin, // This must be before the other plugins to ensure the context is set 10 | PgConnectionArgFilterBackwardRelationsPlugin, 11 | PgConnectionArgFilterForwardRelationsPlugin, 12 | ]; 13 | 14 | export default historicalPlugins; 15 | -------------------------------------------------------------------------------- /packages/query/tsconfig.build.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "exclude": ["node_modules", "test", "dist", "**/*spec.ts"] 4 | } 5 | -------------------------------------------------------------------------------- /packages/query/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "target": "es2017", 5 | "sourceMap": true, 6 | "tsBuildInfoFile": "dist/.tsbuildinfo", 7 | "rootDir": "src", 8 | "outDir": "./dist" 9 | }, 10 | "references": [{"path": "../common"}, {"path": "../types"}, {"path": "../utils"}], 11 | "include": ["src/**/*"] 12 | } 13 | -------------------------------------------------------------------------------- /packages/testing/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@subql/testing", 3 | "version": "2.2.4", 4 | "scripts": { 5 | "test": "echo \"Error: no test specified\" && exit 1", 6 | "build": "rm -rf dist && tsc -b", 7 | "changelog:release": "echo \"Updating changelog $npm_package_version\" && npx chan release $npm_package_version --git-url \"https://github.com/subquery/subql\" --release-prefix=\"testing/\"" 8 | }, 9 | "main": "dist/index.js", 10 | "license": "GPL-3.0", 11 | "files": [ 12 | "/dist" 13 | ], 14 | "packageManager": "yarn@3.1.1", 15 | "dependencies": { 16 | "@subql/types-core": "workspace:^" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /packages/testing/src/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './interfaces'; 5 | 6 | import {CompatEntity} from '@subql/types-core'; 7 | 8 | // Register test functions to a global array 9 | export function subqlTest = CompatEntity>( 10 | name: string, 11 | blockHeight: number, 12 | dependentEntities: E[], 13 | expectedEntities: E[], 14 | handler: string 15 | ): void { 16 | (global as any).subqlTests = (global as any).subqlTests ?? []; 17 | 18 | (global as any).subqlTests.push({ 19 | name, 20 | blockHeight, 21 | dependentEntities, 22 | expectedEntities, 23 | handler, 24 | }); 25 | } 26 | -------------------------------------------------------------------------------- /packages/testing/src/interfaces.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import {Entity} from '@subql/types-core'; 5 | 6 | export type HandlerFunction = (input: T) => Promise; 7 | 8 | export type SubqlTest = { 9 | name: string; 10 | blockHeight: number; 11 | dependentEntities: Entity[]; 12 | expectedEntities: Entity[]; 13 | handler: string; 14 | }; 15 | -------------------------------------------------------------------------------- /packages/testing/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "tsBuildInfoFile": "dist/.tsbuildinfo", 5 | "rootDir": "src", 6 | "outDir": "dist", 7 | "noImplicitAny": true 8 | }, 9 | "include": ["src/**/*"], 10 | "references": [{"path": "../common"}, {"path": "../common-substrate"}] 11 | } 12 | -------------------------------------------------------------------------------- /packages/types-core/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@subql/types-core", 3 | "version": "2.0.2", 4 | "description": "", 5 | "homepage": "https://github.com/subquery/subql", 6 | "repository": "github:subquery/subql", 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1", 9 | "build": "rm -rf dist && tsc -b", 10 | "changelog:release": "echo \"Updating changelog $npm_package_version\" && npx chan release $npm_package_version --git-url \"https://github.com/subquery/subql\" --release-prefix=\"types-core/\"" 11 | }, 12 | "author": "Ian He", 13 | "main": "dist/index.js", 14 | "license": "GPL-3.0", 15 | "files": [ 16 | "/dist" 17 | ], 18 | "devDependencies": { 19 | "package-json-type": "^1.0.3" 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /packages/types-core/src/global.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import Pino from 'pino'; 5 | import {Cache, DynamicDatasourceCreator} from './interfaces'; 6 | import {Store} from './store'; 7 | 8 | // base global 9 | declare global { 10 | const logger: Pino.Logger; 11 | const store: Store; 12 | const cache: Cache; 13 | const chainId: string; 14 | const createDynamicDatasource: DynamicDatasourceCreator; 15 | } 16 | -------------------------------------------------------------------------------- /packages/types-core/src/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './interfaces'; 5 | export * from './project'; 6 | export * from './store'; 7 | export * from './multichain'; 8 | -------------------------------------------------------------------------------- /packages/types-core/src/interfaces.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export type DynamicDatasourceCreator = (name: string, args: Record) => Promise; 5 | 6 | export interface Cache = Record> { 7 | set(key: keyof T, value: T[keyof T]): Promise; 8 | get(key: keyof T): Promise; 9 | } 10 | -------------------------------------------------------------------------------- /packages/types-core/src/multichain/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './types'; 5 | -------------------------------------------------------------------------------- /packages/types-core/src/multichain/types.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import {QuerySpec} from '../project'; 5 | 6 | export interface MultichainProjectManifest { 7 | specVersion: string; 8 | projects: string[]; 9 | query: QuerySpec; 10 | } 11 | -------------------------------------------------------------------------------- /packages/types-core/src/project/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './types'; 5 | export * from './versioned'; 6 | export * from './readers'; 7 | export * from './datasourceProcessors'; 8 | export * from './modulars'; 9 | -------------------------------------------------------------------------------- /packages/types-core/src/project/modulars/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './types'; 5 | -------------------------------------------------------------------------------- /packages/types-core/src/project/modulars/types.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import {BaseCustomDataSource, BaseDataSource, IProjectManifest, ProjectManifestBaseImplInterface} from '../index'; 5 | 6 | export interface INetworkCommonModule< 7 | D extends BaseCustomDataSource | BaseDataSource = BaseDataSource, 8 | RDS extends D = D, 9 | CDS extends D = D, 10 | > { 11 | parseProjectManifest(raw: unknown): IProjectManifest & { 12 | // other missing interfaces ProjectManifestVersioned 13 | asImpl: ProjectManifestBaseImplInterface; 14 | }; 15 | isRuntimeDs(ds: D): ds is RDS; 16 | isCustomDs(ds: D): ds is CDS; 17 | } 18 | -------------------------------------------------------------------------------- /packages/types-core/src/project/readers/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './reader'; 5 | -------------------------------------------------------------------------------- /packages/types-core/src/project/readers/reader.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import type {IPackageJson} from 'package-json-type'; 5 | 6 | export type ReaderOptions = { 7 | ipfs?: string; 8 | }; 9 | 10 | export interface Reader { 11 | getProjectSchema(): Promise; 12 | getPkg(): Promise; 13 | getFile(file: string): Promise; 14 | root: string | undefined; 15 | } 16 | -------------------------------------------------------------------------------- /packages/types-core/src/project/versioned/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './base'; 5 | export * from './v1_0_0'; 6 | -------------------------------------------------------------------------------- /packages/types-core/src/project/versioned/v1_0_0/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './types'; 5 | -------------------------------------------------------------------------------- /packages/types-core/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "strictNullChecks": true, 5 | "tsBuildInfoFile": "dist/.tsbuildinfo", 6 | "rootDir": "src", 7 | "outDir": "dist", 8 | "noImplicitAny": true 9 | }, 10 | "include": ["src/**/*"] 11 | } 12 | -------------------------------------------------------------------------------- /packages/types/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@subql/types", 3 | "version": "3.12.2", 4 | "description": "", 5 | "homepage": "https://github.com/subquery/subql", 6 | "repository": "github:subquery/subql", 7 | "scripts": { 8 | "test": "echo \"Error: no test specified\" && exit 1", 9 | "build": "rm -rf dist && tsc -b", 10 | "changelog:release": "echo \"Updating changelog $npm_package_version\" && npx chan release $npm_package_version --git-url \"https://github.com/subquery/subql\" --release-prefix=\"types/\"" 11 | }, 12 | "author": "Ian He", 13 | "main": "dist/index.js", 14 | "license": "GPL-3.0", 15 | "files": [ 16 | "src/global.d.ts", 17 | "/dist" 18 | ], 19 | "dependencies": { 20 | "@subql/types-core": "workspace:*" 21 | }, 22 | "peerDependencies": { 23 | "@polkadot/api": "^15" 24 | }, 25 | "devDependencies": { 26 | "@polkadot/api": "^15.9.2" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /packages/types/src/global.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import {ApiPromise} from '@polkadot/api'; 5 | import {ApiDecoration} from '@polkadot/api/types'; 6 | 7 | import '@subql/types-core/dist/global'; 8 | 9 | type ApiAt = ApiDecoration<'promise'> & {rpc: ApiPromise['rpc']}; 10 | 11 | declare global { 12 | const api: ApiAt; 13 | const unsafeApi: ApiPromise | undefined; 14 | } 15 | -------------------------------------------------------------------------------- /packages/types/src/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './interfaces'; 5 | export * from './project'; 6 | -------------------------------------------------------------------------------- /packages/types/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "strictNullChecks": true, 5 | "tsBuildInfoFile": "dist/.tsbuildinfo", 6 | "rootDir": "src", 7 | "outDir": "dist", 8 | "noImplicitAny": true 9 | }, 10 | "references": [{"path": "../types-core"}], 11 | "include": ["src/**/*"] 12 | } 13 | -------------------------------------------------------------------------------- /packages/utils/README.md: -------------------------------------------------------------------------------- 1 | # manifest-spec 2 | -------------------------------------------------------------------------------- /packages/utils/src/array/array.spec.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import {findDuplicateStringArray} from './array'; 5 | 6 | describe('Array util', () => { 7 | it('findDuplicateStringArray', () => { 8 | const arrays = [ 9 | ['1', '2', '3'], 10 | ['3', '1', '2'], 11 | ['apple', 'banana', 'orange'], 12 | ['orange', 'apple', 'banana'], 13 | ['grape', 'melon', 'kiwi'], //this is unique 14 | ]; 15 | expect(findDuplicateStringArray(arrays)).toStrictEqual([ 16 | ['1', '2', '3'], 17 | ['apple', 'banana', 'orange'], 18 | ]); 19 | }); 20 | }); 21 | -------------------------------------------------------------------------------- /packages/utils/src/array/array.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import {uniqWith, isEqual} from 'lodash'; 5 | 6 | // Find duplicate string array in arrays 7 | // Only sorted unique string array will be return 8 | export function findDuplicateStringArray(arrays: string[][]): string[][] { 9 | const sortedArrays = arrays.map((arr) => arr.sort().join('')); 10 | const duplicateArray: string[][] = []; 11 | for (let i = 0; i < sortedArrays.length; i++) { 12 | if (sortedArrays.indexOf(sortedArrays[i]) !== sortedArrays.lastIndexOf(sortedArrays[i])) { 13 | duplicateArray.push(arrays[i]); 14 | } 15 | } 16 | return uniqWith(duplicateArray, isEqual); 17 | } 18 | -------------------------------------------------------------------------------- /packages/utils/src/array/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './array'; 5 | -------------------------------------------------------------------------------- /packages/utils/src/buffer/buffer.spec.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import {hexStripZeros, numberToHex} from './buffer'; 5 | 6 | it('in getData, should hex number correctly', () => { 7 | const from = 10000; 8 | const to = 9999999; 9 | const to54897704 = 54897704; 10 | const zero = 0; 11 | 12 | // Use ethers.utils should have same output 13 | // expect(utils.hexValue(from)).toBe(numberToHex(from)) 14 | // expect(utils.hexValue(to54897704)).toBe(hexStripZeros(numberToHex(to54897704))) 15 | expect(hexStripZeros(numberToHex(zero))).toBe('0x0'); 16 | expect(hexStripZeros(numberToHex(from))).toBe('0x2710'); 17 | expect(hexStripZeros(numberToHex(to))).toBe('0x98967f'); 18 | expect(hexStripZeros(numberToHex(to54897704))).toBe('0x345ac28'); 19 | }); 20 | -------------------------------------------------------------------------------- /packages/utils/src/buffer/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './buffer'; 5 | -------------------------------------------------------------------------------- /packages/utils/src/graphql/constant.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export enum DirectiveName { 5 | DerivedFrom = 'derivedFrom', 6 | Entity = 'entity', 7 | JsonField = 'jsonField', 8 | FullText = 'fullText', 9 | } 10 | -------------------------------------------------------------------------------- /packages/utils/src/graphql/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './entities'; 5 | export * from './schema'; 6 | export * from './types'; 7 | export * from './builder'; 8 | -------------------------------------------------------------------------------- /packages/utils/src/graphql/schema/directives.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import gql from 'graphql-tag'; 5 | 6 | export const directives = gql` 7 | directive @derivedFrom(field: String!) on FIELD_DEFINITION 8 | directive @entity on OBJECT 9 | directive @jsonField(indexed: Boolean) on OBJECT 10 | directive @index(unique: Boolean) on FIELD_DEFINITION 11 | directive @compositeIndexes(fields: [[String]]!) on OBJECT 12 | directive @fullText(fields: [String!], language: String) on OBJECT 13 | directive @dbType(type: String!) on FIELD_DEFINITION 14 | `; 15 | -------------------------------------------------------------------------------- /packages/utils/src/graphql/schema/scalas.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import gql from 'graphql-tag'; 5 | 6 | export const scalas = gql` 7 | scalar BigInt 8 | scalar BigDecimal 9 | scalar Date 10 | scalar Bytes 11 | scalar Float 12 | `; 13 | -------------------------------------------------------------------------------- /packages/utils/src/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './graphql'; 5 | export {levelFilter, Logger, LoggerOption} from './logger'; 6 | export * from './query'; 7 | export * from './types'; 8 | export * from './buffer'; 9 | export * from './networking'; 10 | -------------------------------------------------------------------------------- /packages/utils/src/logger/colors.spec.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import {colorizeLevel} from './colors'; 5 | 6 | describe('LoggerColorLevel', () => { 7 | it('returns default for an unsupported level number', () => { 8 | const level = colorizeLevel(5); 9 | expect(level).toBe('\x1b[37mUSERLVL\x1b[39m'); 10 | }); 11 | 12 | it('returns the correct level for a level number', () => { 13 | const level = colorizeLevel(60); 14 | expect(level).toBe('\x1b[41mFATAL\x1b[49m'); 15 | }); 16 | }); 17 | -------------------------------------------------------------------------------- /packages/utils/src/logger/constants.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export const LEVELS = { 5 | default: 'USERLVL', 6 | 60: 'FATAL', 7 | 50: 'ERROR', 8 | 40: 'WARN', 9 | 30: 'INFO', 10 | 20: 'DEBUG', 11 | 10: 'TRACE', 12 | }; 13 | 14 | export const LEVELS_MAP = { 15 | trace: 10, 16 | debug: 20, 17 | info: 30, 18 | warn: 40, 19 | error: 50, 20 | fatal: 60, 21 | silent: 999, 22 | }; 23 | -------------------------------------------------------------------------------- /packages/utils/src/logger/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './logger'; 5 | export * from './util'; 6 | -------------------------------------------------------------------------------- /packages/utils/src/logger/util.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import {LevelWithSilent} from 'pino'; 5 | import {LEVELS_MAP} from './constants'; 6 | 7 | export function levelFilter(test: LevelWithSilent, target: LevelWithSilent): boolean { 8 | return LEVELS_MAP[test?.toLowerCase()] >= LEVELS_MAP[target.toLowerCase()]; 9 | } 10 | -------------------------------------------------------------------------------- /packages/utils/src/networking.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import detectPort from 'detect-port'; 5 | 6 | export async function findAvailablePort(startPort: number, range = 10): Promise { 7 | for (let port = startPort; port <= startPort + range; port++) { 8 | try { 9 | const _port = await detectPort(port); 10 | if (_port === port) { 11 | return port; 12 | } 13 | } catch (e) { 14 | return null; 15 | } 16 | } 17 | 18 | return null; 19 | } 20 | -------------------------------------------------------------------------------- /packages/utils/src/query/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './types'; 5 | export * from './metadata'; 6 | -------------------------------------------------------------------------------- /packages/utils/src/query/types.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export type TableEstimate = { 5 | table: string; 6 | estimate: number; 7 | }; 8 | 9 | export type MetaData = { 10 | lastProcessedHeight: number; 11 | lastProcessedBlockTimestamp: number; 12 | lastProcessedTimestamp: number; 13 | targetHeight: number; 14 | chain: string; 15 | specName: string; 16 | genesisHash: string; 17 | indexerHealthy: boolean; 18 | indexerNodeVersion: string; 19 | queryNodeVersion: string; 20 | startHeight?: number; 21 | rowCountEstimate: TableEstimate[]; 22 | deployments: Record; 23 | historicalStateEnabled: boolean | 'height' | 'timestamp'; 24 | }; 25 | -------------------------------------------------------------------------------- /packages/utils/src/types/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './generalTypes'; 5 | 6 | export * from './TypeClass'; 7 | 8 | export * from './supported'; 9 | -------------------------------------------------------------------------------- /packages/utils/src/types/supported/BigInt.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import BN from 'bn.js'; 5 | import {TypeClass} from '../TypeClass'; 6 | 7 | export const BigInt = new TypeClass( 8 | 'BigInt', 9 | (data: bigint | string): Uint8Array => { 10 | return new BN(data.toString()).toBuffer(); 11 | }, 12 | 'bigint', 13 | 'BigInt', 14 | 'numeric' 15 | ); 16 | -------------------------------------------------------------------------------- /packages/utils/src/types/supported/Boolean.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import {numberToU8a} from '@polkadot/util'; 5 | import {TypeClass} from '../TypeClass'; 6 | 7 | export const Boolean = new TypeClass( 8 | 'Boolean', 9 | (data: boolean): Uint8Array => { 10 | return numberToU8a(data ? 1 : 0); 11 | }, 12 | 'boolean', 13 | 'Boolean', 14 | 'boolean' 15 | ); 16 | -------------------------------------------------------------------------------- /packages/utils/src/types/supported/Bytes.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import {isHex, hexToU8a} from '@polkadot/util'; 5 | import {DataTypes} from '@subql/x-sequelize'; 6 | import {TypeClass} from '../TypeClass'; 7 | 8 | export const Bytes = new TypeClass( 9 | 'Bytes', 10 | (data: string | Uint8Array): Uint8Array => { 11 | if (data instanceof Uint8Array) return data; 12 | if (isHex(data)) { 13 | return hexToU8a(data); 14 | } 15 | throw new Error(`can not hash ${data}`); 16 | }, 17 | 'string', 18 | 'Bytes', 19 | DataTypes.BLOB 20 | ); 21 | -------------------------------------------------------------------------------- /packages/utils/src/types/supported/Date.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import assert from 'assert'; 5 | import {numberToU8a} from '@polkadot/util'; 6 | import {TypeClass} from '../TypeClass'; 7 | 8 | export const DateObj = new TypeClass( 9 | 'Date', 10 | (data: Date): Uint8Array => { 11 | assert(data instanceof Date, `can not hash ${data}, expect instance of Date`); 12 | return numberToU8a(data.getTime()); 13 | }, 14 | 'Date', 15 | 'Date', 16 | 'timestamp' 17 | ); 18 | -------------------------------------------------------------------------------- /packages/utils/src/types/supported/Float.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import {DataTypes} from '@subql/x-sequelize'; 5 | import {TypeClass} from '../TypeClass'; 6 | 7 | export const Float = new TypeClass( 8 | 'Float', 9 | (data: number): Uint8Array => { 10 | //TODO, check if this is proper way to handle float 11 | return Buffer.from(data.toString()); 12 | }, 13 | 'number', 14 | 'Float', 15 | DataTypes.FLOAT 16 | ); 17 | -------------------------------------------------------------------------------- /packages/utils/src/types/supported/ID.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import {TypeClass} from '../TypeClass'; 5 | 6 | export const ID = new TypeClass( 7 | 'ID', 8 | (data: any): Uint8Array => { 9 | return Buffer.from(data); 10 | }, 11 | 'string', 12 | 'ID', 13 | 'text' 14 | ); 15 | -------------------------------------------------------------------------------- /packages/utils/src/types/supported/Int.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import {numberToU8a} from '@polkadot/util'; 5 | import {TypeClass} from '../TypeClass'; 6 | import {wrappedNumToU8a} from '../u8aUtils'; 7 | 8 | export const Int = new TypeClass( 9 | 'Int', 10 | (data: number): Uint8Array => { 11 | return wrappedNumToU8a(data); 12 | }, 13 | 'number', 14 | 'Int', 15 | 'integer' 16 | ); 17 | -------------------------------------------------------------------------------- /packages/utils/src/types/supported/String.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import {TypeClass} from '../TypeClass'; 5 | 6 | export const String = new TypeClass( 7 | 'String', 8 | (data: string): Uint8Array => { 9 | return Buffer.from(data); 10 | }, 11 | 'string', 12 | 'String', 13 | 'text' 14 | ); 15 | -------------------------------------------------------------------------------- /packages/utils/src/types/supported/index.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | export * from './BigInt'; 5 | export * from './Boolean'; 6 | export * from './Bytes'; 7 | export * from './Date'; 8 | export * from './Float'; 9 | export * from './ID'; 10 | export * from './Int'; 11 | export * from './String'; 12 | export * from './Json'; 13 | -------------------------------------------------------------------------------- /packages/utils/src/types/u8aUtils.ts: -------------------------------------------------------------------------------- 1 | // Copyright 2020-2025 SubQuery Pte Ltd authors & contributors 2 | // SPDX-License-Identifier: GPL-3.0 3 | 4 | import {numberToU8a, u8aConcat} from '@polkadot/util'; 5 | 6 | /** 7 | * Due to current polkadotjs `numberToU8a` not support negative number, 8 | * The helper method used to convert negative to a uint8Array 9 | * 10 | * @param byteArray 11 | */ 12 | 13 | export function wrappedNumToU8a(num: number) { 14 | if (num >= 0) { 15 | return numberToU8a(num); 16 | } 17 | return u8aConcat(new Uint8Array([0]), numberToU8a(Math.abs(num))); 18 | } 19 | -------------------------------------------------------------------------------- /packages/utils/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "target": "es2017", 5 | "sourceMap": true, 6 | "tsBuildInfoFile": "dist/.tsbuildinfo", 7 | "rootDir": "src", 8 | "outDir": "./dist", 9 | "noImplicitThis": true, 10 | "noImplicitAny": true 11 | }, 12 | "references": [{"path": "../types"}], 13 | "include": ["src/**/*"] 14 | } 15 | -------------------------------------------------------------------------------- /scripts/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | 4 | apk add --no-cache jq 5 | npm install -g --force yarn@latest 6 | cd "$1" 7 | 8 | # Modifies the package.json to replace "workspace:*" versions with actual versions 9 | jq -r '.dependencies | to_entries[] | select(.value == "workspace:*") | .key' package.json | while read -r dep; do 10 | directory=$(jq --arg dep "$dep" -r '.compilerOptions.paths[$dep][0]' ../../tsconfig.json | cut -d'/' -f 2) 11 | version=$(jq --arg directory "$directory" -r '.version' ../"$directory"/package.json) 12 | if [ "$version" != null ]; then 13 | jq --arg dep "$dep" --arg version "$version" -r '.dependencies[$dep] = $version' package.json > package.tmp.json && mv package.tmp.json package.json 14 | fi 15 | done 16 | 17 | yarn pack --filename app.tgz 18 | rm -rf /root/.npm /root/.cache 19 | -------------------------------------------------------------------------------- /test/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:lts-bullseye 2 | WORKDIR /workdir 3 | 4 | # Fix timezone to UTC 5 | ENV TZ=utc 6 | 7 | COPY . . 8 | RUN yarn 9 | -------------------------------------------------------------------------------- /test/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: "3" 2 | 3 | services: 4 | postgres: 5 | image: postgres:16-alpine 6 | build: 7 | context: . 8 | dockerfile: pg-Dockerfile 9 | ports: 10 | - 5432:5432 11 | environment: 12 | POSTGRES_PASSWORD: postgres 13 | 14 | test: 15 | build: 16 | context: .. 17 | dockerfile: test/Dockerfile 18 | volumes: 19 | - ../coverage:/workdir/coverage 20 | depends_on: 21 | - "postgres" 22 | environment: 23 | DB_USER: postgres 24 | DB_PASS: postgres 25 | DB_DATABASE: postgres 26 | DB_HOST: postgres 27 | DB_POST: 5432 28 | SUBQL_ACCESS_TOKEN: ${SUBQL_ACCESS_TOKEN} 29 | SUBQL_ACCESS_TOKEN_TEST: ${SUBQL_ACCESS_TOKEN_TEST} 30 | SUBQL_ORG_TEST: ${SUBQL_ORG_TEST} 31 | command: 32 | - yarn 33 | - test:all 34 | -------------------------------------------------------------------------------- /test/jest-setup.ts: -------------------------------------------------------------------------------- 1 | import 'reflect-metadata'; 2 | import 'regenerator-runtime/runtime'; 3 | 4 | // Causes the logger to be init 5 | (global as any).__TEST__ = true; 6 | -------------------------------------------------------------------------------- /test/load-extensions.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" <