diff --git a/CHANGELOG.md b/CHANGELOG.md index cc37840d..7774d51d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.22.3] - 2026-10-04 + +### Fixed +- A per-coin HUB_SEED_URLS now suppresses the default HUB_API_URL in generated indexer config. + ## [0.22.2] - 2026-10-04 ### Changed diff --git a/package-lock.json b/package-lock.json index 6fb05f23..81badec8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "xchain-node", - "version": "0.22.2", + "version": "0.22.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "xchain-node", - "version": "0.22.2", + "version": "0.22.3", "license": "AGPL-3.0-or-later", "dependencies": { "@dankest-llc/xchain-sdk": "^0.18.0", diff --git a/package.json b/package.json index 4e24ac80..2e936a6d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xchain-node", - "version": "0.22.2", + "version": "0.22.3", "description": "xchain-node allows users to install, configure and run XChain platform nodes.", "license": "AGPL-3.0-or-later", "repository": { diff --git a/src/release-manifest.json b/src/release-manifest.json index a993ea18..067fd8e6 100644 --- a/src/release-manifest.json +++ b/src/release-manifest.json @@ -1,9 +1,10 @@ { "_comment": [ - "Pinned component set for XChain Platform v0.22.2.", + "Pinned component set for XChain Platform v0.22.3.", "Generated by bin/write-release-manifest.js from the ACTUAL tagged master merge commits.", "xchain-node is the carrier and is not listed: checking out its tag IS this manifest.", - "A train tags only the repos it touches. This one moves xchain-hub.", + "A train tags only the repos it touches. This one moves none of the pinned", + "components: every pin below is carried forward from the train it last shipped in.", "Every other component is unchanged and keeps the tag it already carries, which is", "what section 4 means by a version being the platform version at which a component", "last changed. A gap is unchanged, not skipped.", @@ -12,7 +13,7 @@ "repo's origin/master, and is a GPG-signed annotated tag verifying against the", "platform release key (fingerprint 1DA7C4896F56EA22CF491EDF4361611A82F90B70)." ], - "platform_version": "0.22.2", + "platform_version": "0.22.3", "released": "2026-10-04", "components": { "xchain-vm": { diff --git a/src/services/config_service/database.js b/src/services/config_service/database.js index 398c02cd..d1e528f4 100644 --- a/src/services/config_service/database.js +++ b/src/services/config_service/database.js @@ -120,9 +120,12 @@ function setIndexerHubPassword(defaultConfig, defaultValues, module) { } function mergeDefaults(defaultConfig, defaultValues) { - if (defaultValues.HUB_SEED_URLS) delete defaultConfig.HUB_API_URL + const hasHubSeedUrls = defaultConfig.HUB_SEED_URLS || defaultValues.HUB_SEED_URLS + if (hasHubSeedUrls) delete defaultConfig.HUB_API_URL for (const key in defaultValues) { - if (!(key in defaultConfig)) defaultConfig[key] = defaultValues[key] + if (!(key in defaultConfig) && !(hasHubSeedUrls && key === "HUB_API_URL")) { + defaultConfig[key] = defaultValues[key] + } } } diff --git a/test/unit/config_service.test/hub_seed_suppresses_api_url.test.js b/test/unit/config_service.test/hub_seed_suppresses_api_url.test.js new file mode 100644 index 00000000..2bb99780 --- /dev/null +++ b/test/unit/config_service.test/hub_seed_suppresses_api_url.test.js @@ -0,0 +1,50 @@ +'use strict' + +const { expect, makeServiceWithConfig } = require('./helpers.test') + +describe('mergeDefaults hub seed selection', function () { + const hubApiUrl = 'http://xchain-node-xchain-hub:10000' + let savedHubSeedUrls + + beforeEach(function () { + savedHubSeedUrls = process.env.HUB_SEED_URLS + delete process.env.HUB_SEED_URLS + }) + + afterEach(function () { + if (savedHubSeedUrls === undefined) delete process.env.HUB_SEED_URLS + else process.env.HUB_SEED_URLS = savedHubSeedUrls + }) + + it('omits the default hub API URL when the per-coin config has seed URLs', async function () { + const config = await makeServiceWithConfig('HUB_SEED_URLS=default\n') + .getDefaultConfig('xchain-indexer', 'dogecoin', 'mainnet') + + expect(config.HUB_SEED_URLS).to.equal('default') + expect(config).not.to.have.property('HUB_API_URL') + }) + + it('omits the hub API URL when host defaults have seed URLs', async function () { + process.env.HUB_SEED_URLS = 'default' + const config = await makeServiceWithConfig('HUB_API_URL=http://old-feed.example:10002\n') + .getDefaultConfig('xchain-indexer', 'dogecoin', 'mainnet') + + expect(config.HUB_SEED_URLS).to.equal('default') + expect(config).not.to.have.property('HUB_API_URL') + }) + + it('keeps the default hub API URL when no seed URLs are set', async function () { + const config = await makeServiceWithConfig('') + .getDefaultConfig('xchain-indexer', 'dogecoin', 'mainnet') + + expect(config.HUB_API_URL).to.equal(hubApiUrl) + }) + + it('keeps an explicit per-coin hub API URL when no seed URLs are set', async function () { + const explicitUrl = 'http://feed.example:10002' + const config = await makeServiceWithConfig('HUB_API_URL=' + explicitUrl + '\n') + .getDefaultConfig('xchain-indexer', 'dogecoin', 'mainnet') + + expect(config.HUB_API_URL).to.equal(explicitUrl) + }) +})