Skip to content

Subgraph plugin#1473

Open
DivyanshGoel20 wants to merge 5 commits intohiero-ledger:mainfrom
DivyanshGoel20:subgraph-plugin
Open

Subgraph plugin#1473
DivyanshGoel20 wants to merge 5 commits intohiero-ledger:mainfrom
DivyanshGoel20:subgraph-plugin

Conversation

@DivyanshGoel20
Copy link

Subgraph Plugin

Summary

Adds a Subgraph plugin so you can create and deploy Hedera testnet subgraphs from the CLI using The Graph and the Hedera JSON-RPC relay (e.g. Hashio). You scaffold a project, optionally start a local graph node with Docker, then run codegen, build, and deploy in one command.

Commands

Command Description
subgraph create Scaffold a Hedera testnet subgraph project (Greeter example)
subgraph deploy Run graph codegen, build, and deploy to local graph node
subgraph start-node Start local graph node via Docker (IPFS + Postgres + graph-node)

Why This Plugin?

Indexing Hedera contract events with The Graph usually means cloning an example repo, wiring config, and running several Graph CLI steps by hand. This plugin lets you create a ready-to-use subgraph from one command and deploy it (locally or, with your own setup, to a remote indexer) without memorizing the workflow.

What's Included

  • 3 commands following the existing plugin contract: Zod input/output schemas and Handlebars templates for human-readable output.
  • Embedded template — Greeter example (subgraph.yaml, schema.graphql, mappings, IGreeter ABI, docker-compose, package.json) so create works with no external clone.
  • Configurable create — optional --name, --contract-address, --start-block; deploy supports --dir, --name, --version-label, --skip-codegen, --skip-build.
  • Local graph node — start-node runs Docker Compose for graph-node + IPFS + Postgres pointed at Hedera testnet (Hashio).
  • Deploy uses npx @graphprotocol/graph-cli so the Graph CLI does not need to be installed globally.

Architecture

  • Manifest-driven registration via PluginManifest.
  • Handlers return CommandExecutionResult (ADR-003).
  • Reuses core only for logging and errors; create/deploy/start-node are file and shell operations (no Hedera SDK in the plugin).

Prerequisites

  • Node.js — for the CLI and for npx when deploying.
  • Docker — only if you use subgraph start-node to run a local graph node. You can instead deploy to a remote indexer (e.g. Mobula) and skip Docker.

Note: The first npm install inside a created subgraph project can take several minutes. If it hangs, try npm cache clean --force and run npm install again, or use yarn.

References

@DivyanshGoel20 DivyanshGoel20 requested review from a team as code owners February 21, 2026 14:15
@devmab devmab moved this to In Progress in Hiero CLI Feb 26, 2026
@devmab devmab added this to Hiero CLI Feb 26, 2026
@devmab devmab moved this from In Progress to Backlog in Hiero CLI Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant