Skip to content

Commit

Permalink
Merge pull request #571 from streamingfast/giu/accounts/doc
Browse files Browse the repository at this point in the history
Docs Updates
  • Loading branch information
Giuliano-1 authored Jan 3, 2025
2 parents 19e0517 + da77f8b commit ea98f00
Show file tree
Hide file tree
Showing 8 changed files with 86 additions and 4 deletions.
7 changes: 5 additions & 2 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@

* [Develop Your First Substreams](new/tutorials/intro-to-tutorials.md)
* [on EVM](new/tutorials/evm.md)
* [on Solana](new/tutorials/solana.md)
* [on Solana](new/tutorials/solana)
[Transactions & Instructions](new/tutorials/solana/solana.md)
[Account Changes](new/tutorials/solana/account-changes.md)
* [on Starknet](new/tutorials/starknet.md)
* [on Cosmos](new/tutorials/cosmos-compatible)
* [Injective](new/tutorials/cosmos-compatible/injective.md)
Expand Down Expand Up @@ -66,7 +68,8 @@
* [Chains and endpoints](new/references/chains-and-endpoints.md)
* [Never Miss Data](new/references/reliability-guarantees.md)
* [Development Container Reference](new/references/devcontainer-ref.md)
* [Install the CLI](new/references/cli/installing-the-cli.md)
* [Substreams CLI](new/references/cli/)
* [Install the CLI](new/references/cli/installing-the-cli.md)
* [Authentication](new/references/cli/authentication.md)
* [Substreams CLI reference](new/references/cli/command-line-interface.md)
* [Substreams Components](new/references/substreams-components/)
Expand Down
4 changes: 2 additions & 2 deletions docs/new/references/cli/installing-the-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ go install -v ./cmd/substreams

## Validation of installation

Run the [`substreams` CLI](../reference-and-specs/command-line-interface.md) passing the `--version` flag to check the success of the installation.
Run the [`substreams` CLI](./command-line-interface.md) passing the `--version` flag to check the success of the installation.

```bash
substreams --version
Expand Down Expand Up @@ -103,5 +103,5 @@ Buf simplifies the generation of typed structures in any language. Buf uses a re
Visit the [Buf website](https://buf.build/) for additional information and [installation instructions](https://docs.buf.build/installation).

{% hint style="info" %}
**Note**_:_ [Substreams packages](../reference-and-specs/packages.md) and [Buf images](https://docs.buf.build/reference/images) are compatible.
**Note**_:_ [Substreams packages](../substreams-components/packages.md) and [Buf images](https://docs.buf.build/reference/images) are compatible.
{% endhint %}
4 changes: 4 additions & 0 deletions docs/new/tutorials/cosmos-compatible/injective.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ Tutorial on Injective

In this guide, you'll learn how to initialize a Injective-based Substreams project within the Dev Container.

{% hint style="info" %}
If you prefer to begin locally within your terminal rather than through the Dev Container (VS Code required), refer to the [Substreams CLI installation guide](../references/cli/installing-the-cli.md).
{% endhint %}

## Prerequisites

- Docker and VS Code installed and up-to-date.
Expand Down
4 changes: 4 additions & 0 deletions docs/new/tutorials/cosmos-compatible/mantra.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ Tutorial on MANTRA

In this guide, you'll learn how to initialize a MANTRA-based Substreams project within the Dev Container.

{% hint style="info" %}
If you prefer to begin locally within your terminal rather than through the Dev Container (VS Code required), refer to the [Substreams CLI installation guide](../references/cli/installing-the-cli.md).
{% endhint %}

## Step 1: Initialize Your MANTRA Substreams Project

1. Open the [Dev Container](https://github.com/streamingfast/substreams-starter) and follow the on-screen steps to initialize your project.
Expand Down
4 changes: 4 additions & 0 deletions docs/new/tutorials/evm.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ title: Getting Started on EVM

In this guide, you'll learn how to initialize an EVM-based Substreams project within the Dev Container.

{% hint style="info" %}
If you prefer to begin locally within your terminal rather than through the Dev Container (VS Code required), refer to the [Substreams CLI installation guide](../references/cli/installing-the-cli.md).
{% endhint %}

## Step 1: Initialize Your EVM Substreams Project

1. Open the [Dev Container](https://github.com/streamingfast/substreams-starter) and follow the on-screen steps to initialize your project.
Expand Down
59 changes: 59 additions & 0 deletions docs/new/tutorials/solana/account-changes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Getting Started with Solana Account Changes

## Introduction

In this tutorial, you will learn how to consume Solana account change data using Substreams. We will walk you through the process of setting up your environment, configuring your first Substreams stream, and consuming account changes efficiently.

By the end of this tutorial, you will have a working Substreams feed that allows you to track real-time account changes on the Solana blockchain, as well as historical account change data.

{% hint style="info" %}
History for the Solana Account Changes dates as of 2025, block 310629601.
{% endhint %}

For each Solana Account block, only the latest update per account is recorded. If an account is deleted, a payload with `deleted == True` is provided. Additionally, events of low importance we're omitted, such as those with the special owner “Vote11111111…” account or changes that do not affect the account data (ex: lamport changes).

## Prerequisites

Before you begin, ensure that you have the following:

1. [Substreams CLI](../../references/cli/installing-the-cli.md) installed.
2. A [Substreams key](../../references/cli/authentication.md) for access to the Solana Account Change data.
3. Basic knowledge of [how to use](../../references/cli/command-line-interface.md) the command line interface (CLI).

## Step 1: Set Up a Connection to Solana Account Change Substreams

Now that you have Substreams CLI installed, we can set up a connection to the Solana Account Change Substreams feed.

Using the [Solana Accounts Foundational Module](https://substreams.dev/packages/solana-accounts-foundational/latest), you can choose to stream data directly or use the GUI for a more visual experience. The following `gui` example filters for Honey Token account data.

```bash
substreams gui solana-accounts-foundational filtered_accounts -t +10 -p filtered_accounts="owner:TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA || account:4vMsoUT2BWatFweudnQM1xedRLfJgJ7hswhcpz4xgBTy"
```
This command will stream account changes directly to your terminal.

```bash
substreams run solana-accounts-foundational filtered_accounts -s -1 -o clock
```

The Foundational Module has support for filtering on specific accounts and/or owners. You can adjust the query based on your needs.

This tutorial will continue to guide you through filtering, sinking the data, and setting up reconnection policies.

## Step 2: Sink the Substreams

Consume the account stream [directly in your applicaion](../how-to-guides/sinks/stream/stream.md) using a callback or make it queryable by using the [SQL-DB sink](../../how-to-guides/sinks/sql/sql-sink.md).

## Step 3: Setting up a Reconnection Policy

[Cursor Management](../../references/reliability-guarantees.md) ensures seamless continuity and retraceability by allowing you to resume from the last consumed block if the connection is interrupted, preventing data loss and maintaining a persistent stream.

The user's primary responsibility when creating or using a sink is to pass a BlockScopedDataHandler and a BlockUndoSignalHandler implementation(s) which has the following interface:

```go
import (
pbsubstreamsrpc "github.com/streamingfast/substreams/pb/sf/substreams/rpc/v2"
)

type BlockScopedDataHandler = func(ctx context.Context, cursor *Cursor, data *pbsubstreamsrpc.BlockScopedData) error
type BlockUndoSignalHandler = func(ctx context.Context, cursor *Cursor, undoSignal *pbsubstreamsrpc.BlockUndoSignal) error
```
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ Tutorial on Solana

In this guide, you'll learn how to initialize a Solana-based Substreams project within the Dev Container.

{% hint style="info" %}
If you prefer to begin locally within your terminal rather than through the Dev Container (VS Code required), refer to the [Substreams CLI installation guide](../references/cli/installing-the-cli.md).
{% endhint %}

## Step 1: Initialize Your Solana Substreams Project

1. Open the [Dev Container](https://github.com/streamingfast/substreams-starter) and follow the on-screen steps to initialize your project.
Expand Down
4 changes: 4 additions & 0 deletions docs/new/tutorials/starknet.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ Tutorial on Starknet

In this guide, you'll learn how to initialize a Starknet-based Substreams project within the Dev Container.

{% hint style="info" %}
If you prefer to begin locally within your terminal rather than through the Dev Container (VS Code required), refer to the [Substreams CLI installation guide](../references/cli/installing-the-cli.md).
{% endhint %}

## Step 1: Initialize Your Starknet Substreams Project

1. Open the [Dev Container](https://github.com/streamingfast/substreams-starter) and follow the on-screen steps to initialize your project.
Expand Down

0 comments on commit ea98f00

Please sign in to comment.