generated from shuding/nextra-docs-template
-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #210 from sei-protocol/alexander-patch
Add Goldsky tutorial
- Loading branch information
Showing
7 changed files
with
136 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
{ | ||
"indexers": "Overview", | ||
"the-graph": "The Graph" | ||
"indexers": "Overview", | ||
"goldrush": "Goldrush", | ||
"goldsky": "Goldsky", | ||
"the-graph": "The Graph" | ||
} |
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 |
---|---|---|
@@ -0,0 +1,132 @@ | ||
import { ImageWithCaption } from '../../../components'; | ||
|
||
import goldskyImg1 from '../../../public/assets/ecosystem/resources/goldsky/goldsky_img_1.png'; | ||
import goldskyImg2 from '../../../public/assets/ecosystem/resources/goldsky/goldsky_img_2.png'; | ||
import goldskyImg3 from '../../../public/assets/ecosystem/resources/goldsky/goldsky_img_3.png'; | ||
import goldskyImg4 from '../../../public/assets/ecosystem/resources/goldsky/goldsky_img_4.png'; | ||
import goldskyImg5 from '../../../public/assets/ecosystem/resources/goldsky/goldsky_img_5.png'; | ||
|
||
## Goldsky | ||
|
||
Wondering how to best leverage Goldsky’s products? This guide explains the differences between them and how you can use them individually or together to meet your needs. | ||
|
||
Goldsky offers two flagship products, Subgraphs and Mirror, designed to help developers interact with Sei blockchain data more efficiently. While both tools serve similar goals - retrieving, processing, and querying blockchain data - they differ significantly in how they handle data management, scalability, and customization. | ||
|
||
Let’s dive into the difference in this guide and learn more about which solution is right for you. If you’re ready to get started, please visit [this page](https://docs.goldsky.com/chains/sei/?utm_source=sei&utm_medium=docs) for a quickstart guide on how to index Sei with Goldsky. | ||
|
||
--- | ||
|
||
## How to Choose Between Subgraphs and Mirror | ||
|
||
### **Subgraphs: Structured, Query-Based Data Retrieval** | ||
|
||
**Overview:** | ||
|
||
- On-chain data is restricted to EVM-compatible chains, so it’s only supported for Sei EVM. | ||
- The data model is optimized specifically for on-chain data. The entities and data types you define in subgraphs are tailored to represent blockchain data efficiently. | ||
- You can create relationships and aggregations between on-chain entities (e.g. track the balance of a user for specific tokens) | ||
- You can enrich entity data with other on-chain sources using **`eth_call`**. However, integrating off-chain data is not supported. | ||
|
||
**Examples:** | ||
|
||
- Retrieving all transactions related to a specific wallet address. | ||
- Querying detailed event logs from a smart contract, such as token transfers or contract interactions. | ||
- Building dashboards or analytics tools that require periodic data retrieval. | ||
|
||
**Key Advantages:** | ||
|
||
- **Customizable Data Models**: Define specific data structures to match your needs. | ||
- **Fast Query Response Times**: Queries return results quickly from pre-indexed data. | ||
- **Developer Flexibility**: Use GraphQL to create custom queries that fit your application’s needs. | ||
|
||
<ImageWithCaption img={goldskyImg1} alt="Goldsky Image 1" caption="" /> | ||
|
||
### **Mirror: Real-Time Data Streaming Pipelines** | ||
|
||
**Overview**: | ||
|
||
- The data model is flexible and open to any type of data. You can combine blockchain data with your own data seamlessly, offering more complex and customizable use cases. | ||
- Using Transforms, you can also perform some pre-processing using SQL dialect as well as doing external processing on your HTTP endpoint before writing to your database. | ||
- On-chain data is not restricted to EVMs. Mirror currently supports a variety of L1s as well, including Sui Cosmos. | ||
|
||
**Examples:** | ||
|
||
- Streaming every block’s data directly into a database for real-time analysis. | ||
- Capturing real-time price updates or liquidity changes in DeFi protocols. | ||
- Feeding live data into machine learning models for predictive analytics. | ||
|
||
**Key Advantages:** | ||
|
||
- **Real-Time Data Flow**: Data is pushed directly to your database as new events occur on-chain. | ||
- **Scalable Integration**: Supports ingestion of data from multiple blockchain networks into a centralized database. | ||
- **Minimal Latency**: Ideal for use cases where immediate data availability is crucial. | ||
|
||
<ImageWithCaption img={goldskyImg2} alt="Goldsky Image 2" caption="" /> | ||
|
||
### Mirror Data Sources Available | ||
|
||
**Sei EVM:** | ||
|
||
<ImageWithCaption img={goldskyImg3} alt="Goldsky Image 3" caption="" /> | ||
|
||
**Sei Cosmos:** | ||
|
||
<ImageWithCaption img={goldskyImg4} alt="Goldsky Image 4" caption="" /> | ||
|
||
### **Decision Guide: Subgraphs vs. Mirror** | ||
|
||
**Subgraphs** | ||
|
||
- If you need to query specific Sei EVM data points or historical records, Subgraphs are the way to go. | ||
- Best suited for applications that deal exclusively with on-chain data and don’t need integration with off-chain sources. | ||
- Ideal for predefined data models, such as dApps that need to query specific smart contract events or execute standard blockchain queries. | ||
- Great for low to moderate traffic scenarios with relatively straightforward data structures and querying needs. | ||
|
||
**Mirror** | ||
|
||
- A better fit for applications that require both on-chain and off-chain data, offering the flexibility to combine data sources for advanced analytics or decision-making. | ||
- Ideal for multi-chain applications, as it simplifies the process of managing data across different blockchains without the need for reindexing. This is specially true if your application needs non-EVM data like Sei Cosmos. | ||
- Perfect for high-traffic applications, where low latency and real-time data access are critical to the performance and user experience. | ||
|
||
**Example Use Case Comparison:** | ||
|
||
- **A DeFi Analytics Dashboard**: Use Subgraphs to retrieve historical liquidity data and user interactions. | ||
- **A Real-Time Trading Bot**: Use Mirror to stream price changes directly into your database for instant action. | ||
|
||
By understanding the strengths of each tool, you can select the right solution to match your project's data requirements. Goldsky is designed to offer flexibility, whether you need structured, queryable data or real-time data streams. Dive deeper into Subgraphs vs Mirror [here](https://docs.goldsky.com/subgraph-vs-mirror/?utm_source=sei&utm_medium=docs). | ||
|
||
--- | ||
|
||
## Getting Started | ||
|
||
1. Sign up for an account at [https://app.goldsky.com/signup](https://app.goldsky.com/signup). | ||
2. Install the Goldsky CLI: | ||
|
||
```jsx | ||
curl [https://goldsky.com](https://goldsky.com/) | sh | ||
``` | ||
|
||
3. Go to your [Project Settings](https://app.goldsky.com/dashboard/settings) page and create an API key. | ||
4. Back in your Goldsky CLI, log into your Project by running the command **`goldsky login`** and paste your API key. | ||
5. Now that you are logged in, run **`goldsky`** to get started. | ||
|
||
<ImageWithCaption img={goldskyImg5} alt="Goldsky Image 5" caption="" /> | ||
|
||
## Deploy a Subgraph | ||
|
||
There are three primary ways to deploy a Subgraph on Goldsky: | ||
|
||
1. From source code | ||
2. Migrating from The Graph or any other subgraph host | ||
3. Via instant, no-code subgraphs | ||
|
||
Navigate to [this page](https://docs.goldsky.com/subgraphs/deploying-subgraphs/?utm_source=sei&utm_medium=docs) to learn more about each way of deploying a Subgraph. | ||
|
||
## Deploy a Pipeline | ||
|
||
You have two options to create a Goldsky Mirror pipeline: | ||
|
||
1. **Flow**: With a guided web experience in the dashboard | ||
2. **CLI**: interactively or by providing a pipeline configuration | ||
|
||
Navigate to [this page](https://docs.goldsky.com/mirror/create-a-pipeline/?utm_source=sei&utm_medium=docs) to learn more about deploying Mirror pipelines. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.