Export contract events to Postgres
The goldsky
CLI provides wizard to create pipelines. Based on the input you provide, the CLI generates a pipeline definition for you behind the scenes.
To create a new pipeline with the wizard, use the following command:
What you’ll need
- An idea of the data you’re interested in indexing (eg. contract address)
- A destination sink to write your data to
Walkthrough
Use the CLI wizard
In this example, we will create a pipeline that indexes Bored Ape Yacht Club contract events to a NeonDB (Postgres) database. This will include all transfers and other auxillary events associated to that address, with our ethereum decoded dataset as the source.
Initiate the wizard:
- Select a Data Source: Choose Direct Indexing.
- Choose Data Type: Opt for Ethereum - Decoded Logs.
- Data Processing Time: Pick Process data from the time this pipeline is created.
- Additional Sources: Select No when asked to add more sources.
- Data Filtering: Choose Yes, filter the indexed on-chain data.
- Contract Address: Enter the Bored Ape Yacht Club contract address,
0xbc4ca0eda7647a8ab7c2061c2e118a18a936f13d
, when prompted. - Transformation: Choose No when asked to add another transform.
- Set Up Sink: Choose Postgres. Remember to have a Postgres Neon DBinstance to connect to.
- Set Up Secret: Connect your sink by following the prompts or selecting an existing one. This information is stored in your Goldsky account.
- Choose Schema: Choose Yes to select default ‘public’ schema or choose your preferred alternative schema.
- Map Data to Sink Tables: Select Yes when asked to automatically map data to sink tables. Choose No if you wish to customize the table name.
- Additional Sinks: Select No when asked to add another sink.
Monitor the pipeline
Upon successful completion of these steps, an active pipeline is created. Data should start appearing in your database shortly. Monitor the table that is displayed. “RUNNING” status should appear after a minute or two. To monitor progress at any time, use:
Get the pipeline's definition
You can get the generated pipeline definition using:
Explore
For a full list of all available commands, use:
Can't find what you're looking for? Reach out to us at support@goldsky.com for help.
Was this page helpful?