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:
yarn
package 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.sh
After 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
. Thelib
directory should mirror the structure ofsrc
. - Export all TypeORM classes through
src/model/index.ts
(or thelib/model
module). - Define the database schema within
schema.graphql
. - Store database migration files in
db/migrations
as plain JavaScript files. - Configuration variables are set in the
.env
file, 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.jsonl
Generated 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 codegen
Available sqd
shortcuts:
sqd down
sqd up
sqd migration:generate
sqd migration:apply
sqd up
sqd process
Deploy command :
sqd deploy --org lastic .