- You read ledgers in bulk, for example for a backfill or an analytics job, and want to fetch objects from the bucket in parallel without an RPC server in the path.
- Your application is not written in Go, so it cannot use the ingest SDK, and you do not want to run Stellar RPC for history.
- You build a data store that other Stellar tools must be able to read.
Object keys
Galexie writes all ledger files under one configurable path in the bucket. Inside that path, each file sits in a partition directory:files_per_partition is 1.
Both the partition name and the batch name start with 8 hexadecimal digits. That value is 0xFFFFFFFF minus the first ledger sequence of the range. The subtraction reverses the order, so a listing returns the newest ledgers first. A client finds the latest ledger with one listing request and no index.
The partition name then repeats the first and last ledger sequence of the partition:
A data store does not necessarily hold the whole ledger history. List the oldest partition to find where its history starts.
File contents
Each ledger file is a Zstandard compressedLedgerCloseMetaBatch XDR value:
ledgersPerBatch value in the configuration file sets the number of ledgers in each batch. Batch ranges start at sequence 0, but Galexie exports from ledger 2, so the first batch of a data store can hold fewer ledgers than the rest. Refer to the XDR documentation for more information on the encoding.
Configuration file
SEP-54 requires a JSON configuration object at<ledgers-path>/.config.json. A client reads it to learn the batch and partition sizes before it builds any object key.
The Galexie configuration file names the last two values
ledgers_per_file and files_per_partition.
Data stores written by Galexie versions before v23.0.0 do not hold this file, and their object keys end in .xdr.zstd instead of .xdr.zst. A client that reads one must get the batch and partition sizes from its own configuration. The Go datastore package does that when the file is absent.
For example, the Pubnet data store in the public Stellar data lake holds one ledger per batch and 64,000 batches per partition:
v1.1/stellar/ledgers/pubnet/.config.json
The public Stellar data lake
A Stellar ledger data lake is available through the AWS Open Data program. The bucket is public and needs no credentials. The Pubnet ledgers sit in one data store:stellar xdr decode:
v1.1/stellar/ledgers/testnet/ to find the current reset directory, and use that directory as the <ledgers-path>. Some older reset directories have no .config.json. Read those as described in Configuration file.
Object metadata
Galexie also attaches metadata to each ledger object. The metadata lets a client filter objects without downloading them. Data stores that cannot hold user-defined object metadata, such as a plain file system, omit it.
On Amazon S3 these arrive as
x-amz-meta- response headers: