Subgraph Development Kit V1.0 (Grant)

Motivation
When it comes to sitting and writing code, we as developers should avoid reinventing the wheel and use standard solutions to common problems.

This is the idea behind this grant, beat the lack of tooling for subgraph development.

We will build a package with all the typical patterns developers use. This will allow us to avoid repetition and enforce code understanding:

  • Oracle DSL
  • Data Type Conversion
  • Design Patterns for Mappings
  • Helpers for Testing (Matchstick)
  • And Other functionalities
    This is the first draft. Of course, this library can be extended.

This is a project that is going to benefit subgraph developers as well as the rest of the ecosystem. Using a package with all the common patterns, the subgraph development speed could be 2x faster.

Milestones & Deliverables

Milestone #1 - Library draft development

  • Good Practice & Standard Code Research & Benchmark
  • Repository Review & Code Selection
  • Library development

Milestone #2 - Library testing & tuning

  • Subgraph Rewrite & Testing (with Matchstick)
  • For testing, we will use a custom subgraph project
  • Testing will be integrated into version 2

Milestone #3 - Documentation & Social Media

  • Documentation
  • Write a Tutorial Blog to use the library

Final deliverable: Installable NPM Package Library + GitHub Repo

Protofire team
luis.lopez@protofire.io
diego@protofire.io

4 Likes

Hey Diego, this is a great initiative! There are already some unmaintained tools in the wild that could probably inspire you. Like this one from Protofire that’s quite useful but probably needs some love: GitHub - protofire/subgraph-toolkit: A collection of utilities and helpers to support the development of subgraphs. Also some tools are listed here: Welcome to The Graph Codex - Graph Codex and there are more.
Happy to brainstorm more ideas together.

4 Likes

Thanks Simon, for your feedback! We will look into this!

Diego

1 Like

Hi Simon. Thank you for taking the time to read the proposal. Yes, you are right. The idea is to collect good patterns regarding subgraph development. The library that you are mentioning above was built by us but it is a little outdated and with no maintenance. We are thinking on building something better this time.

3 Likes

I love this idea, feels like creating a subgraph IDE. Best of luck to you!

2 Likes

Hey @Diegotowers @luigibyte ,

The overall idea sounds great, and I’d like to know more about your plans. Keep us posted, and let us know if you have more specific information on how you’ll get there and what this library / SDK will look like for Developers.

I’m not sure if you’re following any of the initiatives around subgraph development education, but it could be worth getting in touch with folks like Graphrica to collect some initial requirements or ideas as you’re still in the design phase.

2 Likes

Hi @Pedro.

This is what we have so far.

Also, there is an yarn packaged published.

You are correct, the idea is to collect best practices and design patterns for subgraph development.

The library is tested using matchstick and a dummy subgraph. Also, we are using github actions as CI.

1 Like

Hey folks

How’s this work coming along? I’d be curious to know what else you have on the roadmap.

Have you considered integrating the numbers and bytes helper functions into graph-ts?

1 Like

Hi @Pedro.
Sorry for the late response. We have been quite busy these days.

We are receiving feedback from the community developers. We have already implemented some of their suggestions, we have others in the backlog like scoping some contract addresses by network.

It would be a pleasure to contribute to the graph-ts package.

2 Likes