Skip to content
This repository has been archived by the owner on Nov 10, 2023. It is now read-only.

subsquid-quests/snapshot-subgraph-migration

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 

Repository files navigation

Subsquid Logo

docs.rs Discord

Website | Docs | Discord

Winners

Snapshot Subgraph migration

Submissions for this quest are closed

This quest is to migrate the Snapshot Subgraph to Squid SDK. The resulting squid should match the GraphQL API of the subgraph as close as possible, by migrating schema.graphql. The judges reserve the right to request improvements afther the initial review of the submission. Reach out to the Discord Channel for any tech questions regarding this quest.

Quest Info

Category Skill Level Time required (hours) Max Participants Reward Status
Squid Deployment $\textcolor{green}{\textsf{Intermediate}}$ ~10 5 $\textcolor{red}{\textsf{1500tSQD}}$ closed

Acceptance critera

Each quest should be submitted as a private repo and will be reviewed manually. To submit, create an issue with url to your repo and invite the following github accounts: @dariaag, @belopash, @abernatskiy and @dzhelezov. The repo should contain README.MD with

  • Insturctions how to run the squid locally
  • Sample Squid queries and the corresponding Subgraph queries

The code should be well documented. The judges will access:

  • In-line commends where necessary
  • Clarity of the code
  • Performance and optimization (if batching and Multicall queries are used whenever appropriate)

Useful links

Setup and Common errors

  1. Install Node v16.x or newer https://nodejs.org/en/download

  2. Install Docker https://docs.docker.com/engine/install/

  3. Install git https://git-scm.com/book/en/v2/Getting-Started-Installing-Git

  4. Install Squid CLI

    npm i -g @subsquid/cli@latest

How to run a squid:

  1. Install dependecies:
npm ci
  1. Generate model
sqd codegen
  1. Generate types
sqd typegen
  1. Open docker and run:
sqd up
  1. Generate migrations:
sqd migration:generate
  1. Start processing:
sqd process

Possible Errors:

  1. Docker not installed
X db Error × query-gateway Error
Error response from daemon: Get "https://registry-1.docker.jo/v2/": uri ting to 127.0.0.1:8888: dial cp 127.0.0.1:8888: connectex: No connection
  1. Git not installed
Error: Error: spawn git ENOENT
at ChildProcess._handle.onexit (node: internal/child_process: 284:19)
at onErrorNT (node: internal/child_process:477:16)
at process.processTicksAndRejections (node: internal/process/task_queues:82:21)
  1. Dependencies not installed. Run npm ci
sqd typegen
TYPEGEN
    Error: spawn squid-evm-typegen ENOENT
    Code: ENOENT
  1. Rate-limiting. Change the rpcUrl in processor.ts
will pause new requests for 20000ms {"rpcUrl":"https://rpc.ankr.com/eth", 
"reason" : "HttpError: got 429 from https://rpc.ankr.com/eth"}

About

A quest to migrate Snapshot subgraph to Subsquid

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •