What you’ll need
- A basic understanding of Turbo pipelines. If you’re new to the product, start with the quickstart.
- A basic understanding of SQL. Turbo SQL transforms run on Apache DataFusion.
- A destination sink to write your data to.
Preface
Two types of accounts can interact with transactions:- Externally Owned Accounts (EOA): controlled by an actual user.
- Contract Accounts: controlled by code.
Pipeline YAML
There is one transform in this configuration and we’ll explain how it works. If you copy and use this configuration file, make sure to update:- Your
secret_name. If you already created a secret, you can find it via the CLI commandgoldsky secret list. - The schema and table you want the data written to, by default it writes to
public.eth_transfers.
native-transfers.yaml
Native transfers transform
We’ll start at the top.Traces context columns
Transaction type
trace_address column to identify whether this is an initial EOA transaction or an internal one. This is also optional to include.
Token value
If you’re coming from a Flink-based pipeline, note that Turbo’s DataFusion SQL doesn’t require backtick-quoting columns like
value or data the way Flink did. See the SQL transforms documentation for the supported dialect.Filter
call_type <> 'delegatecall': delegatecall is a type of function call where the called contract’s code is executed with the state of the calling contract, including storage and balance. In some cases, it can mistakenly carry over the value transfer of the original calling contract which would compromise our data quality due to value transfer duplications. As a result, we can safely leave them out of our resulting dataset as delegatecalls can never send value with them.value > 0: we want to make sure we track transactions with actual native value.status = 1: the raw traces dataset can contain traces which got reverted. With this filter, we make sure to consider only successful transactions.