on NEAR
In this tutorial, you'll learn how to initialize a NEAR-based Substreams project using the Substreams CLI and the available NEAR development resources.
Step 1: Initialize Your NEAR Substreams Project
Running
substreams initwill give you the option to choose between NEAR project options. Select the one that best fits your requirements:near-hello-world: Creates a simple Substreams example that demonstrates how to extract and process NEAR blockchain data using the NEAR Full block as input.
Step 2: Visualize the Data
Run
substreams authto create your account and generate an authentication token (JWT), then pass this token back as input.Run
substreams buildto compile the project.Run
substreams guito visualize and iterate on your extracted data.
Step 2.5: (Optionally) Transform the Data
Open the
src/lib.rsfile 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 NEAR application.
NEAR Development Kit
The Substreams NEAR development kit provides Rust Firehose Block models and helpers specifically for NEAR chains.
NEAR Endpoints
NEAR Substreams are available on the following endpoints:
NEAR Mainnet:
mainnet.near.streamingfast.io:443NEAR Testnet:
testnet.near.streamingfast.io:443
Dev Container Reference
The Dev Container Reference, in case you are developing on Windows and need a Linux virtual environment.
Substreams Components Reference
The Components Reference dives deeper into navigating the substreams.yaml.
Last updated
Was this helpful?

