- Node >=20
- Nvm
- Install SubSquid CLI:
npm i -g @subsquid/cli@latest
-
Install Docker Desktop
-
Install PgAdmin 4
-
Register on Dwellir to get a
CHAIN_RPC_ENDPOINT
URL (It supports most chains) -
Make a new
.env
file (Copy.env.example
)
- Build:
sqd build
- Build the DB:
sqd up
- Run:
sqd process
If you're using VSCode - Enable format on save with Prettier
On code change, to apply changes:
sqd build && sqd process
To connect locally to the DB when you register a new DB, you need to configure the following:
Name: DB_NAME
Host name/address: localhost
Port: DB_PORT
Password: DB_PASS
- Go to chain/ and create a new folder with the chain name
- Create a metadata.json file with the pallets that will be used (Refer to template folder)
- Run
sqd typegen
- to generate class types for the chain - Go to chain/{chainName}/ and create a decoders folder inside with events and calls subfolders (Refer to the templates folder)
- Implement the pallet calls and events decoding in the corresponding folders (Refer to the templates folder)
- Figure out pallet flow
- Create/Update DB schema
- Apply migration
- Import in registry.ts the Handlers
- Implement each pallet action in the indexer/actions folder (Could split the code in the actions folder)