Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
7 changes: 4 additions & 3 deletions src/release-manifest.json
Original file line number Diff line number Diff line change
@@ -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.",
Expand All @@ -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": {
Expand Down
7 changes: 5 additions & 2 deletions src/services/config_service/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}
}
}

Expand Down
50 changes: 50 additions & 0 deletions test/unit/config_service.test/hub_seed_suppresses_api_url.test.js
Original file line number Diff line number Diff line change
@@ -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)
})
})
Loading