From 1518b3ccfba5be7550baf46161d185f4d128111f Mon Sep 17 00:00:00 2001 From: Mononaut Date: Mon, 4 Mar 2024 18:29:26 +0000 Subject: [PATCH] Backend OFFICIAL config setting --- backend/mempool-config.sample.json | 1 + backend/src/__fixtures__/mempool-config.template.json | 1 + backend/src/__tests__/config.test.ts | 1 + backend/src/config.ts | 2 ++ docker/backend/mempool-config.json | 1 + docker/backend/start.sh | 2 ++ production/mempool-config.bisq.json | 1 + production/mempool-config.liquid.json | 1 + production/mempool-config.liquidtestnet.json | 1 + production/mempool-config.mainnet-lightning.json | 1 + production/mempool-config.mainnet.json | 1 + production/mempool-config.signet-lightning.json | 1 + production/mempool-config.signet.json | 1 + production/mempool-config.testnet-lightning.json | 1 + production/mempool-config.testnet.json | 1 + 15 files changed, 17 insertions(+) diff --git a/backend/mempool-config.sample.json b/backend/mempool-config.sample.json index 3c2fccfb7..5d2cf1fba 100644 --- a/backend/mempool-config.sample.json +++ b/backend/mempool-config.sample.json @@ -1,5 +1,6 @@ { "MEMPOOL": { + "OFFICIAL": false, "NETWORK": "mainnet", "BACKEND": "electrum", "ENABLED": true, diff --git a/backend/src/__fixtures__/mempool-config.template.json b/backend/src/__fixtures__/mempool-config.template.json index 9ee2bd0bc..acf628ce9 100644 --- a/backend/src/__fixtures__/mempool-config.template.json +++ b/backend/src/__fixtures__/mempool-config.template.json @@ -1,6 +1,7 @@ { "MEMPOOL": { "ENABLED": true, + "OFFICIAL": false, "NETWORK": "__MEMPOOL_NETWORK__", "BACKEND": "__MEMPOOL_BACKEND__", "BLOCKS_SUMMARIES_INDEXING": true, diff --git a/backend/src/__tests__/config.test.ts b/backend/src/__tests__/config.test.ts index 6af0ce32f..6adf0d98d 100644 --- a/backend/src/__tests__/config.test.ts +++ b/backend/src/__tests__/config.test.ts @@ -14,6 +14,7 @@ describe('Mempool Backend Config', () => { expect(config.MEMPOOL).toStrictEqual({ ENABLED: true, + OFFICIAL: false, NETWORK: 'mainnet', BACKEND: 'none', BLOCKS_SUMMARIES_INDEXING: false, diff --git a/backend/src/config.ts b/backend/src/config.ts index 32a7af3df..17699bb82 100644 --- a/backend/src/config.ts +++ b/backend/src/config.ts @@ -5,6 +5,7 @@ const configFromFile = require( interface IConfig { MEMPOOL: { ENABLED: boolean; + OFFICIAL: boolean; NETWORK: 'mainnet' | 'testnet' | 'signet' | 'liquid' | 'liquidtestnet'; BACKEND: 'esplora' | 'electrum' | 'none'; HTTP_PORT: number; @@ -161,6 +162,7 @@ interface IConfig { const defaults: IConfig = { 'MEMPOOL': { 'ENABLED': true, + 'OFFICIAL': false, 'NETWORK': 'mainnet', 'BACKEND': 'none', 'HTTP_PORT': 8999, diff --git a/docker/backend/mempool-config.json b/docker/backend/mempool-config.json index 8f69fd0c1..fb07db03d 100644 --- a/docker/backend/mempool-config.json +++ b/docker/backend/mempool-config.json @@ -3,6 +3,7 @@ "NETWORK": "__MEMPOOL_NETWORK__", "BACKEND": "__MEMPOOL_BACKEND__", "ENABLED": __MEMPOOL_ENABLED__, + "OFFICIAL": __MEMPOOL_OFFICIAL__, "HTTP_PORT": __MEMPOOL_HTTP_PORT__, "SPAWN_CLUSTER_PROCS": __MEMPOOL_SPAWN_CLUSTER_PROCS__, "API_URL_PREFIX": "__MEMPOOL_API_URL_PREFIX__", diff --git a/docker/backend/start.sh b/docker/backend/start.sh index ba9b99233..787cb0cb0 100755 --- a/docker/backend/start.sh +++ b/docker/backend/start.sh @@ -4,6 +4,7 @@ __MEMPOOL_NETWORK__=${MEMPOOL_NETWORK:=mainnet} __MEMPOOL_BACKEND__=${MEMPOOL_BACKEND:=electrum} __MEMPOOL_ENABLED__=${MEMPOOL_ENABLED:=true} +__MEMPOOL_OFFICIAL__=${MEMPOOL_OFFICIAL:=false} __MEMPOOL_HTTP_PORT__=${BACKEND_HTTP_PORT:=8999} __MEMPOOL_SPAWN_CLUSTER_PROCS__=${MEMPOOL_SPAWN_CLUSTER_PROCS:=0} __MEMPOOL_API_URL_PREFIX__=${MEMPOOL_API_URL_PREFIX:=/api/v1/} @@ -158,6 +159,7 @@ mkdir -p "${__MEMPOOL_CACHE_DIR__}" sed -i "s!__MEMPOOL_NETWORK__!${__MEMPOOL_NETWORK__}!g" mempool-config.json sed -i "s!__MEMPOOL_BACKEND__!${__MEMPOOL_BACKEND__}!g" mempool-config.json sed -i "s!__MEMPOOL_ENABLED__!${__MEMPOOL_ENABLED__}!g" mempool-config.json +sed -i "s!__MEMPOOL_OFFICIAL__!${__MEMPOOL_OFFICIAL__}!g" mempool-config.json sed -i "s!__MEMPOOL_HTTP_PORT__!${__MEMPOOL_HTTP_PORT__}!g" mempool-config.json sed -i "s!__MEMPOOL_SPAWN_CLUSTER_PROCS__!${__MEMPOOL_SPAWN_CLUSTER_PROCS__}!g" mempool-config.json sed -i "s!__MEMPOOL_API_URL_PREFIX__!${__MEMPOOL_API_URL_PREFIX__}!g" mempool-config.json diff --git a/production/mempool-config.bisq.json b/production/mempool-config.bisq.json index 26024f8a3..4913cb986 100644 --- a/production/mempool-config.bisq.json +++ b/production/mempool-config.bisq.json @@ -1,5 +1,6 @@ { "MEMPOOL": { + "OFFICIAL": true, "NETWORK": "bisq", "BACKEND": "esplora", "HTTP_PORT": 8996, diff --git a/production/mempool-config.liquid.json b/production/mempool-config.liquid.json index b852be3ae..9051bba74 100644 --- a/production/mempool-config.liquid.json +++ b/production/mempool-config.liquid.json @@ -1,5 +1,6 @@ { "MEMPOOL": { + "OFFICIAL": true, "NETWORK": "liquid", "BACKEND": "esplora", "HTTP_PORT": 8998, diff --git a/production/mempool-config.liquidtestnet.json b/production/mempool-config.liquidtestnet.json index 71c094dc6..ae6d7b1ac 100644 --- a/production/mempool-config.liquidtestnet.json +++ b/production/mempool-config.liquidtestnet.json @@ -1,5 +1,6 @@ { "MEMPOOL": { + "OFFICIAL": true, "NETWORK": "liquid", "BACKEND": "esplora", "HTTP_PORT": 8994, diff --git a/production/mempool-config.mainnet-lightning.json b/production/mempool-config.mainnet-lightning.json index bef04e7a6..8dea10b4a 100644 --- a/production/mempool-config.mainnet-lightning.json +++ b/production/mempool-config.mainnet-lightning.json @@ -1,5 +1,6 @@ { "MEMPOOL": { + "OFFICIAL": true, "ENABLED": false, "NETWORK": "mainnet", "BACKEND": "esplora", diff --git a/production/mempool-config.mainnet.json b/production/mempool-config.mainnet.json index 1bb9e35a5..47db0a322 100644 --- a/production/mempool-config.mainnet.json +++ b/production/mempool-config.mainnet.json @@ -1,5 +1,6 @@ { "MEMPOOL": { + "OFFICIAL": true, "NETWORK": "mainnet", "BACKEND": "esplora", "HTTP_PORT": 8999, diff --git a/production/mempool-config.signet-lightning.json b/production/mempool-config.signet-lightning.json index 9cffe55ca..f90b18f50 100644 --- a/production/mempool-config.signet-lightning.json +++ b/production/mempool-config.signet-lightning.json @@ -1,5 +1,6 @@ { "MEMPOOL": { + "OFFICIAL": true, "ENABLED": false, "NETWORK": "signet", "BACKEND": "esplora", diff --git a/production/mempool-config.signet.json b/production/mempool-config.signet.json index 71b52be5b..433e1e4a7 100644 --- a/production/mempool-config.signet.json +++ b/production/mempool-config.signet.json @@ -1,5 +1,6 @@ { "MEMPOOL": { + "OFFICIAL": true, "NETWORK": "signet", "BACKEND": "esplora", "HTTP_PORT": 8995, diff --git a/production/mempool-config.testnet-lightning.json b/production/mempool-config.testnet-lightning.json index f7bdebbeb..59a858cbf 100644 --- a/production/mempool-config.testnet-lightning.json +++ b/production/mempool-config.testnet-lightning.json @@ -1,5 +1,6 @@ { "MEMPOOL": { + "OFFICIAL": true, "ENABLED": false, "NETWORK": "testnet", "BACKEND": "esplora", diff --git a/production/mempool-config.testnet.json b/production/mempool-config.testnet.json index e35dfe78e..742631025 100644 --- a/production/mempool-config.testnet.json +++ b/production/mempool-config.testnet.json @@ -1,5 +1,6 @@ { "MEMPOOL": { + "OFFICIAL": true, "NETWORK": "testnet", "BACKEND": "esplora", "HTTP_PORT": 8997,