-
Notifications
You must be signed in to change notification settings - Fork 79
Add NEAR to the Docs on Substreams.dev #699
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+57
β0
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| Tutorial 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. | ||
|
|
||
| {% hint style="info" %} | ||
| The CLI installation is supported only on Linux and macOS. If you're using Windows, consider using the [DevContainer environment](../references/devcontainer-ref.md), which launches a Linux-based virtual environment. | ||
| {% endhint %} | ||
|
|
||
| ## Step 1: Initialize Your NEAR Substreams Project | ||
|
|
||
| 1. [Install the Substreams CLI](../how-to-guides/cli/installing-the-cli.md). | ||
|
|
||
| 2. Currently, NEAR project templates are being developed for the `substreams init` command. In the meantime, you can get started with NEAR Substreams by cloning the existing example: | ||
|
|
||
| ```bash | ||
| git clone https://github.com/streamingfast/substreams-near-hello-world.git | ||
| cd substreams-near-hello-world | ||
| ``` | ||
|
|
||
| This example demonstrates how to extract and process NEAR blockchain data using the [NEAR Full block](https://github.com/streamingfast/firehose-near/blob/develop/proto/sf/near/type/v1/type.proto) as input. | ||
|
|
||
| {% hint style="info" %} | ||
| **Coming Soon**: NEAR project templates will be available through `substreams init` in a future release, similar to other supported blockchains. | ||
| {% endhint %} | ||
|
|
||
| ## Step 2: Visualize the Data | ||
|
|
||
| 1. Run `substreams auth` to create your [account](https://thegraph.market/) and generate an authentication token (JWT), then pass this token back as input. | ||
|
|
||
| 2. Run `substreams build` to compile the project. | ||
|
|
||
| 3. Run `substreams gui` to visualize and iterate on your extracted data. | ||
|
|
||
| ## Step 2.5: (Optionally) Transform the Data | ||
|
|
||
| 1. Open the `src/lib.rs` file that has been generated. | ||
|
|
||
| 2. 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](../how-to-guides/sinks/stream/stream.md)), you can automatically send the data to a SQL data by using the [SQL sink](../how-to-guides/sinks/sql/sql.md) or through [PubSub](../how-to-guides/sinks/pubsub.md). | ||
|
|
||
| ## Additional Resources | ||
|
|
||
| You may find these additional resources helpful for developing your first NEAR application. | ||
|
|
||
| ### NEAR Development Kit | ||
|
|
||
| The [Substreams NEAR](https://github.com/streamingfast/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:443` | ||
| - **NEAR Testnet**: `testnet.near.streamingfast.io:443` | ||
|
|
||
| ### Dev Container Reference | ||
|
|
||
| The [Dev Container Reference](../../references/devcontainer-ref.md), in case you are developing on Windows and need a Linux virtual environment. | ||
|
|
||
| ### Substreams Components Reference | ||
|
|
||
| The [Components Reference](../../references/substreams-components/packages.md) dives deeper into navigating the `substreams.yaml`. | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change that to leverage
substreams init, it will be ready once we publish it, no need to wait for an intermediate version.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll update the guide to use
substreams initas suggested... π οΈπ» View my work β’ π Stop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
β Updated! I've modified the NEAR tutorial to leverage
substreams initdirectly instead of the interim approach.The tutorial now follows the TRON pattern more closely:
git cloneapproachsubstreams initwith the near-hello-world template optionπ View Updated PR #699 on Github π
The changes are now pushed and ready for review! π―
π» View my work β’ π Stop β’ React π or π