This project utilizes a template from the Squid starter code to index code on the Coretime Chain, providing a streamlined process for developers.
Ensure you have the following installed before starting:
- Node.js version 16.x
- Docker
- npm (Note:
yarnpackage manager is not supported)
To install dependencies and start the project, use the following command. This script utilizes sqd, so please ensure it's installed beforehand.
npm install
npm run build
./run.shAfter execution, a GraphiQL playground will be accessible at localhost:4350/graphql.
The Squid tools adhere to specific project structures for optimal performance:
- JavaScript compilations should be placed in
lib, and TypeScript sources insrc. Thelibdirectory should mirror the structure ofsrc. - Export all TypeORM classes through
src/model/index.ts(or thelib/modelmodule). - Define the database schema within
schema.graphql. - Store database migration files in
db/migrationsas plain JavaScript files. - Configuration variables are set in the
.envfile, which is used bysquid-*executables.
For detailed information on project structure and conventions, refer to the Subsquid Documentation.
Generate specVersions:
npx substrate-metadata-explorer --rpc wss://rococo-coretime-rpc.polkadot.io --out myMetadata.jsonlGenerated specVersions Kusama:
npx substrate-metadata-explorer --rpc wss://kusama-coretime-rpc.polkadot.io --out myMetadataKusama.jsonl
Generate typegen with:
npx squid-substrate-typegen typegen.json
sqd typegen Generate from graphQl with:
sqd codegenAvailable sqd shortcuts:
sqd down
sqd up
sqd migration:generate
sqd migration:apply
sqd up
sqd processDeploy command :
sqd deploy --org lastic .