Prefer a visual editor? You can build the same pipeline by dragging sources, transforms, and sinks onto a canvas with Goldsky Flow in the dashboard.
What you’ll need
- An idea of the data you’re interested in indexing (e.g. a contract address)
- A destination sink to write your data to; any Postgres database works, for example a Neon instance
- The Turbo Pipelines CLI extension installed and a Goldsky account, logged in to your project
Walkthrough
In this example, we will create a pipeline that indexes Bored Ape Yacht Club contract events to a Postgres database. This will include all transfers and other auxiliary events emitted by that address, using the Ethereum raw logs dataset as the source and decoding the events in a SQL transform.1
Create a secret
Store your Postgres credentials as a secret so the pipeline can connect to your database:When prompted, enter your Postgres connection string:See managing secrets for details. If you already have a secret, find its name with
goldsky secret list.2
Define the pipeline
Create a file named A quick tour of the pipeline:
bored-ape-events.yaml:bored-ape-events.yaml
- Source: the
ethereum.raw_logsdataset streams every event log on Ethereum.start_at: latestprocesses data from the time the pipeline is created; usestart_at: earliestwith a source-levelfilteron the contract address to backfill history via fast scan. - Transforms: the first transform filters to the BAYC contract address and decodes each log with
_gs_log_decode, fetching the ABI from Etherscan with_gs_fetch_abi(replaceYOUR_KEYwith your own Etherscan API key). The second transform unnests the decoded event name and parameters. For a deeper explanation of this decoding pattern, see Decode contract events. - Sink: writes the decoded events to the
public.bored_ape_eventstable, creating it automatically on first write. Changeschemaandtableif you prefer different names.
3
Validate and deploy
Check the configuration, then deploy:Pass
-i to apply to open the live inspect TUI right after deployment and watch events flow through each step.4
Monitor the pipeline
Upon successful completion of these steps, an active pipeline is created and data should start appearing in your database shortly. To check on it at any time:
5
Query your data
Connect to your Postgres database and query the decoded events:
6
Explore