From 6bd7e2af827395c19b4d45c53802ed16bb225cff Mon Sep 17 00:00:00 2001 From: Urvi Date: Wed, 12 Jun 2024 12:52:09 -0700 Subject: [PATCH 1/4] services/ledgerexporter: Move ledgerexporter out of experimental --- Makefile | 2 +- .../ledgerexporter/DEVELOPER_GUIDE.md | 0 {exp/services => services}/ledgerexporter/Makefile | 6 +++--- {exp/services => services}/ledgerexporter/README.md | 0 .../ledgerexporter/architecture.png | Bin .../ledgerexporter/config.example.toml | 0 .../ledgerexporter/docker/Dockerfile | 2 +- .../ledgerexporter/docker/config.test.toml | 0 .../ledgerexporter/internal/app.go | 0 .../ledgerexporter/internal/app_test.go | 0 .../ledgerexporter/internal/config.go | 0 .../ledgerexporter/internal/config_test.go | 0 .../ledgerexporter/internal/exportmanager.go | 0 .../ledgerexporter/internal/exportmanager_test.go | 0 .../ledgerexporter/internal/integration_test.go | 0 .../ledgerexporter/internal/ledger_meta_archive.go | 0 .../internal/ledger_meta_archive_test.go | 0 .../ledgerexporter/internal/main.go | 0 .../ledgerexporter/internal/main_test.go | 0 .../ledgerexporter/internal/queue.go | 0 .../ledgerexporter/internal/queue_test.go | 0 .../ledgerexporter/internal/test/10perfile.toml | 0 .../ledgerexporter/internal/test/15perfile.toml | 0 .../ledgerexporter/internal/test/1perfile.toml | 0 .../ledgerexporter/internal/test/64perfile.toml | 0 .../internal/test/captive-core-test.cfg | 0 .../internal/test/integration_captive_core.cfg | 0 .../internal/test/integration_config_template.toml | 0 .../test/invalid_captive_core_toml_path.toml | 0 .../ledgerexporter/internal/test/invalid_empty.toml | 0 .../test/invalid_preconfigured_network.toml | 0 .../ledgerexporter/internal/test/no_core_bin.toml | 0 .../ledgerexporter/internal/test/no_network.toml | 11 +++++++++++ .../ledgerexporter/internal/test/test.toml | 0 .../ledgerexporter/internal/test/useragent.toml | 0 .../internal/test/valid_captive_core_manual.toml | 0 .../internal/test/valid_captive_core_override.toml | 0 .../test/valid_captive_core_override_archives.toml | 0 .../test/valid_captive_core_preconfigured.toml | 0 .../internal/test/validate_start_end.toml | 0 .../ledgerexporter/internal/uploader.go | 0 .../ledgerexporter/internal/uploader_test.go | 0 {exp/services => services}/ledgerexporter/main.go | 2 +- 43 files changed, 17 insertions(+), 6 deletions(-) rename {exp/services => services}/ledgerexporter/DEVELOPER_GUIDE.md (100%) rename {exp/services => services}/ledgerexporter/Makefile (89%) rename {exp/services => services}/ledgerexporter/README.md (100%) rename {exp/services => services}/ledgerexporter/architecture.png (100%) rename {exp/services => services}/ledgerexporter/config.example.toml (100%) rename {exp/services => services}/ledgerexporter/docker/Dockerfile (93%) rename {exp/services => services}/ledgerexporter/docker/config.test.toml (100%) rename {exp/services => services}/ledgerexporter/internal/app.go (100%) rename {exp/services => services}/ledgerexporter/internal/app_test.go (100%) rename {exp/services => services}/ledgerexporter/internal/config.go (100%) rename {exp/services => services}/ledgerexporter/internal/config_test.go (100%) rename {exp/services => services}/ledgerexporter/internal/exportmanager.go (100%) rename {exp/services => services}/ledgerexporter/internal/exportmanager_test.go (100%) rename {exp/services => services}/ledgerexporter/internal/integration_test.go (100%) rename {exp/services => services}/ledgerexporter/internal/ledger_meta_archive.go (100%) rename {exp/services => services}/ledgerexporter/internal/ledger_meta_archive_test.go (100%) rename {exp/services => services}/ledgerexporter/internal/main.go (100%) rename {exp/services => services}/ledgerexporter/internal/main_test.go (100%) rename {exp/services => services}/ledgerexporter/internal/queue.go (100%) rename {exp/services => services}/ledgerexporter/internal/queue_test.go (100%) rename {exp/services => services}/ledgerexporter/internal/test/10perfile.toml (100%) rename {exp/services => services}/ledgerexporter/internal/test/15perfile.toml (100%) rename {exp/services => services}/ledgerexporter/internal/test/1perfile.toml (100%) rename {exp/services => services}/ledgerexporter/internal/test/64perfile.toml (100%) rename {exp/services => services}/ledgerexporter/internal/test/captive-core-test.cfg (100%) rename {exp/services => services}/ledgerexporter/internal/test/integration_captive_core.cfg (100%) rename {exp/services => services}/ledgerexporter/internal/test/integration_config_template.toml (100%) rename {exp/services => services}/ledgerexporter/internal/test/invalid_captive_core_toml_path.toml (100%) rename {exp/services => services}/ledgerexporter/internal/test/invalid_empty.toml (100%) rename {exp/services => services}/ledgerexporter/internal/test/invalid_preconfigured_network.toml (100%) rename {exp/services => services}/ledgerexporter/internal/test/no_core_bin.toml (100%) create mode 100644 services/ledgerexporter/internal/test/no_network.toml rename {exp/services => services}/ledgerexporter/internal/test/test.toml (100%) rename {exp/services => services}/ledgerexporter/internal/test/useragent.toml (100%) rename {exp/services => services}/ledgerexporter/internal/test/valid_captive_core_manual.toml (100%) rename {exp/services => services}/ledgerexporter/internal/test/valid_captive_core_override.toml (100%) rename {exp/services => services}/ledgerexporter/internal/test/valid_captive_core_override_archives.toml (100%) rename {exp/services => services}/ledgerexporter/internal/test/valid_captive_core_preconfigured.toml (100%) rename {exp/services => services}/ledgerexporter/internal/test/validate_start_end.toml (100%) rename {exp/services => services}/ledgerexporter/internal/uploader.go (100%) rename {exp/services => services}/ledgerexporter/internal/uploader_test.go (100%) rename {exp/services => services}/ledgerexporter/main.go (67%) diff --git a/Makefile b/Makefile index 69d46f68c3..63a9e94b6b 100644 --- a/Makefile +++ b/Makefile @@ -35,7 +35,7 @@ horizon: $(MAKE) -C services/horizon/ binary-build ledger-exporter: - $(MAKE) -C exp/services/ledgerexporter/ docker-build + $(MAKE) -C services/ledgerexporter/ docker-build webauth: $(MAKE) -C exp/services/webauth/ docker-build diff --git a/exp/services/ledgerexporter/DEVELOPER_GUIDE.md b/services/ledgerexporter/DEVELOPER_GUIDE.md similarity index 100% rename from exp/services/ledgerexporter/DEVELOPER_GUIDE.md rename to services/ledgerexporter/DEVELOPER_GUIDE.md diff --git a/exp/services/ledgerexporter/Makefile b/services/ledgerexporter/Makefile similarity index 89% rename from exp/services/ledgerexporter/Makefile rename to services/ledgerexporter/Makefile index 6561c4f24c..4d83897d9f 100644 --- a/exp/services/ledgerexporter/Makefile +++ b/services/ledgerexporter/Makefile @@ -6,11 +6,11 @@ VERSION ?= $(shell git rev-parse --short HEAD) DOCKER_IMAGE := stellar/ledger-exporter docker-build: - cd ../../../ && \ + cd ../../ && \ $(SUDO) docker build --platform linux/amd64 --pull --label org.opencontainers.image.created="$(BUILD_DATE)" \ - --build-arg GOFLAGS="-ldflags=-X=github.com/stellar/go/exp/services/ledgerexporter/internal.version=$(VERSION)" \ + --build-arg GOFLAGS="-ldflags=-X=github.com/stellar/go/services/ledgerexporter/internal.version=$(VERSION)" \ $(if $(STELLAR_CORE_VERSION), --build-arg STELLAR_CORE_VERSION=$(STELLAR_CORE_VERSION)) \ - -f exp/services/ledgerexporter/docker/Dockerfile \ + -f services/ledgerexporter/docker/Dockerfile \ -t $(DOCKER_IMAGE):$(VERSION) \ -t $(DOCKER_IMAGE):latest . diff --git a/exp/services/ledgerexporter/README.md b/services/ledgerexporter/README.md similarity index 100% rename from exp/services/ledgerexporter/README.md rename to services/ledgerexporter/README.md diff --git a/exp/services/ledgerexporter/architecture.png b/services/ledgerexporter/architecture.png similarity index 100% rename from exp/services/ledgerexporter/architecture.png rename to services/ledgerexporter/architecture.png diff --git a/exp/services/ledgerexporter/config.example.toml b/services/ledgerexporter/config.example.toml similarity index 100% rename from exp/services/ledgerexporter/config.example.toml rename to services/ledgerexporter/config.example.toml diff --git a/exp/services/ledgerexporter/docker/Dockerfile b/services/ledgerexporter/docker/Dockerfile similarity index 93% rename from exp/services/ledgerexporter/docker/Dockerfile rename to services/ledgerexporter/docker/Dockerfile index 7144800d87..fea21d86c5 100644 --- a/exp/services/ledgerexporter/docker/Dockerfile +++ b/services/ledgerexporter/docker/Dockerfile @@ -10,7 +10,7 @@ RUN go mod download COPY . ./ ARG GOFLAGS -RUN go install github.com/stellar/go/exp/services/ledgerexporter +RUN go install github.com/stellar/go/services/ledgerexporter FROM ubuntu:22.04 ARG STELLAR_CORE_VERSION diff --git a/exp/services/ledgerexporter/docker/config.test.toml b/services/ledgerexporter/docker/config.test.toml similarity index 100% rename from exp/services/ledgerexporter/docker/config.test.toml rename to services/ledgerexporter/docker/config.test.toml diff --git a/exp/services/ledgerexporter/internal/app.go b/services/ledgerexporter/internal/app.go similarity index 100% rename from exp/services/ledgerexporter/internal/app.go rename to services/ledgerexporter/internal/app.go diff --git a/exp/services/ledgerexporter/internal/app_test.go b/services/ledgerexporter/internal/app_test.go similarity index 100% rename from exp/services/ledgerexporter/internal/app_test.go rename to services/ledgerexporter/internal/app_test.go diff --git a/exp/services/ledgerexporter/internal/config.go b/services/ledgerexporter/internal/config.go similarity index 100% rename from exp/services/ledgerexporter/internal/config.go rename to services/ledgerexporter/internal/config.go diff --git a/exp/services/ledgerexporter/internal/config_test.go b/services/ledgerexporter/internal/config_test.go similarity index 100% rename from exp/services/ledgerexporter/internal/config_test.go rename to services/ledgerexporter/internal/config_test.go diff --git a/exp/services/ledgerexporter/internal/exportmanager.go b/services/ledgerexporter/internal/exportmanager.go similarity index 100% rename from exp/services/ledgerexporter/internal/exportmanager.go rename to services/ledgerexporter/internal/exportmanager.go diff --git a/exp/services/ledgerexporter/internal/exportmanager_test.go b/services/ledgerexporter/internal/exportmanager_test.go similarity index 100% rename from exp/services/ledgerexporter/internal/exportmanager_test.go rename to services/ledgerexporter/internal/exportmanager_test.go diff --git a/exp/services/ledgerexporter/internal/integration_test.go b/services/ledgerexporter/internal/integration_test.go similarity index 100% rename from exp/services/ledgerexporter/internal/integration_test.go rename to services/ledgerexporter/internal/integration_test.go diff --git a/exp/services/ledgerexporter/internal/ledger_meta_archive.go b/services/ledgerexporter/internal/ledger_meta_archive.go similarity index 100% rename from exp/services/ledgerexporter/internal/ledger_meta_archive.go rename to services/ledgerexporter/internal/ledger_meta_archive.go diff --git a/exp/services/ledgerexporter/internal/ledger_meta_archive_test.go b/services/ledgerexporter/internal/ledger_meta_archive_test.go similarity index 100% rename from exp/services/ledgerexporter/internal/ledger_meta_archive_test.go rename to services/ledgerexporter/internal/ledger_meta_archive_test.go diff --git a/exp/services/ledgerexporter/internal/main.go b/services/ledgerexporter/internal/main.go similarity index 100% rename from exp/services/ledgerexporter/internal/main.go rename to services/ledgerexporter/internal/main.go diff --git a/exp/services/ledgerexporter/internal/main_test.go b/services/ledgerexporter/internal/main_test.go similarity index 100% rename from exp/services/ledgerexporter/internal/main_test.go rename to services/ledgerexporter/internal/main_test.go diff --git a/exp/services/ledgerexporter/internal/queue.go b/services/ledgerexporter/internal/queue.go similarity index 100% rename from exp/services/ledgerexporter/internal/queue.go rename to services/ledgerexporter/internal/queue.go diff --git a/exp/services/ledgerexporter/internal/queue_test.go b/services/ledgerexporter/internal/queue_test.go similarity index 100% rename from exp/services/ledgerexporter/internal/queue_test.go rename to services/ledgerexporter/internal/queue_test.go diff --git a/exp/services/ledgerexporter/internal/test/10perfile.toml b/services/ledgerexporter/internal/test/10perfile.toml similarity index 100% rename from exp/services/ledgerexporter/internal/test/10perfile.toml rename to services/ledgerexporter/internal/test/10perfile.toml diff --git a/exp/services/ledgerexporter/internal/test/15perfile.toml b/services/ledgerexporter/internal/test/15perfile.toml similarity index 100% rename from exp/services/ledgerexporter/internal/test/15perfile.toml rename to services/ledgerexporter/internal/test/15perfile.toml diff --git a/exp/services/ledgerexporter/internal/test/1perfile.toml b/services/ledgerexporter/internal/test/1perfile.toml similarity index 100% rename from exp/services/ledgerexporter/internal/test/1perfile.toml rename to services/ledgerexporter/internal/test/1perfile.toml diff --git a/exp/services/ledgerexporter/internal/test/64perfile.toml b/services/ledgerexporter/internal/test/64perfile.toml similarity index 100% rename from exp/services/ledgerexporter/internal/test/64perfile.toml rename to services/ledgerexporter/internal/test/64perfile.toml diff --git a/exp/services/ledgerexporter/internal/test/captive-core-test.cfg b/services/ledgerexporter/internal/test/captive-core-test.cfg similarity index 100% rename from exp/services/ledgerexporter/internal/test/captive-core-test.cfg rename to services/ledgerexporter/internal/test/captive-core-test.cfg diff --git a/exp/services/ledgerexporter/internal/test/integration_captive_core.cfg b/services/ledgerexporter/internal/test/integration_captive_core.cfg similarity index 100% rename from exp/services/ledgerexporter/internal/test/integration_captive_core.cfg rename to services/ledgerexporter/internal/test/integration_captive_core.cfg diff --git a/exp/services/ledgerexporter/internal/test/integration_config_template.toml b/services/ledgerexporter/internal/test/integration_config_template.toml similarity index 100% rename from exp/services/ledgerexporter/internal/test/integration_config_template.toml rename to services/ledgerexporter/internal/test/integration_config_template.toml diff --git a/exp/services/ledgerexporter/internal/test/invalid_captive_core_toml_path.toml b/services/ledgerexporter/internal/test/invalid_captive_core_toml_path.toml similarity index 100% rename from exp/services/ledgerexporter/internal/test/invalid_captive_core_toml_path.toml rename to services/ledgerexporter/internal/test/invalid_captive_core_toml_path.toml diff --git a/exp/services/ledgerexporter/internal/test/invalid_empty.toml b/services/ledgerexporter/internal/test/invalid_empty.toml similarity index 100% rename from exp/services/ledgerexporter/internal/test/invalid_empty.toml rename to services/ledgerexporter/internal/test/invalid_empty.toml diff --git a/exp/services/ledgerexporter/internal/test/invalid_preconfigured_network.toml b/services/ledgerexporter/internal/test/invalid_preconfigured_network.toml similarity index 100% rename from exp/services/ledgerexporter/internal/test/invalid_preconfigured_network.toml rename to services/ledgerexporter/internal/test/invalid_preconfigured_network.toml diff --git a/exp/services/ledgerexporter/internal/test/no_core_bin.toml b/services/ledgerexporter/internal/test/no_core_bin.toml similarity index 100% rename from exp/services/ledgerexporter/internal/test/no_core_bin.toml rename to services/ledgerexporter/internal/test/no_core_bin.toml diff --git a/services/ledgerexporter/internal/test/no_network.toml b/services/ledgerexporter/internal/test/no_network.toml new file mode 100644 index 0000000000..1cb591cdd4 --- /dev/null +++ b/services/ledgerexporter/internal/test/no_network.toml @@ -0,0 +1,11 @@ + +[datastore_config] +type = "ABC" + +[datastore_config.params] +destination_bucket_path = "your-bucket-name/subpath" + +[exporter_config] +ledgers_per_file = 3 +files_per_partition = 1 +file_suffix = ".xdr.gz" \ No newline at end of file diff --git a/exp/services/ledgerexporter/internal/test/test.toml b/services/ledgerexporter/internal/test/test.toml similarity index 100% rename from exp/services/ledgerexporter/internal/test/test.toml rename to services/ledgerexporter/internal/test/test.toml diff --git a/exp/services/ledgerexporter/internal/test/useragent.toml b/services/ledgerexporter/internal/test/useragent.toml similarity index 100% rename from exp/services/ledgerexporter/internal/test/useragent.toml rename to services/ledgerexporter/internal/test/useragent.toml diff --git a/exp/services/ledgerexporter/internal/test/valid_captive_core_manual.toml b/services/ledgerexporter/internal/test/valid_captive_core_manual.toml similarity index 100% rename from exp/services/ledgerexporter/internal/test/valid_captive_core_manual.toml rename to services/ledgerexporter/internal/test/valid_captive_core_manual.toml diff --git a/exp/services/ledgerexporter/internal/test/valid_captive_core_override.toml b/services/ledgerexporter/internal/test/valid_captive_core_override.toml similarity index 100% rename from exp/services/ledgerexporter/internal/test/valid_captive_core_override.toml rename to services/ledgerexporter/internal/test/valid_captive_core_override.toml diff --git a/exp/services/ledgerexporter/internal/test/valid_captive_core_override_archives.toml b/services/ledgerexporter/internal/test/valid_captive_core_override_archives.toml similarity index 100% rename from exp/services/ledgerexporter/internal/test/valid_captive_core_override_archives.toml rename to services/ledgerexporter/internal/test/valid_captive_core_override_archives.toml diff --git a/exp/services/ledgerexporter/internal/test/valid_captive_core_preconfigured.toml b/services/ledgerexporter/internal/test/valid_captive_core_preconfigured.toml similarity index 100% rename from exp/services/ledgerexporter/internal/test/valid_captive_core_preconfigured.toml rename to services/ledgerexporter/internal/test/valid_captive_core_preconfigured.toml diff --git a/exp/services/ledgerexporter/internal/test/validate_start_end.toml b/services/ledgerexporter/internal/test/validate_start_end.toml similarity index 100% rename from exp/services/ledgerexporter/internal/test/validate_start_end.toml rename to services/ledgerexporter/internal/test/validate_start_end.toml diff --git a/exp/services/ledgerexporter/internal/uploader.go b/services/ledgerexporter/internal/uploader.go similarity index 100% rename from exp/services/ledgerexporter/internal/uploader.go rename to services/ledgerexporter/internal/uploader.go diff --git a/exp/services/ledgerexporter/internal/uploader_test.go b/services/ledgerexporter/internal/uploader_test.go similarity index 100% rename from exp/services/ledgerexporter/internal/uploader_test.go rename to services/ledgerexporter/internal/uploader_test.go diff --git a/exp/services/ledgerexporter/main.go b/services/ledgerexporter/main.go similarity index 67% rename from exp/services/ledgerexporter/main.go rename to services/ledgerexporter/main.go index 6d38c69df9..04cb23c637 100644 --- a/exp/services/ledgerexporter/main.go +++ b/services/ledgerexporter/main.go @@ -4,7 +4,7 @@ import ( "fmt" "os" - exporter "github.com/stellar/go/exp/services/ledgerexporter/internal" + exporter "github.com/stellar/go/services/ledgerexporter/internal" ) func main() { From 947b69ef9410dbb9d06faf9bc0ea9af705bc77b6 Mon Sep 17 00:00:00 2001 From: Urvi Date: Wed, 12 Jun 2024 13:31:15 -0700 Subject: [PATCH 2/4] Add CHANGELOG.md --- services/ledgerexporter/CHANGELOG.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 services/ledgerexporter/CHANGELOG.md diff --git a/services/ledgerexporter/CHANGELOG.md b/services/ledgerexporter/CHANGELOG.md new file mode 100644 index 0000000000..e69de29bb2 From cc81adea35528a0f56285c5f8d7b0645e70cd4b9 Mon Sep 17 00:00:00 2001 From: Urvi Date: Mon, 15 Jul 2024 17:17:08 -0700 Subject: [PATCH 3/4] Fix git workflow --- .github/workflows/ledgerexporter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ledgerexporter.yml b/.github/workflows/ledgerexporter.yml index ac1e265582..ff970ae96e 100644 --- a/.github/workflows/ledgerexporter.yml +++ b/.github/workflows/ledgerexporter.yml @@ -43,4 +43,4 @@ jobs: ref: ${{ github.event.pull_request.head.sha || github.ref }} - name: Run Ledger Exporter test - run: go test -v -race -run TestLedgerExporterTestSuite ./exp/services/ledgerexporter/... + run: go test -v -race -run TestLedgerExporterTestSuite ./services/ledgerexporter/... From 949c907c8779d3e1bf15ccf367e8cf6cade2eed8 Mon Sep 17 00:00:00 2001 From: Urvi Date: Tue, 16 Jul 2024 09:31:16 -0700 Subject: [PATCH 4/4] Rename Ledgerexporter to Galexie --- ...porter-release.yml => galexie-release.yml} | 28 +++++----- .../{ledgerexporter.yml => galexie.yml} | 23 ++++---- Makefile | 4 +- .../{ledgerexporter => galexie}/CHANGELOG.md | 0 .../DEVELOPER_GUIDE.md | 34 ++++++------ services/{ledgerexporter => galexie}/Makefile | 22 ++++---- .../{ledgerexporter => galexie}/README.md | 48 ++++++++--------- .../architecture.png | Bin .../config.example.toml | 0 .../docker/Dockerfile | 6 +-- .../docker/config.test.toml | 0 .../internal/app.go | 17 +++--- .../internal/app_test.go | 2 +- .../internal/config.go | 6 +-- .../internal/config_test.go | 4 +- .../internal/exportmanager.go | 4 +- .../internal/exportmanager_test.go | 2 +- .../internal/integration_test.go | 50 +++++++++--------- .../internal/ledger_meta_archive.go | 2 +- .../internal/ledger_meta_archive_test.go | 2 +- .../internal/main.go | 10 ++-- .../internal/main_test.go | 6 +-- .../internal/queue.go | 4 +- .../internal/queue_test.go | 2 +- .../internal/test/10perfile.toml | 0 .../internal/test/15perfile.toml | 0 .../internal/test/1perfile.toml | 0 .../internal/test/64perfile.toml | 0 .../internal/test/captive-core-test.cfg | 0 .../test/integration_captive_core.cfg | 0 .../test/integration_config_template.toml | 0 .../test/invalid_captive_core_toml_path.toml | 0 .../internal/test/invalid_empty.toml | 0 .../test/invalid_preconfigured_network.toml | 0 .../internal/test/no_core_bin.toml | 0 .../internal/test/no_network.toml | 0 .../internal/test/test.toml | 0 .../internal/test/useragent.toml | 0 .../test/valid_captive_core_manual.toml | 0 .../test/valid_captive_core_override.toml | 0 .../valid_captive_core_override_archives.toml | 0 .../valid_captive_core_preconfigured.toml | 0 .../internal/test/validate_start_end.toml | 0 .../internal/uploader.go | 8 +-- .../internal/uploader_test.go | 2 +- services/{ledgerexporter => galexie}/main.go | 4 +- 46 files changed, 145 insertions(+), 145 deletions(-) rename .github/workflows/{ledgerexporter-release.yml => galexie-release.yml} (63%) rename .github/workflows/{ledgerexporter.yml => galexie.yml} (66%) rename services/{ledgerexporter => galexie}/CHANGELOG.md (100%) rename services/{ledgerexporter => galexie}/DEVELOPER_GUIDE.md (54%) rename services/{ledgerexporter => galexie}/Makefile (74%) rename services/{ledgerexporter => galexie}/README.md (76%) rename services/{ledgerexporter => galexie}/architecture.png (100%) rename services/{ledgerexporter => galexie}/config.example.toml (100%) rename services/{ledgerexporter => galexie}/docker/Dockerfile (84%) rename services/{ledgerexporter => galexie}/docker/config.test.toml (100%) rename services/{ledgerexporter => galexie}/internal/app.go (96%) rename services/{ledgerexporter => galexie}/internal/app_test.go (99%) rename services/{ledgerexporter => galexie}/internal/config.go (99%) rename services/{ledgerexporter => galexie}/internal/config_test.go (99%) rename services/{ledgerexporter => galexie}/internal/exportmanager.go (97%) rename services/{ledgerexporter => galexie}/internal/exportmanager_test.go (99%) rename services/{ledgerexporter => galexie}/internal/integration_test.go (84%) rename services/{ledgerexporter => galexie}/internal/ledger_meta_archive.go (98%) rename services/{ledgerexporter => galexie}/internal/ledger_meta_archive_test.go (98%) rename services/{ledgerexporter => galexie}/internal/main.go (95%) rename services/{ledgerexporter => galexie}/internal/main_test.go (95%) rename services/{ledgerexporter => galexie}/internal/queue.go (96%) rename services/{ledgerexporter => galexie}/internal/queue_test.go (98%) rename services/{ledgerexporter => galexie}/internal/test/10perfile.toml (100%) rename services/{ledgerexporter => galexie}/internal/test/15perfile.toml (100%) rename services/{ledgerexporter => galexie}/internal/test/1perfile.toml (100%) rename services/{ledgerexporter => galexie}/internal/test/64perfile.toml (100%) rename services/{ledgerexporter => galexie}/internal/test/captive-core-test.cfg (100%) rename services/{ledgerexporter => galexie}/internal/test/integration_captive_core.cfg (100%) rename services/{ledgerexporter => galexie}/internal/test/integration_config_template.toml (100%) rename services/{ledgerexporter => galexie}/internal/test/invalid_captive_core_toml_path.toml (100%) rename services/{ledgerexporter => galexie}/internal/test/invalid_empty.toml (100%) rename services/{ledgerexporter => galexie}/internal/test/invalid_preconfigured_network.toml (100%) rename services/{ledgerexporter => galexie}/internal/test/no_core_bin.toml (100%) rename services/{ledgerexporter => galexie}/internal/test/no_network.toml (100%) rename services/{ledgerexporter => galexie}/internal/test/test.toml (100%) rename services/{ledgerexporter => galexie}/internal/test/useragent.toml (100%) rename services/{ledgerexporter => galexie}/internal/test/valid_captive_core_manual.toml (100%) rename services/{ledgerexporter => galexie}/internal/test/valid_captive_core_override.toml (100%) rename services/{ledgerexporter => galexie}/internal/test/valid_captive_core_override_archives.toml (100%) rename services/{ledgerexporter => galexie}/internal/test/valid_captive_core_preconfigured.toml (100%) rename services/{ledgerexporter => galexie}/internal/test/validate_start_end.toml (100%) rename services/{ledgerexporter => galexie}/internal/uploader.go (94%) rename services/{ledgerexporter => galexie}/internal/uploader_test.go (99%) rename services/{ledgerexporter => galexie}/main.go (56%) diff --git a/.github/workflows/ledgerexporter-release.yml b/.github/workflows/galexie-release.yml similarity index 63% rename from .github/workflows/ledgerexporter-release.yml rename to .github/workflows/galexie-release.yml index 8738f53def..45e8152690 100644 --- a/.github/workflows/ledgerexporter-release.yml +++ b/.github/workflows/galexie-release.yml @@ -1,26 +1,26 @@ -name: Ledger Exporter release +name: Galexie Release on: push: - tags: ['ledgerexporter-v*'] + tags: ['galexie-v*'] jobs: publish-docker: - name: Test and push the Ledger Exporter images + name: Test and push docker image runs-on: ubuntu-latest env: - LEDGEREXPORTER_INTEGRATION_TESTS_ENABLED: "true" - LEDGEREXPORTER_INTEGRATION_TESTS_CAPTIVE_CORE_BIN: /usr/bin/stellar-core + GALEXIE_INTEGRATION_TESTS_ENABLED: "true" + GALEXIE_INTEGRATION_TESTS_CAPTIVE_CORE_BIN: /usr/bin/stellar-core # this pins to a version of quickstart:testing that has the same version as STELLAR_CORE_VERSION # this is the multi-arch index sha, get it by 'docker buildx imagetools inspect stellar/quickstart:testing' - LEDGEREXPORTER_INTEGRATION_TESTS_QUICKSTART_IMAGE: docker.io/stellar/quickstart:testing@sha256:03c6679f838a92b1eda4cd3a9e2bdee4c3586e278a138a0acf36a9bc99a0041f - LEDGEREXPORTER_INTEGRATION_TESTS_QUICKSTART_IMAGE_PULL: "false" + GALEXIE_INTEGRATION_TESTS_QUICKSTART_IMAGE: docker.io/stellar/quickstart:testing@sha256:03c6679f838a92b1eda4cd3a9e2bdee4c3586e278a138a0acf36a9bc99a0041f + GALEXIE_INTEGRATION_TESTS_QUICKSTART_IMAGE_PULL: "false" STELLAR_CORE_VERSION: 21.1.0-1921.b3aeb14cc.focal steps: - name: Set VERSION run: | - echo "VERSION=${GITHUB_REF_NAME#ledgerexporter-v}" >> $GITHUB_ENV + echo "VERSION=${GITHUB_REF_NAME#galexie-v}" >> $GITHUB_ENV - uses: actions/checkout@v3 with: @@ -28,7 +28,7 @@ jobs: - name: Pull Quickstart image shell: bash run: | - docker pull "$LEDGEREXPORTER_INTEGRATION_TESTS_QUICKSTART_IMAGE" + docker pull "$GALEXIE_INTEGRATION_TESTS_QUICKSTART_IMAGE" - name: Install captive core run: | # Workaround for https://github.com/actions/virtual-environments/issues/5245, @@ -42,11 +42,11 @@ jobs: sudo apt-get update && sudo apt-get install -y stellar-core="$STELLAR_CORE_VERSION" echo "Using stellar core version $(stellar-core version)" - - name: Run Ledger Exporter test - run: go test -v -race -run TestLedgerExporterTestSuite ./exp/services/ledgerexporter/... + - name: Run tests + run: go test -v -race -run TestGalexieTestSuite ./exp/services/galexie/... - - name: Build Ledger Exporter docker - run: make -C exp/services/ledgerexporter docker-build + - name: Build docker + run: make -C exp/services/galexie docker-build # Push images - name: Login to DockerHub @@ -56,4 +56,4 @@ jobs: password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Push to DockerHub - run: make -C exp/services/ledgerexporter docker-push + run: make -C exp/services/galexie docker-push diff --git a/.github/workflows/ledgerexporter.yml b/.github/workflows/galexie.yml similarity index 66% rename from .github/workflows/ledgerexporter.yml rename to .github/workflows/galexie.yml index ff970ae96e..458f23ca37 100644 --- a/.github/workflows/ledgerexporter.yml +++ b/.github/workflows/galexie.yml @@ -1,4 +1,4 @@ -name: LedgerExporter +name: Galexie on: push: @@ -6,18 +6,17 @@ on: pull_request: jobs: - ledger-exporter: - name: Test Ledger Exporter + galexie: + name: Test runs-on: ubuntu-latest env: CAPTIVE_CORE_DEBIAN_PKG_VERSION: 21.1.0-1921.b3aeb14cc.focal - LEDGEREXPORTER_INTEGRATION_TESTS_ENABLED: "true" - LEDGEREXPORTER_INTEGRATION_TESTS_CAPTIVE_CORE_BIN: /usr/bin/stellar-core - # this pins to a version of quickstart:testing that has the same version of core - # as specified on LEDGEREXPORTER_INTEGRATION_TESTS_CAPTIVE_CORE_BIN + GALEXIE_INTEGRATION_TESTS_ENABLED: "true" + GALEXIE_INTEGRATION_TESTS_CAPTIVE_CORE_BIN: /usr/bin/stellar-core + # this pins to a version of quickstart:testing that has the same version as GALEXIE_INTEGRATION_TESTS_CAPTIVE_CORE_BIN # this is the multi-arch index sha, get it by 'docker buildx imagetools inspect stellar/quickstart:testing' - LEDGEREXPORTER_INTEGRATION_TESTS_QUICKSTART_IMAGE: docker.io/stellar/quickstart:testing@sha256:5c8186f53cc98571749054dd782dce33b0aca2d1a622a7610362f7c15b79b1bf - LEDGEREXPORTER_INTEGRATION_TESTS_QUICKSTART_IMAGE_PULL: "false" + GALEXIE_INTEGRATION_TESTS_QUICKSTART_IMAGE: docker.io/stellar/quickstart:testing@sha256:5c8186f53cc98571749054dd782dce33b0aca2d1a622a7610362f7c15b79b1bf + GALEXIE_INTEGRATION_TESTS_QUICKSTART_IMAGE_PULL: "false" steps: - name: Install captive core run: | @@ -35,12 +34,12 @@ jobs: - name: Pull Quickstart image shell: bash run: | - docker pull "$LEDGEREXPORTER_INTEGRATION_TESTS_QUICKSTART_IMAGE" + docker pull "$GALEXIE_INTEGRATION_TESTS_QUICKSTART_IMAGE" - uses: actions/checkout@v3 with: # For pull requests, build and test the PR head not a merge of the PR with the destination. ref: ${{ github.event.pull_request.head.sha || github.ref }} - - name: Run Ledger Exporter test - run: go test -v -race -run TestLedgerExporterTestSuite ./services/ledgerexporter/... + - name: Run test + run: go test -v -race -run TestGalexieTestSuite ./services/galexie/... diff --git a/Makefile b/Makefile index 63a9e94b6b..6e41e653bb 100644 --- a/Makefile +++ b/Makefile @@ -34,8 +34,8 @@ friendbot: horizon: $(MAKE) -C services/horizon/ binary-build -ledger-exporter: - $(MAKE) -C services/ledgerexporter/ docker-build +galexie: + $(MAKE) -C services/galexie/ docker-build webauth: $(MAKE) -C exp/services/webauth/ docker-build diff --git a/services/ledgerexporter/CHANGELOG.md b/services/galexie/CHANGELOG.md similarity index 100% rename from services/ledgerexporter/CHANGELOG.md rename to services/galexie/CHANGELOG.md diff --git a/services/ledgerexporter/DEVELOPER_GUIDE.md b/services/galexie/DEVELOPER_GUIDE.md similarity index 54% rename from services/ledgerexporter/DEVELOPER_GUIDE.md rename to services/galexie/DEVELOPER_GUIDE.md index 28a16ec1b0..da7a659c46 100644 --- a/services/ledgerexporter/DEVELOPER_GUIDE.md +++ b/services/galexie/DEVELOPER_GUIDE.md @@ -1,28 +1,28 @@ -# Ledger Exporter Developer Guide -The ledger exporter is a tool to export Stellar network transaction data to cloud storage in a way that is easy to access. +# Galexie Developer Guide +Galexie is a tool to export Stellar network transaction data to cloud storage in a way that is easy to access. ## Prerequisites -This document assumes that you have installed and can run the ledger exporter, and that you have familiarity with its CLI and configuration. If not, please refer to the [Installation Guide](./README.md). +This document assumes that you have installed and can run Galexie, and that you have familiarity with its CLI and configuration. If not, please refer to the [Installation Guide](./README.md). ## Goal -The goal of the ledger exporter is to build an easy-to-use tool to export Stellar network ledger data to a configurable remote data store, such as cloud blob storage. +The goal of Galexie is to build an easy-to-use tool to export Stellar network ledger data to a configurable remote data store, such as cloud blob storage. - Use cloud storage optimally - Minimize network usage to export - Make it easy and fast to search for a specific ledger or ledger range ## Architecture -To achieve its goals, the ledger exporter uses the following architecture, which consists of the 3 main components: +To achieve its goals, Galexie uses the following architecture, which consists of the 3 main components: - Captive-core to extract raw transaction metadata from the Stellar Network. - Export manager to bundles and organizes the ledgers to get them ready for export. - The cloud storage plugin writes to the cloud storage. This is specific to the type of cloud storage, GCS in this case. -![ledgerexporter-architecture](./architecture.png) +![Architecture](./architecture.png) ## Data Format -- Ledger exporter uses a compact and efficient data format called [XDR](https://developers.stellar.org/docs/learn/encyclopedia/data-format/xdr) (External Data Representation), which is a compact binary format. A Stellar Captive Core instance emits data in this format and the data structure is referred to as `LedgerCloseMeta`. The exporter bundles multiple `LedgerCloseMeta`'s into a single object using a custom XDR structure called `LedgerCloseMetaBatch` which is defined in [Stellar-exporter.x](https://github.com/stellar/go/blob/master/xdr/Stellar-exporter.x). +- Galexie uses a compact and efficient data format called [XDR](https://developers.stellar.org/docs/learn/encyclopedia/data-format/xdr) (External Data Representation), which is a compact binary format. A Stellar Captive Core instance emits data in this format and the data structure is referred to as `LedgerCloseMeta`. The exporter bundles multiple `LedgerCloseMeta`'s into a single object using a custom XDR structure called `LedgerCloseMetaBatch` which is defined in [Stellar-exporter.x](https://github.com/stellar/go/blob/master/xdr/Stellar-exporter.x). - The metadata for the same batch is also stored alongside each exported object. Supported metadata is defined in [metadata.go](https://github.com/stellar/go/blob/master/support/datastore/metadata.go). @@ -30,32 +30,32 @@ To achieve its goals, the ledger exporter uses the following architecture, which ## Data Storage - An example implementation of `DataStore` for GCS, Google Cloud Storage. This plugin is located in the [support](https://github.com/stellar/go/tree/master/support/datastore) package. -- The ledger exporter currently implements the interface only for Google Cloud Storage (GCS). The [GCS plugin](https://github.com/stellar/go/blob/master/support/datastore/gcs_datastore.go) uses GCS-specific behaviors like conditional puts, automatic retry, metadata, and CRC checksum. +- Galexie currently implements the interface only for Google Cloud Storage (GCS). The [GCS plugin](https://github.com/stellar/go/blob/master/support/datastore/gcs_datastore.go) uses GCS-specific behaviors like conditional puts, automatic retry, metadata, and CRC checksum. ## Build and Run using Docker -The Dockerfile contains all the necessary dependencies (e.g., Stellar-core) required to run the ledger exporter. +The Dockerfile contains all the necessary dependencies (e.g., Stellar-core) required to run Galexie. - Build: To build the Docker container, use the provided [Makefile](./Makefile). Simply run make `make docker-build` to build a new container after making any changes. - Run: For instructions on running the Docker container, refer to the [Installation Guide](./README.md). -- Run ledgerexporter with a local, fake GCS backend: Requires `make docker-build` first, then run `make docker-test-fake-gcs`. This will run the ledger exporter against `testnet` and export to the 'fake' GCS instance started in the container. +- Run Galexie with a local, fake GCS backend: Requires `make docker-build` first, then run `make docker-test-fake-gcs`. This will run it against `testnet` and export to the 'fake' GCS instance started in the container. ## Running Integration Tests: -from top directory of stellar/go repo, run go test to launch ledger exporter integration +from top directory of stellar/go repo, run go test to launch Galexie integration tests. -`LEDGEREXPORTER_INTEGRATION_TESTS_ENABLED=true` is required environment variable to allow +`GALEXIE_INTEGRATION_TESTS_ENABLED=true` is required environment variable to allow tests to run. -Optional, tests will try to run `stellar-core` from o/s PATH for captive core, if not resolvable, then set `LEDGEREXPORTER_INTEGRATION_TESTS_CAPTIVE_CORE_BIN=/path/to/stellar-core` +Optional, tests will try to run `stellar-core` from o/s PATH for captive core, if not resolvable, then set `GALEXIE_INTEGRATION_TESTS_CAPTIVE_CORE_BIN=/path/to/stellar-core` -Optional, can override the version of quickstart used to run standalone stellar network, `LEDGEREXPORTER_INTEGRATION_TESTS_QUICKSTART_IMAGE=docker.io/stellar/quickstart:`. By default it will try to docker pull `stellar/quickstart:testing` image to local host's docker image store. Set `LEDGEREXPORTER_INTEGRATION_TESTS_QUICKSTART_IMAGE_PULL=false` to skip the pull, if you know host has up to date image. +Optional, can override the version of quickstart used to run standalone stellar network, `GALEXIE_INTEGRATION_TESTS_QUICKSTART_IMAGE=docker.io/stellar/quickstart:`. By default it will try to docker pull `stellar/quickstart:testing` image to local host's docker image store. Set `GALEXIE_INTEGRATION_TESTS_QUICKSTART_IMAGE_PULL=false` to skip the pull, if you know host has up to date image. -Note, the version of stellar core in `LEDGEREXPORTER_INTEGRATION_TESTS_QUICKSTART_IMAGE` and `LEDGEREXPORTER_INTEGRATION_TESTS_CAPTIVE_CORE_BIN` needs to be on the same major rev or the captive core process may not be able to join or parse ledger meta from the `local` network created by `LEDGEREXPORTER_INTEGRATION_TESTS_QUICKSTART_IMAGE` +Note, the version of stellar core in `GALEXIE_INTEGRATION_TESTS_QUICKSTART_IMAGE` and `GALEXIE_INTEGRATION_TESTS_CAPTIVE_CORE_BIN` needs to be on the same major rev or the captive core process may not be able to join or parse ledger meta from the `local` network created by `GALEXIE_INTEGRATION_TESTS_QUICKSTART_IMAGE` ``` -$ LEDGEREXPORTER_INTEGRATION_TESTS_ENABLED=true go test -v -race -run TestLedgerExporterTestSuite ./exp/services/ledgerexporter/... +$ GALEXIE_INTEGRATION_TESTS_ENABLED=true go test -v -race -run TestGalexieTestSuite ./services/galexie/... ``` ## Adding support for a new storage type @@ -71,7 +71,7 @@ Support for different data storage types are encapsulated as 'plugins', which ar - An emulator such as a GCS emulator [fake-gcs-server](https://github.com/fsouza/fake-gcs-server) can be used for testing without connecting to real cloud storage. ### Design DOs and DONTs -- Multiple exporters should be able to run in parallel without the need for explicit locking or synchronization. +- Multiple Galexie instances should be able to run in parallel without the need for explicit locking or synchronization. - Exporters when restarted do not have any memory of prior operation and rely on the already exported data as much as possible to decide where to resume. ## Using exported data diff --git a/services/ledgerexporter/Makefile b/services/galexie/Makefile similarity index 74% rename from services/ledgerexporter/Makefile rename to services/galexie/Makefile index 4d83897d9f..f501300e11 100644 --- a/services/ledgerexporter/Makefile +++ b/services/galexie/Makefile @@ -3,14 +3,14 @@ SUDO := $(shell docker version >/dev/null 2>&1 || echo "sudo") # https://github.com/opencontainers/image-spec/blob/master/annotations.md BUILD_DATE := $(shell date -u +%FT%TZ) VERSION ?= $(shell git rev-parse --short HEAD) -DOCKER_IMAGE := stellar/ledger-exporter +DOCKER_IMAGE := stellar/stellar-galexie docker-build: cd ../../ && \ $(SUDO) docker build --platform linux/amd64 --pull --label org.opencontainers.image.created="$(BUILD_DATE)" \ - --build-arg GOFLAGS="-ldflags=-X=github.com/stellar/go/services/ledgerexporter/internal.version=$(VERSION)" \ + --build-arg GOFLAGS="-ldflags=-X=github.com/stellar/go/services/galexie/internal.version=$(VERSION)" \ $(if $(STELLAR_CORE_VERSION), --build-arg STELLAR_CORE_VERSION=$(STELLAR_CORE_VERSION)) \ - -f services/ledgerexporter/docker/Dockerfile \ + -f services/galexie/docker/Dockerfile \ -t $(DOCKER_IMAGE):$(VERSION) \ -t $(DOCKER_IMAGE):latest . @@ -22,7 +22,7 @@ docker-clean: docker-test-fake-gcs: docker-clean # Create temp storage dir - $(SUDO) mkdir -p ${PWD}/storage/exporter-test + $(SUDO) mkdir -p ${PWD}/storage/galexie-test # Create test network for docker $(SUDO) docker network create test-network @@ -31,13 +31,13 @@ docker-test-fake-gcs: docker-clean $(SUDO) docker run -d --name fake-gcs-server -p 4443:4443 \ -v ${PWD}/storage:/data --network test-network fsouza/fake-gcs-server -scheme http - # Run the ledger-exporter - $(SUDO) docker run --platform linux/amd64 -t --network test-network\ - -v ${PWD}/exp/services/ledgerexporter/docker/config.test.toml:/config.toml \ - -e STORAGE_EMULATOR_HOST=http://fake-gcs-server:4443 \ - $(DOCKER_IMAGE):$(VERSION) \ - scan-and-fill --start 1000 --end 2000 - + # Run + $(SUDO) docker run --platform linux/amd64 -t --network test-network \ + -v ${PWD}/exp/services/galexie/docker/config.test.toml:/config.toml \ + -e STORAGE_EMULATOR_HOST=http://fake-gcs-server:4443 \ + $(DOCKER_IMAGE):$(VERSION) \ + scan-and-fill --start 1000 --end 2000 + $(MAKE) docker-clean docker-push: diff --git a/services/ledgerexporter/README.md b/services/galexie/README.md similarity index 76% rename from services/ledgerexporter/README.md rename to services/galexie/README.md index 8308bfdaeb..0c4527e637 100644 --- a/services/ledgerexporter/README.md +++ b/services/galexie/README.md @@ -1,23 +1,23 @@ -## Ledger Exporter: Installation and Usage Guide +## Galexie: Installation and Usage Guide -This guide provides step-by-step instructions on installing and using the Ledger Exporter, a tool that exports Stellar network ledger data to a Google Cloud Storage (GCS) bucket for efficient analysis and storage. +This guide provides step-by-step instructions on installing and using the Galexie - Ledger Exporter, a tool that exports Stellar network ledger data to a Google Cloud Storage (GCS) bucket for efficient analysis and storage. * [Prerequisites](#prerequisites) * [Setup](#setup) * [Set Up GCP Credentials](#set-up-gcp-credentials) * [Create a GCS Bucket for Storage](#create-a-gcs-bucket-for-storage) -* [Running the Ledger Exporter](#running-the-ledger-exporter) +* [Running Galexie](#running-galexie) * [Pull the Docker Image](#1-pull-the-docker-image) - * [Configure the Exporter](#2-configure-the-exporter-configtoml) - * [Run the Exporter](#3-run-the-exporter) + * [Configure](#2-configure-configtoml) + * [Run](#3-run) * [Command Line Interface (CLI)](#command-line-interface-cli) - 1. [scan-and-fill: Fill Data Gaps](#1-scan-and-fill-fill-data-gaps) - 2. [append: Continuously Export New Data](#2-append-continuously-export-new-data) + 1. [append: Continuously Export New Data](#1-append-continuously-export-new-data) + 2. [scan-and-fill: Fill Data Gaps](#2-scan-and-fill-fill-data-gaps) ## Prerequisites * **Google Cloud Platform (GCP) Account:** You will need a GCP account to create a GCS bucket for storing the exported data. -* **Docker:** Allows you to run the Ledger Exporter in a self-contained environment. The official Docker installation guide: [https://docs.docker.com/engine/install/](https://docs.docker.com/engine/install/) +* **Docker:** Allows you to run the Galexie in a self-contained environment. The official Docker installation guide: [https://docs.docker.com/engine/install/](https://docs.docker.com/engine/install/) ## Setup @@ -37,34 +37,34 @@ For detailed instructions, refer to the [Providing Credentials for Application D 3. **Note down the bucket name** as you'll need it later in the configuration process. -## Running the Ledger Exporter +## Running Galexie ### 1. Pull the Docker Image -Open a terminal window and download the Stellar Ledger Exporter Docker image using the following command: +Open a terminal window and download the Stellar Galexie Docker image using the following command: ```bash -docker pull stellar/ledger-exporter +docker pull stellar/stellar-galexie ``` -### 2. Configure the Exporter (config.toml) -The Ledger Exporter relies on a configuration file (config.toml) to connect to your specific environment. This file defines details like: +### 2. Configure (config.toml) +Galexie relies on a configuration file (config.toml) to connect to your specific environment. This file defines details like: - Your Google Cloud Storage (GCS) bucket where exported ledger data will be stored. - Stellar network settings, such as the network you're using (testnet or pubnet). - Datastore schema to control data organization. A sample configuration file [config.example.toml](config.example.toml) is provided. Copy and rename it to config.toml for customization. Edit the copied file (config.toml) to replace placeholders with your specific details. -### 3. Run the Exporter +### 3. Run -The following command demonstrates how to run the Ledger Exporter: +The following command demonstrates how to run the Galexie: ```bash docker run --platform linux/amd64 \ -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/ledger-exporter [options] + stellar/stellar-galexie [options] ``` **Explanation:** @@ -74,12 +74,12 @@ docker run --platform linux/amd64 \ * `$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/ledger-exporter`: The Docker image name. -* ``: The Stellar Ledger Exporter command: [append](#1-append-continuously-export-new-data), [scan-and-fill](#2-scan-and-fill-fill-data-gaps)) +* `stellar/stellar-galexie`: The Docker image name. +* ``: The Stellar Galexie command: [append](#1-append-continuously-export-new-data), [scan-and-fill](#2-scan-and-fill-fill-data-gaps)) ## Command Line Interface (CLI) -The Ledger Exporter offers two mode of operation for exporting ledger data: +Galexie offers two mode of operation for exporting ledger data: ### 1. append: Continuously Export New Data @@ -99,14 +99,14 @@ 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/ledger-exporter \ + stellar/stellar-galexie \ append --start [--end ] [--config-file ] ``` Arguments: - `--start ` (required): The starting ledger sequence number for the export process. -- `--end ` (optional): The ending ledger sequence number. If omitted or set to 0, the exporter will continuously export new ledgers as they appear on the network. -- `--config-file ` (optional): The path to your configuration file, containing details like GCS bucket information. If not provided, the exporter will look for config.toml in the directory where you run the command. +- `--end ` (optional): The ending ledger sequence number. If omitted or set to 0, it will continuously export new ledgers as they appear on the network. +- `--config-file ` (optional): The path to your configuration file, containing details like GCS bucket information. If not provided, it will look for config.toml in the directory where you run the command. ### 2. scan-and-fill: Fill Data Gaps @@ -119,11 +119,11 @@ 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/ledger-exporter \ + stellar/stellar-galexie \ scan-and-fill --start --end [--config-file ] ``` Arguments: - `--start ` (required): The starting ledger sequence number in the range to export. - `--end ` (required): The ending ledger sequence number in the range. -- `--config-file ` (optional): The path to your configuration file, containing details like GCS bucket information. If not provided, the exporter will look for config.toml in the directory where you run the command. \ No newline at end of file +- `--config-file ` (optional): The path to your configuration file, containing details like GCS bucket information. If not provided, the exporter will look for config.toml in the directory where you run the command. diff --git a/services/ledgerexporter/architecture.png b/services/galexie/architecture.png similarity index 100% rename from services/ledgerexporter/architecture.png rename to services/galexie/architecture.png diff --git a/services/ledgerexporter/config.example.toml b/services/galexie/config.example.toml similarity index 100% rename from services/ledgerexporter/config.example.toml rename to services/galexie/config.example.toml diff --git a/services/ledgerexporter/docker/Dockerfile b/services/galexie/docker/Dockerfile similarity index 84% rename from services/ledgerexporter/docker/Dockerfile rename to services/galexie/docker/Dockerfile index fea21d86c5..6614a40692 100644 --- a/services/ledgerexporter/docker/Dockerfile +++ b/services/galexie/docker/Dockerfile @@ -10,7 +10,7 @@ RUN go mod download COPY . ./ ARG GOFLAGS -RUN go install github.com/stellar/go/services/ledgerexporter +RUN go install github.com/stellar/go/services/galexie FROM ubuntu:22.04 ARG STELLAR_CORE_VERSION @@ -26,9 +26,9 @@ RUN echo "deb https://apt.stellar.org focal unstable" >/etc/apt/sources.list.d/S RUN apt-get update && apt-get install -y stellar-core=${STELLAR_CORE_VERSION} RUN apt-get clean -COPY --from=builder /go/bin/ledgerexporter /usr/bin/ledgerexporter +COPY --from=builder /go/bin/galexie /usr/bin/galexie -ENTRYPOINT ["/usr/bin/ledgerexporter"] +ENTRYPOINT ["/usr/bin/galexie"] CMD ["--help"] diff --git a/services/ledgerexporter/docker/config.test.toml b/services/galexie/docker/config.test.toml similarity index 100% rename from services/ledgerexporter/docker/config.test.toml rename to services/galexie/docker/config.test.toml diff --git a/services/ledgerexporter/internal/app.go b/services/galexie/internal/app.go similarity index 96% rename from services/ledgerexporter/internal/app.go rename to services/galexie/internal/app.go index 00382f00e4..7117526302 100644 --- a/services/ledgerexporter/internal/app.go +++ b/services/galexie/internal/app.go @@ -1,4 +1,4 @@ -package ledgerexporter +package galexie import ( "context" @@ -35,10 +35,11 @@ const ( // size in our metrics that is an indication that uploads to the // data store have degraded uploadQueueCapacity = 128 + nameSpace = "galexie" ) var ( - logger = log.New().WithField("service", "ledger-exporter") + logger = log.New().WithField("service", nameSpace) version = "develop" ) @@ -96,11 +97,11 @@ func (a *App) init(ctx context.Context, runtimeSettings RuntimeSettings) error { var err error var archive historyarchive.ArchiveInterface - logger.Infof("Starting Ledger Exporter with version %s", version) + logger.Infof("Starting Galexie with version %s", version) registry := prometheus.NewRegistry() registry.MustRegister( - collectors.NewProcessCollector(collectors.ProcessCollectorOpts{Namespace: "ledger_exporter"}), + collectors.NewProcessCollector(collectors.ProcessCollectorOpts{Namespace: nameSpace}), collectors.NewGoCollector(), ) @@ -193,10 +194,10 @@ func (a *App) Run(runtimeSettings RuntimeSettings) error { var dataAlreadyExported *DataAlreadyExportedError if errors.As(err, &dataAlreadyExported) { logger.Info(err.Error()) - logger.Info("Shutting down ledger-exporter") + logger.Info("Shutting down Galexie") return nil } - logger.WithError(err).Error("Stopping ledger-exporter") + logger.WithError(err).Error("Stopping Galexie") return err } defer a.close() @@ -250,7 +251,7 @@ func (a *App) Run(runtimeSettings RuntimeSettings) error { }() wg.Wait() - logger.Info("Shutting down ledger-exporter") + logger.Info("Shutting down Galexie") if a.adminServer != nil { serverShutdownCtx, serverShutdownCancel := context.WithTimeout(context.Background(), adminServerShutdownTimeout) @@ -280,7 +281,7 @@ func newLedgerBackend(config *Config, prometheusRegistry *prometheus.Registry) ( if err != nil { return nil, errors.Wrap(err, "Failed to create captive-core instance") } - backend = ledgerbackend.WithMetrics(backend, prometheusRegistry, "ledger_exporter") + backend = ledgerbackend.WithMetrics(backend, prometheusRegistry, nameSpace) return backend, nil } diff --git a/services/ledgerexporter/internal/app_test.go b/services/galexie/internal/app_test.go similarity index 99% rename from services/ledgerexporter/internal/app_test.go rename to services/galexie/internal/app_test.go index bb715baa6f..205869ae63 100644 --- a/services/ledgerexporter/internal/app_test.go +++ b/services/galexie/internal/app_test.go @@ -1,4 +1,4 @@ -package ledgerexporter +package galexie import ( "context" diff --git a/services/ledgerexporter/internal/config.go b/services/galexie/internal/config.go similarity index 99% rename from services/ledgerexporter/internal/config.go rename to services/galexie/internal/config.go index 196327e229..563686033e 100644 --- a/services/ledgerexporter/internal/config.go +++ b/services/galexie/internal/config.go @@ -1,4 +1,4 @@ -package ledgerexporter +package galexie import ( "context" @@ -22,7 +22,7 @@ import ( const ( Pubnet = "pubnet" Testnet = "testnet" - UserAgent = "ledgerexporter" + UserAgent = "galexie" ) type Mode int @@ -199,7 +199,7 @@ func (config *Config) GenerateCaptiveCoreConfig(coreBinFromPath string) (ledgerb CheckpointFrequency: checkpointFrequency, Log: logger.WithField("subservice", "stellar-core"), Toml: captiveCoreToml, - UserAgent: "ledger-exporter", + UserAgent: config.UserAgent, UseDB: true, StoragePath: config.StellarCoreConfig.StoragePath, }, nil diff --git a/services/ledgerexporter/internal/config_test.go b/services/galexie/internal/config_test.go similarity index 99% rename from services/ledgerexporter/internal/config_test.go rename to services/galexie/internal/config_test.go index d1c24cb198..3925c5b0de 100644 --- a/services/ledgerexporter/internal/config_test.go +++ b/services/galexie/internal/config_test.go @@ -1,4 +1,4 @@ -package ledgerexporter +package galexie import ( "context" @@ -30,7 +30,7 @@ func TestNewConfig(t *testing.T) { require.Equal(t, config.DataStoreConfig.Type, "ABC") require.Equal(t, config.DataStoreConfig.Schema.FilesPerPartition, uint32(1)) require.Equal(t, config.DataStoreConfig.Schema.LedgersPerFile, uint32(3)) - require.Equal(t, config.UserAgent, "ledgerexporter") + require.Equal(t, config.UserAgent, "galexie") require.True(t, config.Resumable()) url, ok := config.DataStoreConfig.Params["destination_bucket_path"] require.True(t, ok) diff --git a/services/ledgerexporter/internal/exportmanager.go b/services/galexie/internal/exportmanager.go similarity index 97% rename from services/ledgerexporter/internal/exportmanager.go rename to services/galexie/internal/exportmanager.go index af2633d6be..f6ea27d1e2 100644 --- a/services/ledgerexporter/internal/exportmanager.go +++ b/services/galexie/internal/exportmanager.go @@ -1,4 +1,4 @@ -package ledgerexporter +package galexie import ( "context" @@ -34,7 +34,7 @@ func NewExportManager(dataStoreSchema datastore.DataStoreSchema, } latestLedgerMetric := prometheus.NewGaugeVec(prometheus.GaugeOpts{ - Namespace: "ledger_exporter", Subsystem: "export_manager", Name: "latest_ledger", + Namespace: nameSpace, Subsystem: "export_manager", Name: "latest_ledger", Help: "sequence number of the latest ledger consumed by the export manager", }, []string{"start_ledger", "end_ledger"}) prometheusRegistry.MustRegister(latestLedgerMetric) diff --git a/services/ledgerexporter/internal/exportmanager_test.go b/services/galexie/internal/exportmanager_test.go similarity index 99% rename from services/ledgerexporter/internal/exportmanager_test.go rename to services/galexie/internal/exportmanager_test.go index 7845186c06..08829a8f8e 100644 --- a/services/ledgerexporter/internal/exportmanager_test.go +++ b/services/galexie/internal/exportmanager_test.go @@ -1,4 +1,4 @@ -package ledgerexporter +package galexie import ( "context" diff --git a/services/ledgerexporter/internal/integration_test.go b/services/galexie/internal/integration_test.go similarity index 84% rename from services/ledgerexporter/internal/integration_test.go rename to services/galexie/internal/integration_test.go index ccc5463908..7c84e13ea0 100644 --- a/services/ledgerexporter/internal/integration_test.go +++ b/services/galexie/internal/integration_test.go @@ -1,4 +1,4 @@ -package ledgerexporter +package galexie import ( "bytes" @@ -37,16 +37,16 @@ const ( configTemplate = "test/integration_config_template.toml" ) -func TestLedgerExporterTestSuite(t *testing.T) { - if os.Getenv("LEDGEREXPORTER_INTEGRATION_TESTS_ENABLED") != "true" { - t.Skip("skipping integration test: LEDGEREXPORTER_INTEGRATION_TESTS_ENABLED not true") +func TestGalexieTestSuite(t *testing.T) { + if os.Getenv("GALEXIE_INTEGRATION_TESTS_ENABLED") != "true" { + t.Skip("skipping integration test: GALEXIE_INTEGRATION_TESTS_ENABLED not true") } - ledgerExporterSuite := &LedgerExporterTestSuite{} - suite.Run(t, ledgerExporterSuite) + galexieSuite := &GalexieTestSuite{} + suite.Run(t, galexieSuite) } -type LedgerExporterTestSuite struct { +type GalexieTestSuite struct { suite.Suite tempConfigFile string ctx context.Context @@ -58,7 +58,7 @@ type LedgerExporterTestSuite struct { config Config } -func (s *LedgerExporterTestSuite) TestScanAndFill() { +func (s *GalexieTestSuite) TestScanAndFill() { require := s.Require() rootCmd := defineCommands() @@ -83,7 +83,7 @@ func (s *LedgerExporterTestSuite) TestScanAndFill() { require.NoError(err) } -func (s *LedgerExporterTestSuite) TestAppend() { +func (s *GalexieTestSuite) TestAppend() { require := s.Require() // first populate ledgers 4-5 @@ -113,7 +113,7 @@ func (s *LedgerExporterTestSuite) TestAppend() { require.NoError(err) } -func (s *LedgerExporterTestSuite) TestAppendUnbounded() { +func (s *GalexieTestSuite) TestAppendUnbounded() { require := s.Require() rootCmd := defineCommands() @@ -147,7 +147,7 @@ func (s *LedgerExporterTestSuite) TestAppendUnbounded() { }, 180*time.Second, 50*time.Millisecond, "append unbounded did not work") } -func (s *LedgerExporterTestSuite) SetupSuite() { +func (s *GalexieTestSuite) SetupSuite() { var err error t := s.T() @@ -160,19 +160,19 @@ func (s *LedgerExporterTestSuite) SetupSuite() { }() testTempDir := t.TempDir() - ledgerExporterConfigTemplate, err := toml.LoadFile(configTemplate) + galexieConfigTemplate, err := toml.LoadFile(configTemplate) if err != nil { t.Fatalf("unable to load config template file %v, %v", configTemplate, err) } - // if LEDGEREXPORTER_INTEGRATION_TESTS_CAPTIVE_CORE_BIN not specified, - // ledgerexporter will attempt resolve core bin using 'stellar-core' from OS path - ledgerExporterConfigTemplate.Set("stellar_core_config.stellar_core_binary_path", - os.Getenv("LEDGEREXPORTER_INTEGRATION_TESTS_CAPTIVE_CORE_BIN")) + // if GALEXIE_INTEGRATION_TESTS_CAPTIVE_CORE_BIN not specified, + // galexie will attempt resolve core bin using 'stellar-core' from OS path + galexieConfigTemplate.Set("stellar_core_config.stellar_core_binary_path", + os.Getenv("GALEXIE_INTEGRATION_TESTS_CAPTIVE_CORE_BIN")) - ledgerExporterConfigTemplate.Set("stellar_core_config.storage_path", filepath.Join(testTempDir, "captive-core")) + galexieConfigTemplate.Set("stellar_core_config.storage_path", filepath.Join(testTempDir, "captive-core")) - tomlBytes, err := toml.Marshal(ledgerExporterConfigTemplate) + tomlBytes, err := toml.Marshal(galexieConfigTemplate) if err != nil { t.Fatalf("unable to parse config file toml %v, %v", configTemplate, err) } @@ -211,22 +211,22 @@ func (s *LedgerExporterTestSuite) SetupSuite() { t.Logf("fake gcs server started at %v", s.gcsServer.URL()) t.Setenv("STORAGE_EMULATOR_HOST", s.gcsServer.URL()) - quickstartImage := os.Getenv("LEDGEREXPORTER_INTEGRATION_TESTS_QUICKSTART_IMAGE") + quickstartImage := os.Getenv("GALEXIE_INTEGRATION_TESTS_QUICKSTART_IMAGE") if quickstartImage == "" { quickstartImage = "stellar/quickstart:testing" } pullQuickStartImage := true - if os.Getenv("LEDGEREXPORTER_INTEGRATION_TESTS_QUICKSTART_IMAGE_PULL") == "false" { + if os.Getenv("GALEXIE_INTEGRATION_TESTS_QUICKSTART_IMAGE_PULL") == "false" { pullQuickStartImage = false } s.mustStartCore(t, quickstartImage, pullQuickStartImage) - s.mustWaitForCore(t, ledgerExporterConfigTemplate.GetArray("stellar_core_config.history_archive_urls").([]string), - ledgerExporterConfigTemplate.Get("stellar_core_config.network_passphrase").(string)) + s.mustWaitForCore(t, galexieConfigTemplate.GetArray("stellar_core_config.history_archive_urls").([]string), + galexieConfigTemplate.Get("stellar_core_config.network_passphrase").(string)) s.finishedSetup = true } -func (s *LedgerExporterTestSuite) TearDownSuite() { +func (s *GalexieTestSuite) TearDownSuite() { if s.coreContainerID != "" { s.T().Logf("Stopping the quickstart container %v", s.coreContainerID) containerLogs, err := s.dockerCli.ContainerLogs(s.ctx, s.coreContainerID, container.LogsOptions{ShowStdout: true, ShowStderr: true}) @@ -251,7 +251,7 @@ func (s *LedgerExporterTestSuite) TearDownSuite() { s.ctxStop() } -func (s *LedgerExporterTestSuite) mustStartCore(t *testing.T, quickstartImage string, pullImage bool) { +func (s *GalexieTestSuite) mustStartCore(t *testing.T, quickstartImage string, pullImage bool) { var err error s.dockerCli, err = client.NewClientWithOpts(client.WithAPIVersionNegotiation()) if err != nil { @@ -308,7 +308,7 @@ func (s *LedgerExporterTestSuite) mustStartCore(t *testing.T, quickstartImage st t.Logf("Started quickstart container %v", s.coreContainerID) } -func (s *LedgerExporterTestSuite) mustWaitForCore(t *testing.T, archiveUrls []string, passphrase string) { +func (s *GalexieTestSuite) mustWaitForCore(t *testing.T, archiveUrls []string, passphrase string) { t.Log("Waiting for core to be up...") startTime := time.Now() infoTime := startTime diff --git a/services/ledgerexporter/internal/ledger_meta_archive.go b/services/galexie/internal/ledger_meta_archive.go similarity index 98% rename from services/ledgerexporter/internal/ledger_meta_archive.go rename to services/galexie/internal/ledger_meta_archive.go index f63a77f28b..e2d0368a5e 100644 --- a/services/ledgerexporter/internal/ledger_meta_archive.go +++ b/services/galexie/internal/ledger_meta_archive.go @@ -1,4 +1,4 @@ -package ledgerexporter +package galexie import ( "github.com/stellar/go/support/compressxdr" diff --git a/services/ledgerexporter/internal/ledger_meta_archive_test.go b/services/galexie/internal/ledger_meta_archive_test.go similarity index 98% rename from services/ledgerexporter/internal/ledger_meta_archive_test.go rename to services/galexie/internal/ledger_meta_archive_test.go index 152f2c6496..36240f6a3a 100644 --- a/services/ledgerexporter/internal/ledger_meta_archive_test.go +++ b/services/galexie/internal/ledger_meta_archive_test.go @@ -1,4 +1,4 @@ -package ledgerexporter +package galexie import ( "testing" diff --git a/services/ledgerexporter/internal/main.go b/services/galexie/internal/main.go similarity index 95% rename from services/ledgerexporter/internal/main.go rename to services/galexie/internal/main.go index f0ff076ae3..21db0dadbd 100644 --- a/services/ledgerexporter/internal/main.go +++ b/services/galexie/internal/main.go @@ -1,4 +1,4 @@ -package ledgerexporter +package galexie import ( "context" @@ -11,7 +11,7 @@ import ( ) var ( - ledgerExporterCmdRunner = func(runtimeSettings RuntimeSettings) error { + galexieCmdRunner = func(runtimeSettings RuntimeSettings) error { app := NewApp() return app.Run(runtimeSettings) } @@ -24,7 +24,7 @@ func Execute() error { func defineCommands() *cobra.Command { var rootCmd = &cobra.Command{ - Use: "ledgerexporter", + Use: "galexie", Short: "Export Stellar network ledger data to a remote data store", Long: "Converts ledger meta data from Stellar network into static data and exports it remote data storage.", @@ -46,7 +46,7 @@ func defineCommands() *cobra.Command { if settings.Ctx == nil { settings.Ctx = context.Background() } - return ledgerExporterCmdRunner(settings) + return galexieCmdRunner(settings) }, } var appendCmd = &cobra.Command{ @@ -63,7 +63,7 @@ func defineCommands() *cobra.Command { if settings.Ctx == nil { settings.Ctx = context.Background() } - return ledgerExporterCmdRunner(settings) + return galexieCmdRunner(settings) }, } diff --git a/services/ledgerexporter/internal/main_test.go b/services/galexie/internal/main_test.go similarity index 95% rename from services/ledgerexporter/internal/main_test.go rename to services/galexie/internal/main_test.go index c9fe0f853d..f86dbc1b58 100644 --- a/services/ledgerexporter/internal/main_test.go +++ b/services/galexie/internal/main_test.go @@ -1,4 +1,4 @@ -package ledgerexporter +package galexie import ( "bytes" @@ -102,8 +102,8 @@ func TestFlagsOutput(t *testing.T) { } for _, testCase := range testCases { t.Run(testCase.name, func(t *testing.T) { - // mock the ledger exporter's cmd runner to be this test's mock routine instead of real app - ledgerExporterCmdRunner = testCase.appRunner + // mock galexie's cmd runner to be this test's mock routine instead of real app + galexieCmdRunner = testCase.appRunner rootCmd := defineCommands() rootCmd.SetArgs(testCase.commandArgs) var errWriter io.Writer = &bytes.Buffer{} diff --git a/services/ledgerexporter/internal/queue.go b/services/galexie/internal/queue.go similarity index 96% rename from services/ledgerexporter/internal/queue.go rename to services/galexie/internal/queue.go index 372ccb0056..13b3d6aba2 100644 --- a/services/ledgerexporter/internal/queue.go +++ b/services/galexie/internal/queue.go @@ -1,4 +1,4 @@ -package ledgerexporter +package galexie import ( "context" @@ -15,7 +15,7 @@ type UploadQueue struct { // NewUploadQueue constructs a new UploadQueue func NewUploadQueue(size int, prometheusRegistry *prometheus.Registry) UploadQueue { queueLengthMetric := prometheus.NewGauge(prometheus.GaugeOpts{ - Namespace: "ledger_exporter", + Namespace: nameSpace, Subsystem: "upload_queue", Name: "length", Help: "The number of objects queued for upload", diff --git a/services/ledgerexporter/internal/queue_test.go b/services/galexie/internal/queue_test.go similarity index 98% rename from services/ledgerexporter/internal/queue_test.go rename to services/galexie/internal/queue_test.go index 0676f3594f..9318aca439 100644 --- a/services/ledgerexporter/internal/queue_test.go +++ b/services/galexie/internal/queue_test.go @@ -1,4 +1,4 @@ -package ledgerexporter +package galexie import ( "context" diff --git a/services/ledgerexporter/internal/test/10perfile.toml b/services/galexie/internal/test/10perfile.toml similarity index 100% rename from services/ledgerexporter/internal/test/10perfile.toml rename to services/galexie/internal/test/10perfile.toml diff --git a/services/ledgerexporter/internal/test/15perfile.toml b/services/galexie/internal/test/15perfile.toml similarity index 100% rename from services/ledgerexporter/internal/test/15perfile.toml rename to services/galexie/internal/test/15perfile.toml diff --git a/services/ledgerexporter/internal/test/1perfile.toml b/services/galexie/internal/test/1perfile.toml similarity index 100% rename from services/ledgerexporter/internal/test/1perfile.toml rename to services/galexie/internal/test/1perfile.toml diff --git a/services/ledgerexporter/internal/test/64perfile.toml b/services/galexie/internal/test/64perfile.toml similarity index 100% rename from services/ledgerexporter/internal/test/64perfile.toml rename to services/galexie/internal/test/64perfile.toml diff --git a/services/ledgerexporter/internal/test/captive-core-test.cfg b/services/galexie/internal/test/captive-core-test.cfg similarity index 100% rename from services/ledgerexporter/internal/test/captive-core-test.cfg rename to services/galexie/internal/test/captive-core-test.cfg diff --git a/services/ledgerexporter/internal/test/integration_captive_core.cfg b/services/galexie/internal/test/integration_captive_core.cfg similarity index 100% rename from services/ledgerexporter/internal/test/integration_captive_core.cfg rename to services/galexie/internal/test/integration_captive_core.cfg diff --git a/services/ledgerexporter/internal/test/integration_config_template.toml b/services/galexie/internal/test/integration_config_template.toml similarity index 100% rename from services/ledgerexporter/internal/test/integration_config_template.toml rename to services/galexie/internal/test/integration_config_template.toml diff --git a/services/ledgerexporter/internal/test/invalid_captive_core_toml_path.toml b/services/galexie/internal/test/invalid_captive_core_toml_path.toml similarity index 100% rename from services/ledgerexporter/internal/test/invalid_captive_core_toml_path.toml rename to services/galexie/internal/test/invalid_captive_core_toml_path.toml diff --git a/services/ledgerexporter/internal/test/invalid_empty.toml b/services/galexie/internal/test/invalid_empty.toml similarity index 100% rename from services/ledgerexporter/internal/test/invalid_empty.toml rename to services/galexie/internal/test/invalid_empty.toml diff --git a/services/ledgerexporter/internal/test/invalid_preconfigured_network.toml b/services/galexie/internal/test/invalid_preconfigured_network.toml similarity index 100% rename from services/ledgerexporter/internal/test/invalid_preconfigured_network.toml rename to services/galexie/internal/test/invalid_preconfigured_network.toml diff --git a/services/ledgerexporter/internal/test/no_core_bin.toml b/services/galexie/internal/test/no_core_bin.toml similarity index 100% rename from services/ledgerexporter/internal/test/no_core_bin.toml rename to services/galexie/internal/test/no_core_bin.toml diff --git a/services/ledgerexporter/internal/test/no_network.toml b/services/galexie/internal/test/no_network.toml similarity index 100% rename from services/ledgerexporter/internal/test/no_network.toml rename to services/galexie/internal/test/no_network.toml diff --git a/services/ledgerexporter/internal/test/test.toml b/services/galexie/internal/test/test.toml similarity index 100% rename from services/ledgerexporter/internal/test/test.toml rename to services/galexie/internal/test/test.toml diff --git a/services/ledgerexporter/internal/test/useragent.toml b/services/galexie/internal/test/useragent.toml similarity index 100% rename from services/ledgerexporter/internal/test/useragent.toml rename to services/galexie/internal/test/useragent.toml diff --git a/services/ledgerexporter/internal/test/valid_captive_core_manual.toml b/services/galexie/internal/test/valid_captive_core_manual.toml similarity index 100% rename from services/ledgerexporter/internal/test/valid_captive_core_manual.toml rename to services/galexie/internal/test/valid_captive_core_manual.toml diff --git a/services/ledgerexporter/internal/test/valid_captive_core_override.toml b/services/galexie/internal/test/valid_captive_core_override.toml similarity index 100% rename from services/ledgerexporter/internal/test/valid_captive_core_override.toml rename to services/galexie/internal/test/valid_captive_core_override.toml diff --git a/services/ledgerexporter/internal/test/valid_captive_core_override_archives.toml b/services/galexie/internal/test/valid_captive_core_override_archives.toml similarity index 100% rename from services/ledgerexporter/internal/test/valid_captive_core_override_archives.toml rename to services/galexie/internal/test/valid_captive_core_override_archives.toml diff --git a/services/ledgerexporter/internal/test/valid_captive_core_preconfigured.toml b/services/galexie/internal/test/valid_captive_core_preconfigured.toml similarity index 100% rename from services/ledgerexporter/internal/test/valid_captive_core_preconfigured.toml rename to services/galexie/internal/test/valid_captive_core_preconfigured.toml diff --git a/services/ledgerexporter/internal/test/validate_start_end.toml b/services/galexie/internal/test/validate_start_end.toml similarity index 100% rename from services/ledgerexporter/internal/test/validate_start_end.toml rename to services/galexie/internal/test/validate_start_end.toml diff --git a/services/ledgerexporter/internal/uploader.go b/services/galexie/internal/uploader.go similarity index 94% rename from services/ledgerexporter/internal/uploader.go rename to services/galexie/internal/uploader.go index 6d35d2920f..52712da280 100644 --- a/services/ledgerexporter/internal/uploader.go +++ b/services/galexie/internal/uploader.go @@ -1,4 +1,4 @@ -package ledgerexporter +package galexie import ( "context" @@ -30,7 +30,7 @@ func NewUploader( ) Uploader { uploadDurationMetric := prometheus.NewSummaryVec( prometheus.SummaryOpts{ - Namespace: "ledger_exporter", Subsystem: "uploader", Name: "put_duration_seconds", + Namespace: nameSpace, Subsystem: "uploader", Name: "put_duration_seconds", Help: "duration for uploading a ledger batch, sliding window = 10m", Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001}, }, @@ -38,14 +38,14 @@ func NewUploader( ) objectSizeMetrics := prometheus.NewSummaryVec( prometheus.SummaryOpts{ - Namespace: "ledger_exporter", Subsystem: "uploader", Name: "object_size_bytes", + Namespace: nameSpace, Subsystem: "uploader", Name: "object_size_bytes", Help: "size of a ledger batch in bytes, sliding window = 10m", Objectives: map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001}, }, []string{"ledgers", "already_exists", "compression"}, ) latestLedgerMetric := prometheus.NewGauge(prometheus.GaugeOpts{ - Namespace: "ledger_exporter", Subsystem: "uploader", Name: "latest_ledger", + Namespace: nameSpace, Subsystem: "uploader", Name: "latest_ledger", Help: "sequence number of the latest ledger uploaded", }) prometheusRegistry.MustRegister(uploadDurationMetric, objectSizeMetrics, latestLedgerMetric) diff --git a/services/ledgerexporter/internal/uploader_test.go b/services/galexie/internal/uploader_test.go similarity index 99% rename from services/ledgerexporter/internal/uploader_test.go rename to services/galexie/internal/uploader_test.go index 612c9e8740..81eb252755 100644 --- a/services/ledgerexporter/internal/uploader_test.go +++ b/services/galexie/internal/uploader_test.go @@ -1,4 +1,4 @@ -package ledgerexporter +package galexie import ( "bytes" diff --git a/services/ledgerexporter/main.go b/services/galexie/main.go similarity index 56% rename from services/ledgerexporter/main.go rename to services/galexie/main.go index 04cb23c637..adfc1bb89d 100644 --- a/services/ledgerexporter/main.go +++ b/services/galexie/main.go @@ -4,11 +4,11 @@ import ( "fmt" "os" - exporter "github.com/stellar/go/services/ledgerexporter/internal" + galexie "github.com/stellar/go/services/galexie/internal" ) func main() { - err := exporter.Execute() + err := galexie.Execute() if err != nil { fmt.Fprintln(os.Stderr, err) os.Exit(1)