Backend OFFICIAL config setting

This commit is contained in:
Mononaut 2024-03-04 18:29:26 +00:00
parent 5898143f66
commit 1518b3ccfb
No known key found for this signature in database
GPG key ID: A3F058E41374C04E
15 changed files with 17 additions and 0 deletions

View file

@ -1,5 +1,6 @@
{ {
"MEMPOOL": { "MEMPOOL": {
"OFFICIAL": false,
"NETWORK": "mainnet", "NETWORK": "mainnet",
"BACKEND": "electrum", "BACKEND": "electrum",
"ENABLED": true, "ENABLED": true,

View file

@ -1,6 +1,7 @@
{ {
"MEMPOOL": { "MEMPOOL": {
"ENABLED": true, "ENABLED": true,
"OFFICIAL": false,
"NETWORK": "__MEMPOOL_NETWORK__", "NETWORK": "__MEMPOOL_NETWORK__",
"BACKEND": "__MEMPOOL_BACKEND__", "BACKEND": "__MEMPOOL_BACKEND__",
"BLOCKS_SUMMARIES_INDEXING": true, "BLOCKS_SUMMARIES_INDEXING": true,

View file

@ -14,6 +14,7 @@ describe('Mempool Backend Config', () => {
expect(config.MEMPOOL).toStrictEqual({ expect(config.MEMPOOL).toStrictEqual({
ENABLED: true, ENABLED: true,
OFFICIAL: false,
NETWORK: 'mainnet', NETWORK: 'mainnet',
BACKEND: 'none', BACKEND: 'none',
BLOCKS_SUMMARIES_INDEXING: false, BLOCKS_SUMMARIES_INDEXING: false,

View file

@ -5,6 +5,7 @@ const configFromFile = require(
interface IConfig { interface IConfig {
MEMPOOL: { MEMPOOL: {
ENABLED: boolean; ENABLED: boolean;
OFFICIAL: boolean;
NETWORK: 'mainnet' | 'testnet' | 'signet' | 'liquid' | 'liquidtestnet'; NETWORK: 'mainnet' | 'testnet' | 'signet' | 'liquid' | 'liquidtestnet';
BACKEND: 'esplora' | 'electrum' | 'none'; BACKEND: 'esplora' | 'electrum' | 'none';
HTTP_PORT: number; HTTP_PORT: number;
@ -161,6 +162,7 @@ interface IConfig {
const defaults: IConfig = { const defaults: IConfig = {
'MEMPOOL': { 'MEMPOOL': {
'ENABLED': true, 'ENABLED': true,
'OFFICIAL': false,
'NETWORK': 'mainnet', 'NETWORK': 'mainnet',
'BACKEND': 'none', 'BACKEND': 'none',
'HTTP_PORT': 8999, 'HTTP_PORT': 8999,

View file

@ -3,6 +3,7 @@
"NETWORK": "__MEMPOOL_NETWORK__", "NETWORK": "__MEMPOOL_NETWORK__",
"BACKEND": "__MEMPOOL_BACKEND__", "BACKEND": "__MEMPOOL_BACKEND__",
"ENABLED": __MEMPOOL_ENABLED__, "ENABLED": __MEMPOOL_ENABLED__,
"OFFICIAL": __MEMPOOL_OFFICIAL__,
"HTTP_PORT": __MEMPOOL_HTTP_PORT__, "HTTP_PORT": __MEMPOOL_HTTP_PORT__,
"SPAWN_CLUSTER_PROCS": __MEMPOOL_SPAWN_CLUSTER_PROCS__, "SPAWN_CLUSTER_PROCS": __MEMPOOL_SPAWN_CLUSTER_PROCS__,
"API_URL_PREFIX": "__MEMPOOL_API_URL_PREFIX__", "API_URL_PREFIX": "__MEMPOOL_API_URL_PREFIX__",

View file

@ -4,6 +4,7 @@
__MEMPOOL_NETWORK__=${MEMPOOL_NETWORK:=mainnet} __MEMPOOL_NETWORK__=${MEMPOOL_NETWORK:=mainnet}
__MEMPOOL_BACKEND__=${MEMPOOL_BACKEND:=electrum} __MEMPOOL_BACKEND__=${MEMPOOL_BACKEND:=electrum}
__MEMPOOL_ENABLED__=${MEMPOOL_ENABLED:=true} __MEMPOOL_ENABLED__=${MEMPOOL_ENABLED:=true}
__MEMPOOL_OFFICIAL__=${MEMPOOL_OFFICIAL:=false}
__MEMPOOL_HTTP_PORT__=${BACKEND_HTTP_PORT:=8999} __MEMPOOL_HTTP_PORT__=${BACKEND_HTTP_PORT:=8999}
__MEMPOOL_SPAWN_CLUSTER_PROCS__=${MEMPOOL_SPAWN_CLUSTER_PROCS:=0} __MEMPOOL_SPAWN_CLUSTER_PROCS__=${MEMPOOL_SPAWN_CLUSTER_PROCS:=0}
__MEMPOOL_API_URL_PREFIX__=${MEMPOOL_API_URL_PREFIX:=/api/v1/} __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_NETWORK__!${__MEMPOOL_NETWORK__}!g" mempool-config.json
sed -i "s!__MEMPOOL_BACKEND__!${__MEMPOOL_BACKEND__}!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_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_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_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 sed -i "s!__MEMPOOL_API_URL_PREFIX__!${__MEMPOOL_API_URL_PREFIX__}!g" mempool-config.json

View file

@ -1,5 +1,6 @@
{ {
"MEMPOOL": { "MEMPOOL": {
"OFFICIAL": true,
"NETWORK": "bisq", "NETWORK": "bisq",
"BACKEND": "esplora", "BACKEND": "esplora",
"HTTP_PORT": 8996, "HTTP_PORT": 8996,

View file

@ -1,5 +1,6 @@
{ {
"MEMPOOL": { "MEMPOOL": {
"OFFICIAL": true,
"NETWORK": "liquid", "NETWORK": "liquid",
"BACKEND": "esplora", "BACKEND": "esplora",
"HTTP_PORT": 8998, "HTTP_PORT": 8998,

View file

@ -1,5 +1,6 @@
{ {
"MEMPOOL": { "MEMPOOL": {
"OFFICIAL": true,
"NETWORK": "liquid", "NETWORK": "liquid",
"BACKEND": "esplora", "BACKEND": "esplora",
"HTTP_PORT": 8994, "HTTP_PORT": 8994,

View file

@ -1,5 +1,6 @@
{ {
"MEMPOOL": { "MEMPOOL": {
"OFFICIAL": true,
"ENABLED": false, "ENABLED": false,
"NETWORK": "mainnet", "NETWORK": "mainnet",
"BACKEND": "esplora", "BACKEND": "esplora",

View file

@ -1,5 +1,6 @@
{ {
"MEMPOOL": { "MEMPOOL": {
"OFFICIAL": true,
"NETWORK": "mainnet", "NETWORK": "mainnet",
"BACKEND": "esplora", "BACKEND": "esplora",
"HTTP_PORT": 8999, "HTTP_PORT": 8999,

View file

@ -1,5 +1,6 @@
{ {
"MEMPOOL": { "MEMPOOL": {
"OFFICIAL": true,
"ENABLED": false, "ENABLED": false,
"NETWORK": "signet", "NETWORK": "signet",
"BACKEND": "esplora", "BACKEND": "esplora",

View file

@ -1,5 +1,6 @@
{ {
"MEMPOOL": { "MEMPOOL": {
"OFFICIAL": true,
"NETWORK": "signet", "NETWORK": "signet",
"BACKEND": "esplora", "BACKEND": "esplora",
"HTTP_PORT": 8995, "HTTP_PORT": 8995,

View file

@ -1,5 +1,6 @@
{ {
"MEMPOOL": { "MEMPOOL": {
"OFFICIAL": true,
"ENABLED": false, "ENABLED": false,
"NETWORK": "testnet", "NETWORK": "testnet",
"BACKEND": "esplora", "BACKEND": "esplora",

View file

@ -1,5 +1,6 @@
{ {
"MEMPOOL": { "MEMPOOL": {
"OFFICIAL": true,
"NETWORK": "testnet", "NETWORK": "testnet",
"BACKEND": "esplora", "BACKEND": "esplora",
"HTTP_PORT": 8997, "HTTP_PORT": 8997,