diff --git a/backend/README.md b/backend/README.md index e3ac55487..6ae4ae3e2 100644 --- a/backend/README.md +++ b/backend/README.md @@ -229,11 +229,11 @@ Generate block at regular interval (every 10 seconds in this example): ### Mining pools update -By default, mining pools will be not automatically updated regularly (`config.MEMPOOL.AUTOMATIC_BLOCK_REINDEXING` is set to `false`). +By default, mining pools will be not automatically updated regularly (`config.MEMPOOL.AUTOMATIC_POOLS_UPDATE` is set to `false`). To manually update your mining pools, you can use the `--update-pools` command line flag when you run the nodejs backend. For example `npm run start --update-pools`. This will trigger the mining pools update and automatically re-index appropriate blocks. -You can enable the automatic mining pools update by settings `config.MEMPOOL.AUTOMATIC_BLOCK_REINDEXING` to `true` in your `mempool-config.json`. +You can enable the automatic mining pools update by settings `config.MEMPOOL.AUTOMATIC_POOLS_UPDATE` to `true` in your `mempool-config.json`. When a `coinbase tag` or `coinbase address` change is detected, pool assignments for all relevant blocks (tagged to that pool or the `unknown` mining pool, starting from height 130635) are updated using the new criteria. diff --git a/backend/mempool-config.sample.json b/backend/mempool-config.sample.json index 660c19b1a..4650c1e64 100644 --- a/backend/mempool-config.sample.json +++ b/backend/mempool-config.sample.json @@ -24,7 +24,7 @@ "EXTERNAL_RETRY_INTERVAL": 0, "USER_AGENT": "mempool", "STDOUT_LOG_MIN_PRIORITY": "debug", - "AUTOMATIC_BLOCK_REINDEXING": false, + "AUTOMATIC_POOLS_UPDATE": false, "POOLS_JSON_URL": "https://raw.githubusercontent.com/mempool/mining-pools/master/pools-v2.json", "POOLS_JSON_TREE_URL": "https://api.github.com/repos/mempool/mining-pools/git/trees/master", "AUDIT": false, diff --git a/backend/src/__fixtures__/mempool-config.template.json b/backend/src/__fixtures__/mempool-config.template.json index 7880f686c..3796b7f22 100644 --- a/backend/src/__fixtures__/mempool-config.template.json +++ b/backend/src/__fixtures__/mempool-config.template.json @@ -10,7 +10,7 @@ "UNIX_SOCKET_PATH": "/mempool/socket/mempool-bitcoin-mainnet", "SPAWN_CLUSTER_PROCS": 2, "API_URL_PREFIX": "__MEMPOOL_API_URL_PREFIX__", - "AUTOMATIC_BLOCK_REINDEXING": false, + "AUTOMATIC_POOLS_UPDATE": false, "POLL_RATE_MS": 3, "CACHE_DIR": "__MEMPOOL_CACHE_DIR__", "CACHE_ENABLED": true, diff --git a/backend/src/__tests__/config.test.ts b/backend/src/__tests__/config.test.ts index 367816da8..050213143 100644 --- a/backend/src/__tests__/config.test.ts +++ b/backend/src/__tests__/config.test.ts @@ -23,7 +23,7 @@ describe('Mempool Backend Config', () => { UNIX_SOCKET_PATH: '', SPAWN_CLUSTER_PROCS: 0, API_URL_PREFIX: '/api/v1/', - AUTOMATIC_BLOCK_REINDEXING: false, + AUTOMATIC_POOLS_UPDATE: false, POLL_RATE_MS: 2000, CACHE_DIR: './cache', CACHE_ENABLED: true, diff --git a/backend/src/config.ts b/backend/src/config.ts index 65dca3560..b0afe7f23 100644 --- a/backend/src/config.ts +++ b/backend/src/config.ts @@ -29,7 +29,7 @@ interface IConfig { EXTERNAL_RETRY_INTERVAL: number; USER_AGENT: string; STDOUT_LOG_MIN_PRIORITY: 'emerg' | 'alert' | 'crit' | 'err' | 'warn' | 'notice' | 'info' | 'debug'; - AUTOMATIC_BLOCK_REINDEXING: boolean; + AUTOMATIC_POOLS_UPDATE: boolean; POOLS_JSON_URL: string, POOLS_JSON_TREE_URL: string, AUDIT: boolean; @@ -189,7 +189,7 @@ const defaults: IConfig = { 'EXTERNAL_RETRY_INTERVAL': 0, 'USER_AGENT': 'mempool', 'STDOUT_LOG_MIN_PRIORITY': 'debug', - 'AUTOMATIC_BLOCK_REINDEXING': false, + 'AUTOMATIC_POOLS_UPDATE': false, 'POOLS_JSON_URL': 'https://raw.githubusercontent.com/mempool/mining-pools/master/pools-v2.json', 'POOLS_JSON_TREE_URL': 'https://api.github.com/repos/mempool/mining-pools/git/trees/master', 'AUDIT': false, diff --git a/backend/src/tasks/pools-updater.ts b/backend/src/tasks/pools-updater.ts index 6e8173c21..a3a3265c6 100644 --- a/backend/src/tasks/pools-updater.ts +++ b/backend/src/tasks/pools-updater.ts @@ -50,10 +50,10 @@ class PoolsUpdater { // See backend README for more details about the mining pools update process if (this.currentSha !== null && // If we don't have any mining pool, download it at least once - config.MEMPOOL.AUTOMATIC_BLOCK_REINDEXING !== true && // Automatic pools update is disabled + config.MEMPOOL.AUTOMATIC_POOLS_UPDATE !== true && // Automatic pools update is disabled !process.env.npm_config_update_pools // We're not manually updating mining pool ) { - logger.warn(`Updated mining pools data is available (${githubSha}) but AUTOMATIC_BLOCK_REINDEXING is disabled`); + logger.warn(`Updated mining pools data is available (${githubSha}) but AUTOMATIC_POOLS_UPDATE is disabled`); logger.info(`You can update your mining pools using the --update-pools command flag. You may want to clear your nginx cache as well if applicable`); return; } diff --git a/docker/README.md b/docker/README.md index 32ed6fcde..ce1548e91 100644 --- a/docker/README.md +++ b/docker/README.md @@ -106,7 +106,7 @@ Below we list all settings from `mempool-config.json` and the corresponding over "EXTERNAL_ASSETS": [], "STDOUT_LOG_MIN_PRIORITY": "info", "INDEXING_BLOCKS_AMOUNT": false, - "AUTOMATIC_BLOCK_REINDEXING": false, + "AUTOMATIC_POOLS_UPDATE": false, "POOLS_JSON_URL": "https://raw.githubusercontent.com/mempool/mining-pools/master/pools-v2.json", "POOLS_JSON_TREE_URL": "https://api.github.com/repos/mempool/mining-pools/git/trees/master", "CPFP_INDEXING": false, @@ -137,7 +137,7 @@ Corresponding `docker-compose.yml` overrides: MEMPOOL_EXTERNAL_ASSETS: "" MEMPOOL_STDOUT_LOG_MIN_PRIORITY: "" MEMPOOL_INDEXING_BLOCKS_AMOUNT: "" - MEMPOOL_AUTOMATIC_BLOCK_REINDEXING: "" + MEMPOOL_AUTOMATIC_POOLS_UPDATE: "" MEMPOOL_POOLS_JSON_URL: "" MEMPOOL_POOLS_JSON_TREE_URL: "" MEMPOOL_CPFP_INDEXING: "" diff --git a/docker/backend/mempool-config.json b/docker/backend/mempool-config.json index 7a4b9e46a..79cd14644 100644 --- a/docker/backend/mempool-config.json +++ b/docker/backend/mempool-config.json @@ -25,7 +25,7 @@ "INDEXING_BLOCKS_AMOUNT": __MEMPOOL_INDEXING_BLOCKS_AMOUNT__, "BLOCKS_SUMMARIES_INDEXING": __MEMPOOL_BLOCKS_SUMMARIES_INDEXING__, "GOGGLES_INDEXING": __MEMPOOL_GOGGLES_INDEXING__, - "AUTOMATIC_BLOCK_REINDEXING": __MEMPOOL_AUTOMATIC_BLOCK_REINDEXING__, + "AUTOMATIC_POOLS_UPDATE": __MEMPOOL_AUTOMATIC_POOLS_UPDATE__, "AUDIT": __MEMPOOL_AUDIT__, "RUST_GBT": __MEMPOOL_RUST_GBT__, "LIMIT_GBT": __MEMPOOL_LIMIT_GBT__, diff --git a/docker/backend/start.sh b/docker/backend/start.sh index 847eae63a..a381ace88 100755 --- a/docker/backend/start.sh +++ b/docker/backend/start.sh @@ -26,7 +26,7 @@ __MEMPOOL_EXTERNAL_MAX_RETRY__=${MEMPOOL_EXTERNAL_MAX_RETRY:=1} __MEMPOOL_EXTERNAL_RETRY_INTERVAL__=${MEMPOOL_EXTERNAL_RETRY_INTERVAL:=0} __MEMPOOL_USER_AGENT__=${MEMPOOL_USER_AGENT:=mempool} __MEMPOOL_STDOUT_LOG_MIN_PRIORITY__=${MEMPOOL_STDOUT_LOG_MIN_PRIORITY:=info} -__MEMPOOL_AUTOMATIC_BLOCK_REINDEXING__=${MEMPOOL_AUTOMATIC_BLOCK_REINDEXING:=false} +__MEMPOOL_AUTOMATIC_POOLS_UPDATE__=${MEMPOOL_AUTOMATIC_POOLS_UPDATE:=false} __MEMPOOL_POOLS_JSON_URL__=${MEMPOOL_POOLS_JSON_URL:=https://raw.githubusercontent.com/mempool/mining-pools/master/pools-v2.json} __MEMPOOL_POOLS_JSON_TREE_URL__=${MEMPOOL_POOLS_JSON_TREE_URL:=https://api.github.com/repos/mempool/mining-pools/git/trees/master} __MEMPOOL_AUDIT__=${MEMPOOL_AUDIT:=false} @@ -184,7 +184,7 @@ sed -i "s!__MEMPOOL_EXTERNAL_MAX_RETRY__!${__MEMPOOL_EXTERNAL_MAX_RETRY__}!g" me sed -i "s!__MEMPOOL_EXTERNAL_RETRY_INTERVAL__!${__MEMPOOL_EXTERNAL_RETRY_INTERVAL__}!g" mempool-config.json sed -i "s!__MEMPOOL_USER_AGENT__!${__MEMPOOL_USER_AGENT__}!g" mempool-config.json sed -i "s!__MEMPOOL_STDOUT_LOG_MIN_PRIORITY__!${__MEMPOOL_STDOUT_LOG_MIN_PRIORITY__}!g" mempool-config.json -sed -i "s!__MEMPOOL_AUTOMATIC_BLOCK_REINDEXING__!${__MEMPOOL_AUTOMATIC_BLOCK_REINDEXING__}!g" mempool-config.json +sed -i "s!__MEMPOOL_AUTOMATIC_POOLS_UPDATE__!${__MEMPOOL_AUTOMATIC_POOLS_UPDATE__}!g" mempool-config.json sed -i "s!__MEMPOOL_POOLS_JSON_URL__!${__MEMPOOL_POOLS_JSON_URL__}!g" mempool-config.json sed -i "s!__MEMPOOL_POOLS_JSON_TREE_URL__!${__MEMPOOL_POOLS_JSON_TREE_URL__}!g" mempool-config.json sed -i "s!__MEMPOOL_AUDIT__!${__MEMPOOL_AUDIT__}!g" mempool-config.json diff --git a/production/mempool-config.mainnet.json b/production/mempool-config.mainnet.json index ae6c7ae46..f07cd76e3 100644 --- a/production/mempool-config.mainnet.json +++ b/production/mempool-config.mainnet.json @@ -13,6 +13,7 @@ "INDEXING_BLOCKS_AMOUNT": -1, "BLOCKS_SUMMARIES_INDEXING": true, "GOGGLES_INDEXING": true, + "AUTOMATIC_POOLS_UPDATE": true, "AUDIT": true, "CPFP_INDEXING": true, "RUST_GBT": true, diff --git a/production/mempool-config.signet.json b/production/mempool-config.signet.json index 6ebd9e8b3..57cb37443 100644 --- a/production/mempool-config.signet.json +++ b/production/mempool-config.signet.json @@ -8,6 +8,7 @@ "SPAWN_CLUSTER_PROCS": 0, "API_URL_PREFIX": "/api/v1/", "INDEXING_BLOCKS_AMOUNT": -1, + "AUTOMATIC_POOLS_UPDATE": true, "AUDIT": true, "RUST_GBT": true, "POLL_RATE_MS": 1000, diff --git a/production/mempool-config.testnet.json b/production/mempool-config.testnet.json index 2394ac467..1a216c54b 100644 --- a/production/mempool-config.testnet.json +++ b/production/mempool-config.testnet.json @@ -8,6 +8,7 @@ "SPAWN_CLUSTER_PROCS": 0, "API_URL_PREFIX": "/api/v1/", "INDEXING_BLOCKS_AMOUNT": -1, + "AUTOMATIC_POOLS_UPDATE": true, "AUDIT": true, "RUST_GBT": true, "POLL_RATE_MS": 1000, diff --git a/production/mempool-config.testnet4.json b/production/mempool-config.testnet4.json index 64336866d..db7f68ea4 100644 --- a/production/mempool-config.testnet4.json +++ b/production/mempool-config.testnet4.json @@ -8,6 +8,7 @@ "SPAWN_CLUSTER_PROCS": 0, "API_URL_PREFIX": "/api/v1/", "INDEXING_BLOCKS_AMOUNT": -1, + "AUTOMATIC_POOLS_UPDATE": true, "AUDIT": true, "RUST_GBT": true, "POLL_RATE_MS": 1000,