LogoLogo
Package RegistryThe Graph
  • Introduction
  • Getting Started
  • Tutorials
    • Develop Your First Substreams
      • on EVM
      • on Solana
        • Transactions & Instructions
        • Account Changes
      • on Cosmos
        • Injective
        • MANTRA
      • on Starknet
      • on Stellar
    • Publishing a Substreams Package
  • How-To Guides
    • Developing Substreams
      • on EVM
        • Exploring Ethereum
          • Mapping Blocks
          • Filter Transactions
          • Retrieve Events of a Smart Contract
      • on Solana
        • Explore Solana
          • Filter Instructions
          • Filter Transactions
        • SPL Token Tracker
        • NFT Trades
        • DEX Trades
      • on Cosmos
        • Injective
          • Simple Substreams Example
          • Foundational Modules
          • Dojo DEX USDT Volume Subgraph Example
    • Using a Substreams Sink
      • Substreams:SQL
      • Substreams:Subgraph
        • Triggers
        • Graph Out
      • Substreams:Stream
        • JavaScript
        • Go
      • Substreams:PubSub
      • Community Sinks
        • MongoDB
        • Files
        • Key-Value Store
        • Prometheus
    • EVM Extensions
      • Making eth_calls
    • Getting Started Using Rust and Protobuf
      • Rust
        • Option struct
        • Result struct
      • Protobuf Schemas
    • From Yellowstone to Substreams
  • Reference Material
    • Chains and endpoints
      • Ethereum Data Model
    • Never Miss Data
    • Development Container Reference
    • Substreams CLI
      • Install the CLI
      • Authentication
      • Substreams CLI reference
    • Substreams Components
      • Packages
      • Modules
        • Module types
        • Inputs
        • Output
        • Module handlers
        • Module handler creation
        • Indexes
        • Keys in stores
        • Dynamic data sources
        • Aggregation Windows
        • Parameterized Modules
      • Manifests Reference
    • Substreams Architecture
    • Graph-Node
      • Local Development
      • Publish to The Graph Network
    • Indexer Reference
      • Test Substreams Locally
    • Logging, Debugging & Testing
    • Change log
    • FAQ
  • Decentralized Indexing
    • What is The Graph?
Powered by GitBook
On this page
  • Step 1: Initialize Your Stellar Substreams Project
  • Step 2: Visualize the Data
  • Step 2.5: (Optionally) Transform the Data
  • Step 3: Load the Data
  • Subgraph
  • SQL
  • Additional Resources
  • Dev Container Reference
  • CLI Reference
  • Substreams Components Reference

Was this helpful?

Edit on GitHub
  1. Tutorials
  2. Develop Your First Substreams

on Stellar

Previouson StarknetNextPublishing a Substreams Package

Last updated 1 month ago

Was this helpful?

In this guide, you'll learn how to initialize a Stellar-based Substreams project within the Dev Container.

If you prefer to begin locally within your terminal rather than through the Dev Container (VS Code required), refer to the .

Step 1: Initialize Your Stellar Substreams Project

  1. Open the and follow the on-screen steps to initialize your project.

  2. Running substreams init will give you the option to choose between two Stellar project options. Select the one that best fits your requirements:

    • stellar-minimal: Creates a simple Substreams that extracts raw Stellar block data and generates corresponding Rust code. This path will start you with the full raw block, you can navigate to the substreams.yaml (the manifest) to modify the input.

    • stellar-transactions-operations: Creates a Substreams that extracts and decodes Stellar trasactions or operations using the cached . If you choose the index transactions, you will be able to filter by source account(s). If you choose to index operations, you will be able to filter by operation name.

The first streamable block for Stellar on Substreams is currently 55,411,000.

The stellar-transactions-operations foundational module only decodes and indexes SOME operations. However, you can to include the decoding of other operations if needed.

Please, find below the operations supported:

&Op::CreateAccount(_) => "create_account",
&Op::AccountMerge(_) => "account_merge",
&Op::Payment(_) => "payment",
&Op::CreateClaimableBalance(_) => "create_claimable_balance",
&Op::ClaimClaimableBalance(_) => "claim_claimable_balance",
&Op::Clawback(_) => "clawback",
&Op::ClawbackClaimableBalance(_) => "clawback_claimable_balance",
&Op::AllowTrust(_) => "allow_trust",
&Op::SetTrustLineFlags(_) => "set_trust_line_flags",
&Op::LiquidityPoolDeposit(_) => "liquidity_pool_deposit",
&Op::LiquidityPoolWithdraw(_) => "liquidity_pool_withdraw",
&Op::ManageBuyOffer(_) => "manage_buy_offer",
&Op::ManageSellOffer(_) => "manage_sell_offer",
&Op::CreatePassiveSellOffer(_) => "create_passive_sell_offer",
&Op::PathPaymentStrictSend(_) => "path_payment_strict_send",
&Op::PathPaymentStrictReceive(_) => "path_payment_strict_receive",

Step 2: Visualize the Data

  1. Now you can freely use the substreams gui to visualize and iterate on your extracted data.

Step 2.5: (Optionally) Transform the Data

Step 3: Load the Data

Subgraph

  1. Run substreams codegen subgraph to initialize the sink, producing the necessary files and function definitions.

SQL

  1. Run substreams codegen sql and choose from either ClickHouse or Postgres to initialize the sink, producing the necessary files.

  2. Run substreams-sink-sql to sink the data into your selected SQL DB.

Note: Run help to better navigate the development environment and check the health of containers.

Additional Resources

You may find these additional resources helpful for developing your first Stellar application.

Dev Container Reference

CLI Reference

Substreams Components Reference

Run substreams auth to create your and generate an authentication token (JWT), then pass this token back as input.

Within the generated directories, modify your Substreams modules to include additional filters, aggregations, and transformations, then update the manifest accordingly. To learn more about this, visit the

To make your Substreams queryable (as opposed to ), you can automatically generate a Subgraph (known as a ) or SQL-DB sink.

Create your within the mappings.ts and associated entities within the schema.graphql.

Build and deploy locally or to by running deploy-studio.

Run substreams build build the sink.

The helps you navigate the container and its common errors.

The lets you explore all the tools available in the Substreams CLI.

The dives deeper into navigating the substreams.yaml.

Substreams CLI installation guide
Dev Container
Stellar Foundational Module
modify the code
account
How-to-Guides
direct streaming
Substreams-powered subgraph
subgraph mappings
Subgraph Studio
Substreams:SQL
Dev Container Reference
CLI reference
Components Reference