-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
70 changed files
with
125 additions
and
6,064 deletions.
There are no files selected for viewing
This file contains 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains 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 |
---|---|---|
@@ -1,42 +1,68 @@ | ||
Substreams is a powerful indexing technology, which allows you to: | ||
- Extract data from several blockchains (Ethereum, Polygon, BNB, Solana...). | ||
- Apply custom transformations to the data. | ||
- Send the data to a place of your choice (for example, a Postgres database or a file). | ||
--- | ||
description: StreamingFast Substreams documentation | ||
--- | ||
|
||
<figure><img src=".gitbook/assets/intro/supported-chains.png" width="100%" /></figure> | ||
# Substreams | ||
|
||
**You can use Substreams packages to define which specific data you want to extract from the blockchain**. For example, consider that you want to retrieve data from the Uniswap v3 smart contract. You can simply use the [Uniswap v3 Substreams Package](https://substreams.dev/streamingfast/uniswap-v3/v0.2.7) and send that data wherever you want! | ||
## Welcome to Substreams documentation | ||
|
||
## Consume Substreams | ||
Substreams is a powerful blockchain indexing technology, developed for [The Graph Network](https://thegraph.com). | ||
|
||
There are many ready-to-use Substreams packages, so you can simply consume them. Use the **([Substreams.dev Registry](https://substreams.dev)) to explore packages**. | ||
> Substreams enables developers to write Rust modules, composing data streams alongside the community, and provides extremely high-performance indexing by virtue of parallelization, in a streaming-first fashion. | ||
> | ||
> Substreams have all the benefits of StreamingFast Firehose, like low-cost caching and archiving of blockchain data, high throughput processing, and cursor-based reorgs handling. | ||
Once you find a package that fits your needs, you only have choose **how you want to consume the data**. Send the data to a SQL database, configure a webhook or stream directly from your application! | ||
### Where to start | ||
|
||
<figure><img src=".gitbook/assets/intro/consume-flow.png" width="100%" /></figure> | ||
Learn about Substreams in a short, dense 25-minute intro and understand its impact on the blockchain ecosystem. | ||
|
||
## Develop Substreams | ||
{% embed url="https://www.youtube.com/watch?v=K-nhC2FCB5k" %} | ||
A walkthrough of Firehose features, Substreams modules, including a sample Rust module and StreamingFast's vision. | ||
{% endembed %} | ||
|
||
If you can't find a Substreams package that retrieves exactly the data you need, **you can develop your own Substreams**. | ||
Learn about the benefits of Substreams, and how it compares to otheressential facts about Substreams through [reading the Benefits and comparison](concepts-and-fundamentals/benefits.md). | ||
|
||
You can write your own Rust function to extract data from the blockchain: | ||
The primary ways to use Substreams include: | ||
|
||
```rust | ||
fn get_usdt_transaction(block: eth::Block) -> Result<Vec<Transaction>, substreams:error:Error> { | ||
let my_transactions = block.transactions(). | ||
.filter(|transaction| transaction.to == USDT_CONTRACT_ADDRESS) | ||
.map(|transaction| MyTransaction(transaction.hash, transaction.from, transaction.to)) | ||
.collect(); | ||
Ok(my_transactions) | ||
} | ||
``` | ||
* [Installing the `substreams` CLI](getting-started/installing-the-cli.md) | ||
* [Going through the Quickstart](getting-started/quickstart.md) | ||
|
||
<figure><img src=".gitbook/assets/intro/develop-flow.png" width="100%" /></figure> | ||
After installing Substreams and reviewing the Quickstart: | ||
|
||
## How Does It Work? | ||
* You can [learn more about ](developers-guide/modules/)modules, and then [study the Developer's guide](developers-guide/overview.md). | ||
|
||
The following video covers how Substreams works in less than 2 minutes: | ||
Find pre-built Substreams by using the following resources: | ||
|
||
{% embed url="https://www.youtube.com/watch?v=gVqGCqKVM08" %} | ||
Get an overview of Substreams | ||
{% endembed %} | ||
* The [Substreams Template](https://github.com/streamingfast/substreams-template) helps expedite the process of getting you up and running. | ||
* A [list of maintained Substreams examples](reference-and-specs/examples.md) | ||
|
||
### Network model diagram | ||
|
||
<img src=".gitbook/assets/substreams.excalidraw.svg" alt="" class="gitbook-drawing"> | ||
|
||
**You can view Substreams from two perspectives** as illustrated in the high-level visual diagram. It can be viewed through the perspective of the **Substreams engine** itself and also the perspective of the **end-user developer and consumer**. | ||
|
||
### Community | ||
|
||
Substreams is an open source community effort, so feel free to suggest new topics, report issues, and provide feedback. Contribute through GitHub [pull requests](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests). | ||
|
||
* [StreamingFast Discord](https://discord.gg/mYPcRAzeVN) | ||
* [The Graph Discord](https://discord.gg/vtvv7FP) | ||
* [StreamingFast on Twitter](https://twitter.com/streamingfastio) | ||
* [StreamingFast on YouTube](https://www.youtube.com/c/streamingfast) | ||
|
||
### Contributing | ||
|
||
For additional information, [refer to the general StreamingFast contribution guide](https://github.com/streamingfast/streamingfast/blob/master/CONTRIBUTING.md). | ||
|
||
### License | ||
|
||
Substreams uses the [Apache 2.0](../LICENSE/) license. | ||
|
||
### Disclaimer | ||
|
||
The content in the Substreams documentation was created through StreamingFast's full effort. It is up to the reader to validate the accuracy of all content presented. Substreams is in active development and, at times, the associated documentation becomes outdated. [Contact StreamingFast](https://discord.gg/mYPcRAzeVN) to report problems or service interruptions. | ||
|
||
{% hint style="info" %} | ||
**Note**: The Substreams documentation uses the [Google developer documentation style guide](https://developers.google.com/style) for its style and formatting. | ||
{% endhint %} |
This file was deleted.
Oops, something went wrong.
This file contains 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
Oops, something went wrong.