Running
With the Docker image available and the configuration file set up, you're now ready to run Galexie and start exporting Stellar ledger data to the GCS bucket.
Command Line Usage
Append Command
This is the primary way of running Galexie. The append
command operates in two distinct modes:
- In continuous/unbounded mode, it starts exporting from the specified start ledger and continuously exports new ledgers that appear on the network until the process is interrupted.
- In fixed range mode, it exports the specified range of ledgers and exits when done.
Syntax:
stellar-galexie append --start <start_ledger> [--end <end_ledger>] [--config-file <config_file>]
Arguments:
--start <start_ledger>
(required)
- The starting ledger sequence number of the range being exported.
--end <end_ledger>
(optional)
- The ending ledger sequence number of the range being exported. If unspecified or set to 0, the exporter will continuously export new ledgers as they appear on the network.
--config-file <config_file_path>
(optional)
- The path to the configuration file. If unspecified, the application will look for a file named
config.toml
in the current directory.
Example usage:
docker run --platform linux/amd64 -d \
-v "$HOME/.config/gcloud/application_default_credentials.json":/.config/gcp/credentials.json:ro \
-e GOOGLE_APPLICATION_CREDENTIALS=/.config/gcp/credentials.json \
-v ${PWD}/config.toml:/config.toml \
stellar/stellar-galexie \
append --start 350000 --end 450000 --config-file config.toml
--platform linux/amd64
- Specifies the platform architecture (adjust if needed for your system).
-v
Mounts volumes to map your local GCP credentials and config.toml file to the container:
$HOME/.config/gcloud/application_default_credentials.json
: Your local GCP credentials file.${PWD}/config.toml
: Your local configuration file.
-e GOOGLE_APPLICATION_CREDENTIALS=/.config/gcp/credentials.json
- Sets the environment variable for credentials within the container.
stellar/stellar-galexie
- The Docker image name.
Data Integrity and Resumability:
The append command maintains strict sequential integrity within each export session. If interrupted and then restarted with the same range, it automatically resumes from where it left off before interruption, ensuring no ledgers are missed within a session.
Scan-and-fill Command
The scan-and-fill
command is useful in cases where there are gaps in the exported ledgers in the data lake. The command works by scanning all ledgers in the specified range, identifying missing ledgers and exporting only the missing ledgers while skipping existing ledgers in the data lake.
The append command ensures there are no gaps in the exported range. However, the gaps may occur in the data lake due to certain sequence of events, often due to user intervention, such as:
- Manual deletion of ledgers from the data lake. For example, deleting ledgers 80-90 out of the range 1-100.
- Running non-contiguous export ranges. For example, exporting ranges 1-50 and 60-100, leaving a gap between 50-60. In this case, running
append
command with the range 1-500 causes Galexie to resume export from from 101, without filling the gap.
Syntax:
stellar-galexie scan-and-fill --start <start_ledger> --end <end_ledger> [--config-file <config_file>]
Arguments:
--start <start_ledger>
(required)
- The starting ledger sequence number of the range being exported.
--end <end_ledger>
(required)
- The ending ledger sequence number of the range being exported.
--config-file <config_file_path>
(optional):
- The path to the configuration file. If unspecified, the exporter will look for a file named “config.toml” in the current directory.
Example usage:
docker run --platform linux/amd64 -d \
-v "$HOME/.config/gcloud/application_default_credentials.json":/.config/gcp/credentials.json:ro \
-e GOOGLE_APPLICATION_CREDENTIALS=/.config/gcp/credentials.json \
-v ${PWD}/config.toml:/config.toml \
stellar/stellar-galexie \
scan-and-fill --start 64000 --end 68000 --config-file config.toml