Sync contract events to a database with the contract ABI using Mirror.
Install Goldsky's CLI and log in
goldsky login
and paste your API key.
goldsky
to get started:
decoded_logs
and decoded_traces
direct indexing datasets. These are pre-decoded datasets, with coverage for common contracts, events, and functions.raw_logs
dataset and decode inside a pipeline transform._gs_fetch_abi
function call below, we pull from a gist. You can also pull from basescan directly with an api key. _gs_fetch_abi('<basescan-link>', 'etherscan'),
secret_name
(v2: secretName
). If you already created a secret, you can find it via the CLI command goldsky secret list
.decoded_events.friendtech
.id
, block_number
and transaction_hash
. Since its columns
topics
and data
are encoded we need to make use of the _gs_log_decode to decode the data. This function takes the following parameters:
topics
: as a second argument to the decode function we pass in the name of the column in our dataset that contains the topics as comma-separated string.
data
: as a third argument to the decode function we pass in the name of the column in our dataset that contains the encoded data.
decoded
which is a nested ROW with the properties event_param::TEXT[]
and event_signature::TEXT
. We create a second transform that reads from the resulting dataset of this first SELECT query to access the decoded data:
decoded IS NOT NULL
as a safety measure to discard processing potential issues in the decoding phase.
goldsky pipeline apply <yaml_file>
raw_log
and raw_traces
Direct Indexing datasets available (see list).
Goldsky also provides alternative decoding methods:
decoded_logs
and decoded_traces