> ## Documentation Index
> Fetch the complete documentation index at: https://developers.stellar.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuring

> Specify the cloud storage service to be used to export ledger metadata.

## Steps to Configure Galexie

### Key Settings Include

#### Cloud Storage Service

Specify the cloud storage service to be used to export ledger metadata. Currently only `GCS` and `S3` are supported

```toml theme={"theme":{"light":"github-light","dark":"github-dark"}}
type = "GCS"
```

#### Cloud Storage Bucket

Specify the cloud storage bucket where Galexie will export Stellar ledger data. Update `destination_bucket_path` to the complete path of your bucket, including subpaths if applicable.

```toml theme={"theme":{"light":"github-light","dark":"github-dark"}}
destination_bucket_path = "stellar-network-data/testnet"
```

#### Stellar Network

Set the Stellar network to be used in creating the data lake.

```toml theme={"theme":{"light":"github-light","dark":"github-dark"}}
network = "testnet"
```

#### Data Organization (Optional)

Configure how the exported data is organized in the storage bucket. The example below adds 1 ledger per file and organizes them in a directory of 64000 files.

```toml theme={"theme":{"light":"github-light","dark":"github-dark"}}
# Number of ledgers stored in each file
ledgers_per_file = 1

# Number of files per partition/directory
files_per_partition = 64000
```

These two settings decide the object keys in the bucket. See [Data Lake Storage Format](https://developers.stellar.org/docs/data/indexers/build-your-own/galexie/data-lake-format.md) for the naming rules and for the `.config.json` file that records these values in the data lake.

#### Use a Custom Core Config (Optional)

You can specify a custom `core.cfg` file in the Galexie `config.toml` to use that will override the default core parameters used with the Stellar Network specified in the `network` parameter.

Copy an existing `core.cfg` file such as the `captive-core-pubnet.cfg` provided [here](https://github.com/stellar/go-stellar-sdk/blob/main/ingest/ledgerbackend/configs/captive-core-pubnet.cfg) and add the following to your `config.toml`

```toml theme={"theme":{"light":"github-light","dark":"github-dark"}}
captive_core_toml_path = "my-captive-core.cfg"
```

* Please see the [Choosing Your Quorum Set](https://developers.stellar.org/docs/validators/admin-guide/configuring.md#choosing-your-quorum-set) for more information about `core.cfg` quorum set configuration
* A list of customizable core parameters can be found [here](https://github.com/stellar/stellar-core/blob/master/src/main/Config.h)

The default `core.cfg` used by Galexie will enable the following core parameters:

* **BACKFILL\_RESTORE\_META -** ledger metadata will be populated with LedgerEntryChange RESTORE type for protocol versions prior to 23
* **ENABLE\_SOROBAN\_DIAGNOSTIC\_EVENTS -** additional diagnostic Soroban events that are not part of the protocol will be generated while applying Soroban transactions
* **EMIT\_SOROBAN\_TRANSACTION\_META\_EXT\_V1 -** Soroban extension V1 data will be emitted
* **EMIT\_LEDGER\_CLOSE\_META\_EXT\_V1 -** ledger metadata extension V1 data will be emitted
* **EMIT\_CLASSIC\_EVENTS -** classic events will be enabled and emitted for protocol `>= 23`
* **BACKFILL\_STELLAR\_ASSET\_EVENTS -** classic events will be enabled and emitted for protocol `<= 22`. This parameter also requires `EMIT_CLASSIC_EVENTS` to be enabled

> [!WARNING]
>
> When you provide a custom core configuration file, it completely replaces the Galexie's default core configuration. This means you must explicitly set any parameters you want to enable, including the ones that are enabled by default in Galexie. Any parameter not listed in your custom config will be set to false.

### Running Galexie on an Instance

#### 1. Copy the Sample Configuration

Start with the provided sample file, [`config.example.toml`](https://github.com/stellar/stellar-galexie/blob/main/config/config.example.toml).

#### 2. Rename and Update the Configuration

Rename the file to `config.toml` and adjust settings as needed.
