diff --git a/backend/mempool-config.sample.json b/backend/mempool-config.sample.json index 4650c1e64..0b3faeb97 100644 --- a/backend/mempool-config.sample.json +++ b/backend/mempool-config.sample.json @@ -7,6 +7,7 @@ "HTTP_PORT": 8999, "SPAWN_CLUSTER_PROCS": 0, "API_URL_PREFIX": "/api/v1/", + "API_V2_URL_PREFIX": "/api/v2/", "POLL_RATE_MS": 2000, "CACHE_DIR": "./cache", "CACHE_ENABLED": true, diff --git a/backend/src/__fixtures__/mempool-config.template.json b/backend/src/__fixtures__/mempool-config.template.json index 3796b7f22..b0a882217 100644 --- a/backend/src/__fixtures__/mempool-config.template.json +++ b/backend/src/__fixtures__/mempool-config.template.json @@ -10,6 +10,7 @@ "UNIX_SOCKET_PATH": "/mempool/socket/mempool-bitcoin-mainnet", "SPAWN_CLUSTER_PROCS": 2, "API_URL_PREFIX": "__MEMPOOL_API_URL_PREFIX__", + "API_V2_URL_PREFIX": "__MEMPOOL_API_V2_URL_PREFIX__", "AUTOMATIC_POOLS_UPDATE": false, "POLL_RATE_MS": 3, "CACHE_DIR": "__MEMPOOL_CACHE_DIR__", diff --git a/backend/src/__tests__/config.test.ts b/backend/src/__tests__/config.test.ts index 050213143..b2f6afa96 100644 --- a/backend/src/__tests__/config.test.ts +++ b/backend/src/__tests__/config.test.ts @@ -23,6 +23,7 @@ describe('Mempool Backend Config', () => { UNIX_SOCKET_PATH: '', SPAWN_CLUSTER_PROCS: 0, API_URL_PREFIX: '/api/v1/', + API_V2_URL_PREFIX: '/api/v2/', AUTOMATIC_POOLS_UPDATE: false, POLL_RATE_MS: 2000, CACHE_DIR: './cache', diff --git a/backend/src/config.ts b/backend/src/config.ts index b0afe7f23..28002bb94 100644 --- a/backend/src/config.ts +++ b/backend/src/config.ts @@ -12,6 +12,7 @@ interface IConfig { UNIX_SOCKET_PATH: string; SPAWN_CLUSTER_PROCS: number; API_URL_PREFIX: string; + API_V2_URL_PREFIX: string; POLL_RATE_MS: number; CACHE_DIR: string; CACHE_ENABLED: boolean; @@ -172,6 +173,7 @@ const defaults: IConfig = { 'UNIX_SOCKET_PATH': '', 'SPAWN_CLUSTER_PROCS': 0, 'API_URL_PREFIX': '/api/v1/', + 'API_V2_URL_PREFIX': '/api/v2/', 'POLL_RATE_MS': 2000, 'CACHE_DIR': './cache', 'CACHE_ENABLED': true, diff --git a/docker/backend/mempool-config.json b/docker/backend/mempool-config.json index 79cd14644..d72a36d50 100644 --- a/docker/backend/mempool-config.json +++ b/docker/backend/mempool-config.json @@ -8,6 +8,7 @@ "SPAWN_CLUSTER_PROCS": __MEMPOOL_SPAWN_CLUSTER_PROCS__, "UNIX_SOCKET_PATH": "__MEMPOOL_UNIX_SOCKET_PATH__", "API_URL_PREFIX": "__MEMPOOL_API_URL_PREFIX__", + "API_V2_URL_PREFIX": "__MEMPOOL_API_V2_URL_PREFIX__", "POLL_RATE_MS": __MEMPOOL_POLL_RATE_MS__, "CACHE_DIR": "__MEMPOOL_CACHE_DIR__", "CACHE_ENABLED": __MEMPOOL_CACHE_ENABLED__, diff --git a/docker/backend/start.sh b/docker/backend/start.sh index 8033531ef..7ec3b3f66 100755 --- a/docker/backend/start.sh +++ b/docker/backend/start.sh @@ -9,6 +9,7 @@ __MEMPOOL_HTTP_PORT__=${BACKEND_HTTP_PORT:=8999} __MEMPOOL_SPAWN_CLUSTER_PROCS__=${MEMPOOL_SPAWN_CLUSTER_PROCS:=0} __MEMPOOL_UNIX_SOCKET_PATH__=${MEMPOOL_UNIX_SOCKET_PATH:=""} __MEMPOOL_API_URL_PREFIX__=${MEMPOOL_API_URL_PREFIX:=/api/v1/} +__MEMPOOL_API_V2_URL_PREFIX__=${MEMPOOL_API_V2_URL_PREFIX:=/api/v2/} __MEMPOOL_POLL_RATE_MS__=${MEMPOOL_POLL_RATE_MS:=2000} __MEMPOOL_CACHE_DIR__=${MEMPOOL_CACHE_DIR:=./cache} __MEMPOOL_CACHE_ENABLED__=${MEMPOOL_CACHE_ENABLED:=true} @@ -167,6 +168,7 @@ 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_UNIX_SOCKET_PATH__!${__MEMPOOL_UNIX_SOCKET_PATH__}!g" mempool-config.json sed -i "s!__MEMPOOL_API_URL_PREFIX__!${__MEMPOOL_API_URL_PREFIX__}!g" mempool-config.json +sed -i "s!__MEMPOOL_API_V2_URL_PREFIX__!${__MEMPOOL_API_V2_URL_PREFIX__}!g" mempool-config.json sed -i "s!__MEMPOOL_POLL_RATE_MS__!${__MEMPOOL_POLL_RATE_MS__}!g" mempool-config.json sed -i "s!__MEMPOOL_CACHE_DIR__!${__MEMPOOL_CACHE_DIR__}!g" mempool-config.json sed -i "s!__MEMPOOL_CACHE_ENABLED__!${__MEMPOOL_CACHE_ENABLED__}!g" mempool-config.json