name to something unique, swap in your own addresses and secret names, then validate and deploy:
dataset_name prefix for any other chain; see supported networks. For guidance on which shape fits your use case, see pipeline architecture patterns; for full field syntax, see the pipeline configuration reference.
Starters
Minimal ERC-20 stream
Use this to verify your setup end to end. It needs no credentials because the blackhole sink discards all data. Pair it with live inspection to watch data flow through.Filter transfers by token contract
Use this when you only care about specific tokens. Theaddress column on erc20_transfers holds the token contract address; compare against a lowercased literal.
- USDC:
0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 - WETH:
0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2 - DAI:
0x6B175474E89094C44Da98b954EedeAC495271d0F
Solana token transfers
Use this to stream SPL token transfers. Solana sources use slot numbers (start_block) instead of start_at; see Solana sources.
Turbo only: Solana datasets are exclusively available with the Turbo (Streamling) engine. They are not available in Mirror v1 pipelines.
Shaping patterns
Linear: decode contract events into Postgres
Use this when one source flows through a chain of transforms into one sink. It is the worked example of the linear pattern. It decodesOrderFilled events from an exchange contract into typed rows.
Fan-out: one source, multiple destinations
Use this when different consumers need different views of the same data. It is the worked example of the fan-out pattern. USDC transfers go to a ClickHouse warehouse; high-value transfers of any token go to an alerting webhook.Fan-in: unified activity feed
Use this when several event types should land in one table with a shared schema. It is the worked example of the fan-in pattern. It decodes four WETH event types and combines them withUNION ALL.
WETH activity feed
Multi-chain: combine Ethereum and Base
Use this for cross-chain analytics where multiple chains land in a single stream. Add a source per chain and anotherUNION ALL branch; use m for two chains and l as you add more.
Multi-chain templated: one pipeline per chain
Use this when you run the same logic on several chains but want independent deployment, checkpointing, and monitoring per chain. It is the worked example of the templated deployment pattern, which also lists exactly which values to swap per chain.ethereum-transfers.yaml
ethereum for base in the pipeline name, source key, dataset_name, the SQL chain literal, and the sink table, then apply both files.
Sinks and delivery
Stream transfers to PostgreSQL
Use this to land a dataset in your application database with no transformation. The table is created automatically if it doesn’t exist. Create the secret withgoldsky secret create MY_POSTGRES_SECRET; see the PostgreSQL sink page for hosted and bring-your-own database options.
Publish to Google Cloud Pub/Sub
Use this to feed GCP-based consumers. Before deploying (full details in the Pub/Sub sink reference):- Create the topic in your GCP project; Goldsky does not auto-create topics.
- Grant the service account both
roles/pubsub.publisherandroles/pubsub.viewer. The sink verifies the topic exists at startup, so a publish-only service account fails to initialize. - Store the project ID and service-account JSON as a secret:
goldsky secret create --name MY_PUBSUB_SECRET --type pubsub.
Archive, alert, and stream from one pipeline
Use this when the same source feeds several destinations at once: archive everything to Postgres, alert on large transfers via webhook, and stream to Kafka for event-driven consumers. Remove any sink you don’t need. Each sink needs its own secret; see the PostgreSQL, webhook, and Kafka sink pages.from: transfers) or from a transform (from: large_transfers). For when to use one pipeline with multiple sinks versus separate pipelines, see the fan-out pattern.
Transforms
Multi-event activity feed
Use this as a compact starting point for decoding multiple events from one contract into a unified table, here USDCTransfer and Approval events. It’s a smaller version of the fan-in pattern; adapt the ABI, address, and column mappings for your contract.
_gs_log_decode and other decoding helpers.
Throttle a high-volume webhook
Use this when a downstream service can’t keep up with the raw stream or enforces a rate limit. The throttle transform caps throughput at roughlymax_batch_size / min_batch_interval, here about 10 records per second. Place the throttle just before the rate-limited sink so upstream transforms still run at full speed. See throttle transforms for details.