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).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 loginand paste your API key. -
Now that you are logged in, run
goldskyto get started:
Mirror
Mirror pipelines allow users to replicate data into their own infrastructure (any of the supported sinks) in real time. 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 Datasets
Goldsky provides real time (<5 seconds) streaming of Stellar datasets, including all historical data, for both mainnet and testnet. Every Stellar dataset is derived from a mainLedgers dataset. Ledgers are 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.
transferstransactionsdiagnostic_eventseventsbalances
Working with
ledgers involves a certain level of SQL knowledge which is why it’s easier to directly work with the inner datasets directly using the dashboard experience whenever it’s possible.ledgers dataset itself. In essence, ledgers functions as a “mega-schema,” allowing you to query all ledger data holistically or customize exactly which subsets of data you want.
Ledger Schema
Ledger Schema
ledgers dataset here.
To use this dataset, choose stellar.ledgers as the dataset_name, specify latest version 3.1.0 and start_at as earliest or latest depending on whether you want historical data or data from the current tip of the chain:
1. Deploying Stellar inner datasets 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 example we create a pipeline using Flow to stream into thetransactions dataset into a ClickHouse instance.
Start from the pipelines page in your project and click on New Pipeline

Source card in to the canvas and select Stellar as the network:

Transactions

+ button on the source card and select a Sink

CLICKHOUSE_DEMO

transactions

stellar-transactions

Deploy button on the top right of your screen. You can deploy this pipeline with Small resource size.

Live and streaming data onto our sink


2. Advanced: examples using Stellar Ledgers on the CLI
As mentioned earlier, an alternative way of deploying pipelines is using a pipeline definition file and deploying them using the CLI. Working with theledgers dataset usually involves using a combination of CROSS JOIN UNNEST queries to “explode” and be able to access its inner structures. The example below demonstrates how we can replicate the transactions pipeline from the previous example using Goldsky Flow by exploding the data from the ledgers dataset:
balances but 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 <file_name> --status ACTIVE