on Injective
In this tutorial, you'll learn how to initialize a Injective-based Substreams project using the Substreams CLI (substreams init
command).
Prerequisites
Docker and VS Code installed and up-to-date.
Visit the Getting Started Guide to initialize your Dev Container.
Step 1: Initialize Your Injective Substreams Project
Running
substreams init
will give you the option to choose between three Injective project options. Select the one that best fits your requirements:Injective EVM: Navigate to the
substreams init
EVM path to access Injective-specific EVM data. Supports Extended Blocks.Injective-hello-world: Creates a simple Substreams module that outputs all
transfer
events. It demonstrates how to access the full Injective block, iterate over events, and filter by a specific eventtype
.Injective-events: Creates a Substreams that extracts Injective events using the cached Injective Foundational Module, filtered by one or more smart contract addresses. This includes type
wasm
events.
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.Run
substreams build
to compile the project.Run
substreams gui
to visualize and iterate on your extracted data.
Step 2.5: (Optionally) Transform the Data
Open the
src/lib.rs
file that has been generated.Modify the transformations made to the data as needed. Every time you modify the code, you will have to recompile the project with
substreams build
.
Step 3: Load the Data
To make your Substreams queryable (as opposed to direct streaming), you can automatically send the data to a SQL data by using the SQL sink or through PubSub.
Additional Resources
You may find these additional resources helpful for developing your first Injective 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?