Goals
- Ledger Metadata is stored on Google Cloud Storage(GCS).
- Downstream consumers need access to the latest network data with minimal latency.
- Ledger Metadata for each newly closed ledger on Stellar Testnet should be expediently exported to GCS.
- Deployment shall be fully on-cloud, use GCP for all storage and compute needs.
Solution - Publisher Pipeline
Run the Galexie Dockerhub image, stellar/stellar-galexie as an instance in GCP Compute Engines and export the ledger metadata to GCS bucket storage. Galexie in this example, performs the main roles of data pipeline. It acts as theorigin and publisher of ledger metadata to the Google Cloud Storage bucket which is the sink.
Prepare the Galexie configuration file locally
testnet-config.toml
Set default zone and project on gcloud
Do this once, so, you don’t have to repeat it on all further commands. Example commands assume this is done, ensuring all resources created are in the same GCP project and zone if applicable such as for compute.Store the galexie configuration file on a Compute Disk
Create a new GCP Compute disk which just holds the configuration file for Galexie. It will be used in proceeding step as a volume mount for the Galexie container to access it.Create a new gcloud bucket for storage of exported ledger metadata
Use gcloud to deploy and run Galexie as compute instance.
Configure the volume mount on the instance for Galexie to load configuration file from existing compute disk created in prior step. Specify the starting ledger sequence for Galexie to begin exporting ledger metadata, the requirements for this deloyment are to start with latest from network, which can be initially obtained from any block explorer, such as reported from steller.expert/explorer/testnet. In this example thee2-medium machine type, should suffice for Galexie Prerequisites.
Monitor Galexie export status
Proceed to the GCP console:Cloud Storage->Buckets, view the contents of the GCSgalexie-databucket, should see new files representing the latest ledger metadata from Testnet arriving in the bucket every minute.Compute Engine->Virtual Machines, check the log output ofgalexie-instance, you’ll seelevel=info msg="Uploaded ..lines indicating each time a new file of ledger metadata is uploaded to the GCS bucket.