Starknet Gets Substreams & Subgraph Studio Support!

Substreams, developed for The Graph, has achieved a new milestone in its road to support non-EVM blockchains: Starknet is now integrated...
Published on
October 31, 2024

Substreams, developed for The Graph, has achieved a new milestone in its road to support non-EVM blockchains: Starknet is now integrated into Subgraph Studio and Substreams-Powered Subgraphs are now available for use!

Why Starknet

Starknet is a decentralized, layer-2 scaling solution built on top of the Ethereum blockchain. It leverages ZK-Rollup (Zero-Knowledge Rollup) technology to enhance Ethereum's scalability, security, and privacy. Starknet alleviates congestion and high fees on Ethereum by offloading computations from the main chain while benefiting from Ethereum's security guarantees.

Why Substreams

Built by StreamingFast, a core developer of The Graph, Substreams are a programmable data stream offering high-throughput and sink-agnostic features.

  • Stream Reliably in Real-Time: Low-latency gRPC stream (backed by the Firehose) that is cursor managed to handle reorgs and eliminate the unreliability of RPCs. 
  • Parallelized Back-Process: Significantly reduces indexing times, enabling the processing of entire blockchains within just a few hours.
  • Composability: Enables the creation of aggregated streams in a modular way, simplifying the extraction of complex insights from raw data.
  • Sink Anywhere: Substreams enable seamless integration of data with any storage or interface environment, including subgraphs, SQL databases, or direct gRPC streaming.

Getting Started

Substreams and its sinks can be easily developed and tested within the DevContainer. To get started with Substreams, follow the Starknet introduction guide. It will walk you through using code-generation tools to initialize a Substreams project within the DevContainer.

If you have any questions, feel free to reach out to us on our Discord server.

To build a Starknet Substreams-powered subgraph:

  • Run substreams codegen subgraph within the DevContainer
  • Use AssemblyScript to create the data transformations (as any other subgraph).
  • Define the API schema through GraphQL.
  • Test your subgraph by deploying to The Graph Studio (sandbox testing environment).
  • Migrate your deployment once testing is complete to The Graph Network – a decentralized, production-ready platform that enables fast and cost-effective blockchain data queries.