-
Notifications
You must be signed in to change notification settings - Fork 148
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New translations devcontainer.mdx (Vietnamese)
- Loading branch information
Showing
1 changed file
with
47 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- | ||
title: Substreams Dev Container | ||
--- | ||
|
||
Develop your first project with Substreams Dev Container. | ||
|
||
## What is a Dev Container? | ||
|
||
It's a tool to help you build your first project. You can either run it remotely through Github codespaces or locally by cloning the [substreams starter repository](https://github.com/streamingfast/substreams-starter?tab=readme-ov-file). | ||
|
||
Inside the Dev Container, the `substreams init` command sets up a code-generated Substreams project, allowing you to easily build a subgraph or an SQL-based solution for data handling. | ||
|
||
## Điều kiện tiên quyết | ||
|
||
- Ensure Docker and VS Code are up-to-date. | ||
|
||
## Navigating the Dev Container | ||
|
||
In the Dev Container, you can either build or import your own `substreams.yaml` and associate modules within the minimal path or opt for the automatically generated Substreams paths. Then, when you run the `Substreams Build` it will generate the Protobuf files. | ||
|
||
### Options | ||
|
||
- **Minimal**: Starts you with the raw block `.proto` and requires development. This path is intended for experienced users. | ||
- **Non-Minimal**: Extracts filtered data using network-specific cache and Protobufs from the corresponding Foundational Modules that are built and maintained by the StreamingFast team. | ||
|
||
To share your work with the broader community, publish your `.spkg` to [Substreams registry](https://substreams.dev/) using: | ||
|
||
- `substreams registry login` | ||
- `substreams registry publish` | ||
|
||
> Note: If you run into any problems within the Dev Container, use the `help` command to access trouble shooting tools. | ||
## Building a Sink for Your Project | ||
|
||
You can configure your project to query data either through a Subgraph or directly from an SQL database: | ||
|
||
- **Subgraph**: Run `substreams codegen subgraph`. This generates a project with a basic `schema.graphql` and `mappings.ts` file. You can customize these to define entities based on the data extracted by Substreams. For more configurations, see [subgraph sink documentation](https://docs.substreams.dev/how-to-guides/sinks/subgraph). | ||
- **SQL**: Run `substreams codegen sql` for SQL-based queries. For more information on configuring a SQL sink, refer to the [SQL documentation](https://docs.substreams.dev/how-to-guides/sinks/sql-sink). | ||
|
||
## Deployment Options | ||
|
||
To deploy a Subgraph, you can either run the `graph-node` locally using the `deploy-local` command or deploy to Subgraph Studio by using the `deploy` command found in the `package.json` file. | ||
|
||
## Common Errors | ||
|
||
- When running locally, make sure to verify that all Docker containers are healthy by running the `dev-status` command. | ||
- If you put the wrong start-block while generating your project, navigate to the `substreams.yaml` to change the block number, then re-run `substreams build`. |