-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into giu/diataxis
- Loading branch information
Showing
26 changed files
with
316 additions
and
171 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
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,31 +1,19 @@ | ||
# syntax=docker/dockerfile:1.2 | ||
FROM --platform=$BUILDPLATFORM golang:1.23-bullseye AS build | ||
|
||
FROM rust:1.60-bullseye as rust | ||
WORKDIR /src | ||
|
||
FROM ubuntu:20.04 | ||
ARG TARGETOS TARGETARCH VERSION=dev | ||
|
||
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ | ||
DEBIAN_FRONTEND=noninteractive apt-get -y install \ | ||
gcc libssl-dev pkg-config protobuf-compiler \ | ||
ca-certificates libssl1.1 vim strace lsof curl jq && \ | ||
rm -rf /var/cache/apt /var/lib/apt/lists/* | ||
|
||
ENV RUSTUP_HOME=/usr/local/rustup \ | ||
CARGO_HOME=/usr/local/cargo \ | ||
PATH=/usr/local/cargo/bin:$PATH \ | ||
RUST_VERSION=1.60.0 | ||
RUN --mount=target=. \ | ||
--mount=type=cache,target=/root/.cache/go-build \ | ||
--mount=type=cache,target=/go/pkg \ | ||
GOOS=$TARGETOS GOARCH=$TARGETARCH go build -ldflags "-X \"main.version=$VERSION\"" -o /app/substreams ./cmd/substreams | ||
|
||
COPY --from=rust /usr/local/cargo /usr/local/cargo/ | ||
COPY --from=rust /usr/local/rustup /usr/local/rustup/ | ||
FROM ubuntu:22.04 | ||
|
||
# The `cargo install rustfmt || true` part serves the purposes of updating the crate registry, it's really | ||
# hard to update the registry standalone without a package, so we take a detour by installing a component | ||
# that will requires to update the crate registry | ||
RUN rustup target install wasm32-unknown-unknown && rustup component add rustfmt && cargo install rustfmt || true | ||
|
||
ADD /substreams /app/substreams | ||
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \ | ||
apt-get -y install -y ca-certificates libssl3 | ||
|
||
# ENV PATH "/app:$HOME/.cargo/bin:$PATH" | ||
ENV PATH "/app:/usr/local/cargo/bin:$PATH" | ||
COPY --from=build /app/substreams /app/substreams | ||
|
||
ENTRYPOINT ["/app/substreams"] |
This file was deleted.
Oops, something went wrong.
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
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
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
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
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
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,56 @@ | ||
In this guide, you'll learn how to initialize a MANTRA-based Substreams project. You’ll learn how to set up a simple project to extract raw data or filter events from a smart contract. | ||
|
||
## Prerequisites | ||
|
||
- Docker and VS Code installed and up-to-date. | ||
- Visit the [Getting Started Guide](https://github.com/streamingfast/substreams-starter) to initialize your Dev Container. | ||
|
||
## Step 1: Initialize Your MANTRA Substreams Project | ||
|
||
1. Open your Dev Container and run the following command to initialize your project: | ||
|
||
```bash | ||
substreams init | ||
``` | ||
|
||
2. You will be given the option to choose between two MANTRA project options. Select the one that best fits your requirements: | ||
- **MANTRA-minimal**: Creates a simple Substreams that extracts raw data from the block and generates Rust code. | ||
- **MANTRA-events**: Creates a Substreams that extracts MANTRA events using the cached [MANTRA Foundational Module](https://substreams.dev/packages/mantra-common/v0.1.0), filtered by one or more smart contract addresses. | ||
|
||
|
||
## Step 2: Visualize the Data | ||
|
||
1. Create your account [here](https://thegraph.market/) to generate an authentification token (JWT) and pass it as input to: | ||
|
||
```bash | ||
substreams auth | ||
``` | ||
|
||
2. Run the following command to visualize and itterate on your filtered data model: | ||
|
||
```bash | ||
substreams gui | ||
```` | ||
## Step 3: Customize your Project | ||
After initialization, you can: | ||
- Modify your Substreams manifest to include additional filters or configurations. | ||
- Implement custom processing logic in Rust based on the filtered data retrieved by the foundational module. | ||
## Additional Resources | ||
You may find these additional resources helpful for developing your first EVM application. | ||
### Dev Container Reference | ||
The [Dev Container Reference](../../references/devcontainer-ref.md) helps you navigate the complete container and its common errors. | ||
### GUI Reference | ||
The [GUI reference](../../references/gui.md) lets you explore all the tools available in the Substreams GUI. | ||
### Manifests Reference | ||
The [Manifests Reference](../../references/manifests.md) helps you with editing the `substreams.yaml`. |
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
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.