Overview
Goldsky is a high-performance data indexing provider for Stellar that makes it easy to extract, transform, and load on-chain data to power both application and analytics use cases via Mirror (real-time data replication pipelines).Scope
Goldsky has partnered with Stellar to make our product available to the ecosystem and provide dedicated support for Stellar data indexing. The full scope of our partnership (which products are enabled, what partner-exclusive benefit is available, and who this benefit is available to) is outlined below.Mirror | |
---|---|
Enablement | Yes |
Benefit | 10% discount on Pipeline workers and events written |
Availability | All developers |
Getting started
To use Goldsky, you’ll need to create an account, install the CLI, and log in.Install Goldsky's CLI and log in
Install Goldsky's CLI and log in
-
Install the Goldsky CLI:
For macOS/Linux:
For Windows:Windows users need to have Node.js and npm installed first. Download from nodejs.org if not already installed.
- Go to your Project Settings page and create an API key.
-
Back in your Goldsky CLI, log into your Project by running the command
goldsky login
and paste your API key. -
Now that you are logged in, run
goldsky
to get started:
Mirror
Mirror pipelines allow users to replicate data into their own infrastructure (any of the supported sinks) in real time. The supported data sources are the following direct indexing datasets: checkpoints, packages, transactions, epochs and events. These datasets have been created from ledger sequence 57837496 onwards. For a complete overview of how to deploy Mirror pipelines, including a video walkthrough, check the Create a Pipeline. Below, we will first look into the data model for Stellar primitives and then see some example implementation pipelines that you can use as a reference.Working with the Stellar V3 Datasets
After multiple iterations and feedback from the Stellar ecosystem, we’ve released V3 of our Stellar datasets. Unlike v1, which had a latency of 2-5 minutes, this new version is real time (<5 seconds). It also has a different data model designed to offer greater flexibility and convenience to better support a wide range of use cases. To understand these datasets, it’s important to first revisit the Ledger primitive—one of the core building blocks of the Stellar blockchain and the highest level of abstraction in our datasets.Need a refresher on Stellar data structures? Check out Stellar’s official documentation.
ledgers
dataset, which acts as the canonical dataset from which the other datasets derive. You can:
- Stream complete ledger data in a fully normalized way using the
ledgers
dataset, or - Work directly with specialized datasets that target specific structures:
transactions
events
balances
ledgers
functions as a “mega-schema,” allowing you to query all ledger data holistically or customize exactly which subsets of data you want.
Ledger V3 Schema
Ledger V3 Schema
ledgers
dataset here.
Let’s now look at some example pipelines using these datasets:
1. Deploying Stellar Transactions Using Goldsky Flow
As explained in Create a Pipeline, Goldsky Flow is the visual editor from which we can build and deploy Mirror pipelines. In this video we create a pipeline using Flow to stream into thetransactions
dataset into a ClickHouse instance.
2. Deploying Stellar Transactions Using the Goldsky CLI
An alternative way of deploying pipelines is using a pipeline definition file along with the command goldsky pipeline apply The example below demonstrates how you can stream the same inner transactions dataset directly (transactions
) exposed in previous example but instead using the master ledgers
dataset and ‘explode’ its data with the CROSS JOIN UNNEST
SQL command:
goldsky pipeline apply stellar-ledger-transactions.yaml --status ACTIVE
3. Deploying Stellar Balances Using the Goldsky CLI
Although balances are also directly exposed in the datasetbalances
, here’s the actual way these are computed directly from the master ledgers
dataset in case you’d like to create your own modification:
goldsky pipeline apply stellar_ledger_balances.yaml --status ACTIVE