-
Run docker
NOTE: This is needed if we want to generate the migration file that is located under the folder "db". Any changes in the schema(graphql file) is only reflected after generating migration files.
If the "db" folder is missing or the empty then we have to generate it. schema.graphql content change You need to run an instance of docker to generate db file. -
Build the squid
./build
-
Compile the chain to generate .yaml file in "build" directory
# chainId can be any valid supported chainId or '*' to compile all chain yarn compile-chain chainId=[chainId] -
Deploy the squid. The deploy script looks in the build folder and deploy all the yaml file
./deploy-chain
-
Generate the DB entities from the schema
sqd codegen sqd build
-
Start local database instance and generate migrations using entities (Note: start an instance of docker)
sqd up sqd migration:generate
-
Generate typing from the ABI
sqd typegen
-
Start processing the data / Run processor
sqd process
NOTE: This bailout in local when the block reaches the final block or exceed it while processing in batch
-
Serve the indexed data
sqd serve
Inspect the auto-generated GraphQL API using an interactive playground at
http://localhost:4350/graphql
NOTE: Before deploying in the cloud, please make sure the secrets defined in the subsquid.yaml are set in the subsquid cloud. Secrets are global to all the squid. Some value specific to squid maybe need to be set in squid.yaml
- Generate key from subsquid cloud by going to the profile
https://app.subsquid.io/profile/auth-key - Add key in the project to authenticate
sqd auth -k <key>
- Generate squid.yaml file to deploy
npm run compile-chain chainId=[chainId]
** NOTE** Different config for chainId can be found on chain-squid-config.ts file which is replaced to squid template yaml file
- Deploy the squid
sqd deploy -m [YAML_FILE_NAME] --hard-reset -o [organization_name] E.g. sqd deploy -m squid-arbitrum.yaml -o rail-squid
NOTE: --hard-reset flag is used to start the indexing from the starting block. If that is not the case, we can remove it. But do note that any changes to the schema needs to be build and deployed from the starting block