Requirements:
- apibara cli
- Node 20+
- Recommended package manager: yarn
yarn
-
Copy .env.sample to .env and configure it
-
Run:
apibara run --allow-env=.env src/indexer.ts -A dna_xxx --sink-id 1
sink-id can be anything, but use same always
SyncID can be generated like this sn.num.getDecimalString(sn.shortString.encodeShortString('subscriptions'))
We use TypeGraphQL and Prisma to setup the GraphQL server.
- https://www.prisma.io/graphql
- https://typegraphql.com/docs/bootstrap.html#create-an-http-graphql-endpoint
- Ensure localhost postgres is running, If you have proper setup, running this should start your postgres
sudo service postgresql start