Docs
Vyhledávání⌘ K
  • Domov
  • O Grafu
  • Podporované sítě
  • Protocol Contracts
  • Podgrafy
    • Substreams
      • Token API
        • AI Suite
          • Indexing
            • Resources
              Substreams

              2 minutes

              Introduction to Substreams

              Substreams Logo

              To start coding right away, check out the Substreams Quick Start.

              Přehled

              Substreams is a powerful parallel blockchain indexing technology designed to enhance performance and scalability within The Graph Network.

              Substreams Benefits

              • Accelerated Indexing: Boost Subgraph indexing time with a parallelized engine for quicker data retrieval and processing.
              • Multi-Chain Support: Expand indexing capabilities beyond EVM-based chains, supporting ecosystems like Solana, Injective, Starknet, and Vara.
              • Enhanced Data Model: Access comprehensive data, including the trace level data on EVM or account changes on Solana, while efficiently managing forks/disconnections.
              • Multi-Sink Support: For Subgraph, Postgres database, Clickhouse, and Mongo database.

              Jak funguje Substreams ve 4 krocích

              1. You write a Rust program, which defines the transformations that you want to apply to the blockchain data. For example, the following Rust function extracts relevant information from an Ethereum block (number, hash, and parent hash).
              1fn get_my_block(blk: Block) -> Result<MyBlock, substreams::errors::Error> {2    let header = blk.header.as_ref().unwrap();34    Ok(MyBlock {5        number: blk.number,6        hash: Hex::encode(&blk.hash),7        parent_hash: Hex::encode(&header.parent_hash),8    })9}
              1. You wrap up your Rust program into a WASM module just by running a single CLI command.

              2. The WASM container is sent to a Substreams endpoint for execution. The Substreams provider feeds the WASM container with the blockchain data and the transformations are applied.

              3. You select a sink⁠, a place where you want to send the transformed data (such as a SQL database or a Subgraph).

              Další zdroje

              All Substreams developer documentation is maintained by the StreamingFast core development team on the Substreams registry⁠.

              ⁠Edit on GitHub⁠

              Rychlé spuštěníDev Container
              On this page
              • Přehled
              • Substreams Benefits
              • Jak funguje Substreams ve 4 krocích
              • Další zdroje
              The GraphStatusTestnetBrand AssetsForumSecurityPrivacy PolicyTerms of Service