Skip to content

Latest commit

 

History

History
41 lines (28 loc) · 1.41 KB

README.md

File metadata and controls

41 lines (28 loc) · 1.41 KB

Open in Gitpod

Minimal EVM squid that uses PostGraphile

This squid indexer presents its data using PostGraphile instead of the GraphQL server from Squid SDK. It gets the raw data from Subsquid Network.

Dependencies: Node.js v16 or newer, Git, Docker.

PostGraphile configuration

The only major difference between a squid PostGraphile API and any other PostGraphile API is the _squidStatus query. Here it is implemented via ProcessorStatusPlugin. See src/api.ts for details.

Startup

# 0. Install @subsquid/cli a.k.a. the sqd command globally
npm i -g @subsquid/cli

# 1. Retrieve the example
sqd init my_squid_name -t https://github.com/subsquid-labs/squid-postgraphile-example
cd my_squid_name

# 2. Install dependencies
npm ci

# 3. Start a Postgres database container and detach
sqd up

# 4. Build the squid
sqd build

# 5. Start both the squid processor and the GraphQL server
sqd run .

A GraphiQL playground will be available at localhost:4350/graphiql.

You can also start squid services one by one:

sqd process
sqd api