Injective
Last updated
Was this helpful?
Last updated
Was this helpful?
In this guide, you'll learn how to initialize a Injective-based Substreams project within the Dev Container.
Docker and VS Code installed and up-to-date.
Visit the to initialize your Dev Container.
Open the and follow the on-screen steps to initialize your project.
Running substreams init
will give you the option to choose between two Injective project options. Select the one that best fits your requirements:
Injective-minimal: Creates a simple Substreams that extracts raw Injective 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.
Injective-events: Creates a Substreams that extracts Injective events using the cached , filtered by one or more smart contract addresses. This includes type wasm
events.
Run substreams auth
to create your 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.
Run substreams codegen subgraph
to initialize the sink, producing the necessary files and function definitions.
Run substreams codegen sql
and choose from either ClickHouse or Postgres to initialize the sink, producing the necessary files.
Run substreams-sink-sql
to sink the data into your selected SQL DB.
You may find these additional resources helpful for developing your first Injective application.
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
.