From 267b4f00f7004b62c376d95ca49cf0523f0b0ea0 Mon Sep 17 00:00:00 2001 From: Mononaut Date: Mon, 12 Jan 2026 11:05:19 +0000 Subject: [PATCH] [monitoring] fix liquid health check hostnames --- backend/src/api/bitcoin/esplora-api.ts | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/backend/src/api/bitcoin/esplora-api.ts b/backend/src/api/bitcoin/esplora-api.ts index fb8ee76b2..3cb0ad93b 100644 --- a/backend/src/api/bitcoin/esplora-api.ts +++ b/backend/src/api/bitcoin/esplora-api.ts @@ -253,7 +253,12 @@ class FailoverRouter { private async $updateFrontendGitHash(host: FailoverHost): Promise { try { const url = `${host.publicDomain}/resources/config.js`; - const response = await this.pollConnection.get(url, { timeout: config.ESPLORA.FALLBACK_TIMEOUT }); + const response = await this.pollConnection.get( + url, { + timeout: config.ESPLORA.FALLBACK_TIMEOUT, + headers: Common.isLiquid() ? { 'Host': 'liquid.network' } : undefined + } + ); const match = response.data.match(/GIT_COMMIT_HASH\s*=\s*['"](.*?)['"]/); if (match && match[1]?.length) { host.hashes.frontend = match[1]; @@ -276,7 +281,7 @@ class FailoverRouter { path: '/en-US/resources/config.js', method: 'GET', headers: { - 'Host': 'mempool.space' + 'Host': Common.isLiquid() ? 'liquid.network' : 'mempool.space' }, timeout: config.ESPLORA.FALLBACK_TIMEOUT, }, (res) => { @@ -307,7 +312,12 @@ class FailoverRouter { private async $updateBackendVersions(host: FailoverHost): Promise { try { const url = `${host.publicDomain}/api/v1/backend-info`; - const response = await this.pollConnection.get(url, { timeout: config.ESPLORA.FALLBACK_TIMEOUT }); + const response = await this.pollConnection.get( + url, { + timeout: config.ESPLORA.FALLBACK_TIMEOUT, + headers: Common.isLiquid() ? { 'Host': 'liquid.network' } : undefined + } + ); if (response.data?.gitCommit) { host.hashes.backend = response.data.gitCommit; } @@ -322,7 +332,12 @@ class FailoverRouter { private async $updateSSRGitHash(host: FailoverHost): Promise { try { const url = `${host.publicDomain}/ssr/api/status`; - const response = await this.pollConnection.get(url, { timeout: config.ESPLORA.FALLBACK_TIMEOUT }); + const response = await this.pollConnection.get( + url, { + timeout: config.ESPLORA.FALLBACK_TIMEOUT, + headers: Common.isLiquid() ? { 'Host': 'liquid.network' } : undefined + } + ); if (response.data?.gitHash) { host.hashes.ssr = response.data.gitHash; }