on Stellar
In this guide, you'll learn how to initialize a Stellar-based Substreams project within the Dev Container.
Step 1: Initialize Your Stellar Substreams Project
Open the Dev Container and follow the on-screen steps to initialize your project.
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 Stellar Foundational Module. 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.
Step 2: Visualize the Data
Run
substreams auth
to create your account and generate an authentication token (JWT), then pass this token back as input.Now you can freely use the
substreams gui
to visualize and iterate on your extracted data.
Step 2.5: (Optionally) Transform the Data
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 How-to-Guides
Step 3: Load the Data
To make your Substreams queryable (as opposed to direct streaming), you can automatically generate a SQL sink.
SQL
Run
substreams codegen sql
and choose from either ClickHouse or Postgres to initialize the sink, producing the necessary files.Run
substreams build
build the Substreams:SQL sink.Run
substreams-sink-sql
to sink the data into your selected SQL DB.
Additional Resources
You may find these additional resources helpful for developing your first Stellar application.
Dev Container Reference
The Dev Container Reference helps you navigate the container and its common errors.
CLI Reference
The CLI reference lets you explore all the tools available in the Substreams CLI.
Substreams Components Reference
The Components Reference dives deeper into navigating the substreams.yaml
.
Last updated
Was this helpful?