This project serves as the API for Basilisk's UIs, Dashboards and analytics.
- Node v16.x
- Docker
- Built Basilisk node in
./../Basilisk-node
- Built Polkadot node in
./../polkadot
โ ๏ธ Make sure to have both theBasilisk-node
andpolkadot
accessible and built usingcargo build --release
in the aforementioned directories. Otherwise the testnet scripts available inpackage.json
won't work.
# Start the local basilisk testnet
npm run testnet:start
# Start the local indexer targeting the basilisk node from the previous step
# If you need to debug the indexer, omit the `-d` option
npm run indexer:start -- -d
# Prepare the dev environment for the processor
npm run processor:clean-and-setup
# Start processing the indexed data
npm run processor:start
- define custom types in
./chain/definitions.ts
- run
processor:gen-chain-types
Project's configuration is driven by environment variables, defined in .env
,
and manifest.yml
. For more details see https://docs.subsquid.io.
Run npm run testnet:start
and visit the Polkadot apps UI to observe new blocks being produced after a while.
Run npm run indexer:start
to start a local indexer, which will index the locally running Basilisk node.
Open Graphiql Online and use http://localhost:4010/v1/graphql
as the GraphQL endpoint
to interact with the indexer.
You can run the following query to get started:
query MyQuery {
indexerStatus {
inSync
lastComplete
chainHeight
}
}
For Apple M1 support you need to build the indexer docker image locally:
git clone clone https://github.com/subsquid/hydra
cd hydra && ./scripts/docker-build.sh --target indexer-gateway -t subsquid/hydra-indexer-gateway:4
Run npm run processor:clean-and-setup
to setup the development environment. Then run npm run processor:start
to start the processor.