All packages
substreams_preflight_demo_xh

substreams_preflight_demo_xh

XuechunHHH
v0.1.0/21 downloads/Repository

Package ref

substreams-preflight-demo-xh@v0.1.0

Run package

CLI

Run graph_out from the command line.

substreams run substreams-preflight-demo-xh@v0.1.0 graph_out -e mainnet --start-block -1
Authenticate by running substreams auth or directly on thegraph.market (see docs).

README

substreams_preflight_demo_xh

Ethereum mainnet USDC transfers as typed records and canonical The Graph EntityChanges.

Overview

This package decodes ERC-20 Transfer events emitted by the USDC contract from block 18,000,000 onward. It emits raw token amounts as decimal strings and performs no RPC enrichment.

Modules

ModuleKindOutputDescription
map_usdc_transfersmapdemo.usdc.v1.UsdcTransfersDecodes typed USDC transfer records.
graph_outmapsf.substreams.sink.entity.v1.EntityChangesCreates UsdcTransfer entities with ID {tx_hash}-{log_index}.

Prerequisites

  • Substreams CLI
  • Rust with the wasm32-unknown-unknown target
  • buf and protoc
  • The Graph Market authentication for live runs

Quick Start

From the repository root:

npm run preflight -- \
  --intent demo/usdc-transfers-graph-out/substreams.intent.json \
  --project demo/usdc-transfers-graph-out

cd demo/usdc-transfers-graph-out
substreams build
substreams auth
. ./.substreams.env
substreams run ./substreams.yaml graph_out \
  --start-block 18000000 \
  --stop-block 18000101 \
  --output jsonl

The stop block is exclusive, so this command processes blocks 18,000,000 through 18,000,100.

Modules

Execution graph

2 modules
mapMain

graph_out

Emits canonical UsdcTransfer EntityChanges keyed by transaction hash and log index.

from #18000000

Output

sf.substreams.sink.entity.v1.EntityChanges