diff --git a/backend/mempool-config.sample.json b/backend/mempool-config.sample.json index eea54ae46..b71f3586d 100644 --- a/backend/mempool-config.sample.json +++ b/backend/mempool-config.sample.json @@ -20,7 +20,8 @@ "EXTERNAL_MAX_RETRY": 1, "EXTERNAL_RETRY_INTERVAL": 0, "USER_AGENT": "mempool", - "STDOUT_LOG_MIN_PRIORITY": "debug" + "STDOUT_LOG_MIN_PRIORITY": "debug", + "AUTOMATIC_BLOCK_REINDEXING": false }, "CORE_RPC": { "HOST": "127.0.0.1", diff --git a/backend/src/api/blocks.ts b/backend/src/api/blocks.ts index b259f701d..62f3efa88 100644 --- a/backend/src/api/blocks.ts +++ b/backend/src/api/blocks.ts @@ -579,17 +579,13 @@ class Blocks { } public async $getBlocks(fromHeight?: number, limit: number = 15): Promise { - let currentHeight = fromHeight !== undefined ? fromHeight : this.getCurrentBlockHeight(); + let currentHeight = fromHeight !== undefined ? fromHeight : await blocksRepository.$mostRecentBlockHeight(); const returnBlocks: BlockExtended[] = []; if (currentHeight < 0) { return returnBlocks; } - if (currentHeight === 0 && Common.indexingEnabled()) { - currentHeight = await blocksRepository.$mostRecentBlockHeight(); - } - // Check if block height exist in local cache to skip the hash lookup const blockByHeight = this.getBlocks().find((b) => b.height === currentHeight); let startFromHash: string | null = null; diff --git a/backend/src/api/mining.ts b/backend/src/api/mining.ts index d2504274c..50a86e73e 100644 --- a/backend/src/api/mining.ts +++ b/backend/src/api/mining.ts @@ -173,26 +173,25 @@ class Mining { */ public async $generatePoolHashrateHistory(): Promise { const now = new Date(); + const lastestRunDate = await HashratesRepository.$getLatestRun('last_weekly_hashrates_indexing'); - try { - const lastestRunDate = await HashratesRepository.$getLatestRun('last_weekly_hashrates_indexing'); - - // Run only if: - // * lastestRunDate is set to 0 (node backend restart, reorg) - // * we started a new week (around Monday midnight) - const runIndexing = lastestRunDate === 0 || now.getUTCDay() === 1 && lastestRunDate !== now.getUTCDate(); - if (!runIndexing) { - return; - } - } catch (e) { - throw e; + // Run only if: + // * lastestRunDate is set to 0 (node backend restart, reorg) + // * we started a new week (around Monday midnight) + const runIndexing = lastestRunDate === 0 || now.getUTCDay() === 1 && lastestRunDate !== now.getUTCDate(); + if (!runIndexing) { + return; } try { + const oldestConsecutiveBlockTimestamp = 1000 * (await BlocksRepository.$getOldestConsecutiveBlock()).timestamp; + + const genesisBlock = await bitcoinClient.getBlock(await bitcoinClient.getBlockHash(0)); + const genesisTimestamp = genesisBlock.time * 1000; + const indexedTimestamp = await HashratesRepository.$getWeeklyHashrateTimestamps(); const hashrates: any[] = []; - const genesisTimestamp = 1231006505000; // bitcoin-cli getblock 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f - + const lastMonday = new Date(now.setDate(now.getDate() - (now.getDay() + 6) % 7)); const lastMondayMidnight = this.getDateMidnight(lastMonday); let toTimestamp = lastMondayMidnight.getTime(); @@ -207,7 +206,7 @@ class Mining { logger.debug(`Indexing weekly mining pool hashrate`); loadingIndicators.setProgress('weekly-hashrate-indexing', 0); - while (toTimestamp > genesisTimestamp) { + while (toTimestamp > genesisTimestamp && toTimestamp > oldestConsecutiveBlockTimestamp) { const fromTimestamp = toTimestamp - 604800000; // Skip already indexed weeks @@ -217,14 +216,6 @@ class Mining { continue; } - // Check if we have blocks for the previous week (which mean that the week - // we are currently indexing has complete data) - const blockStatsPreviousWeek: any = await BlocksRepository.$blockCountBetweenTimestamp( - null, (fromTimestamp - 604800000) / 1000, (toTimestamp - 604800000) / 1000); - if (blockStatsPreviousWeek.blockCount === 0) { // We are done indexing - break; - } - const blockStats: any = await BlocksRepository.$blockCountBetweenTimestamp( null, fromTimestamp / 1000, toTimestamp / 1000); const lastBlockHashrate = await bitcoinClient.getNetworkHashPs(blockStats.blockCount, @@ -232,25 +223,27 @@ class Mining { let pools = await PoolsRepository.$getPoolsInfoBetween(fromTimestamp / 1000, toTimestamp / 1000); const totalBlocks = pools.reduce((acc, pool) => acc + pool.blockCount, 0); - pools = pools.map((pool: any) => { - pool.hashrate = (pool.blockCount / totalBlocks) * lastBlockHashrate; - pool.share = (pool.blockCount / totalBlocks); - return pool; - }); - - for (const pool of pools) { - hashrates.push({ - hashrateTimestamp: toTimestamp / 1000, - avgHashrate: pool['hashrate'], - poolId: pool.poolId, - share: pool['share'], - type: 'weekly', + if (totalBlocks > 0) { + pools = pools.map((pool: any) => { + pool.hashrate = (pool.blockCount / totalBlocks) * lastBlockHashrate; + pool.share = (pool.blockCount / totalBlocks); + return pool; }); - } - newlyIndexed += hashrates.length; - await HashratesRepository.$saveHashrates(hashrates); - hashrates.length = 0; + for (const pool of pools) { + hashrates.push({ + hashrateTimestamp: toTimestamp / 1000, + avgHashrate: pool['hashrate'] , + poolId: pool.poolId, + share: pool['share'], + type: 'weekly', + }); + } + + newlyIndexed += hashrates.length; + await HashratesRepository.$saveHashrates(hashrates); + hashrates.length = 0; + } const elapsedSeconds = Math.max(1, Math.round((new Date().getTime() / 1000) - timer)); if (elapsedSeconds > 1) { @@ -285,20 +278,19 @@ class Mining { * [INDEXING] Generate daily hashrate data */ public async $generateNetworkHashrateHistory(): Promise { - try { - // We only run this once a day around midnight - const latestRunDate = await HashratesRepository.$getLatestRun('last_hashrates_indexing'); - const now = new Date().getUTCDate(); - if (now === latestRunDate) { - return; - } - } catch (e) { - throw e; + // We only run this once a day around midnight + const latestRunDate = await HashratesRepository.$getLatestRun('last_hashrates_indexing'); + const now = new Date().getUTCDate(); + if (now === latestRunDate) { + return; } + const oldestConsecutiveBlockTimestamp = 1000 * (await BlocksRepository.$getOldestConsecutiveBlock()).timestamp; + try { - const indexedTimestamp = (await HashratesRepository.$getNetworkDailyHashrate(null)).map(hashrate => hashrate.timestamp); - const genesisTimestamp = (config.MEMPOOL.NETWORK === 'signet') ? 1598918400000 : 1231006505000; // bitcoin-cli getblock 000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f + const genesisBlock = await bitcoinClient.getBlock(await bitcoinClient.getBlockHash(0)); + const genesisTimestamp = genesisBlock.time * 1000; + const indexedTimestamp = (await HashratesRepository.$getRawNetworkDailyHashrate(null)).map(hashrate => hashrate.timestamp); const lastMidnight = this.getDateMidnight(new Date()); let toTimestamp = Math.round(lastMidnight.getTime()); const hashrates: any[] = []; @@ -313,7 +305,7 @@ class Mining { logger.debug(`Indexing daily network hashrate`); loadingIndicators.setProgress('daily-hashrate-indexing', 0); - while (toTimestamp > genesisTimestamp) { + while (toTimestamp > genesisTimestamp && toTimestamp > oldestConsecutiveBlockTimestamp) { const fromTimestamp = toTimestamp - 86400000; // Skip already indexed days @@ -323,17 +315,9 @@ class Mining { continue; } - // Check if we have blocks for the previous day (which mean that the day - // we are currently indexing has complete data) - const blockStatsPreviousDay: any = await BlocksRepository.$blockCountBetweenTimestamp( - null, (fromTimestamp - 86400000) / 1000, (toTimestamp - 86400000) / 1000); - if (blockStatsPreviousDay.blockCount === 0 && config.MEMPOOL.NETWORK === 'mainnet') { // We are done indexing - break; - } - const blockStats: any = await BlocksRepository.$blockCountBetweenTimestamp( null, fromTimestamp / 1000, toTimestamp / 1000); - const lastBlockHashrate = await bitcoinClient.getNetworkHashPs(blockStats.blockCount, + const lastBlockHashrate = blockStats.blockCount === 0 ? 0 : await bitcoinClient.getNetworkHashPs(blockStats.blockCount, blockStats.lastBlockHeight); hashrates.push({ @@ -368,8 +352,8 @@ class Mining { ++totalIndexed; } - // Add genesis block manually on mainnet and testnet - if ('signet' !== config.MEMPOOL.NETWORK && toTimestamp <= genesisTimestamp && !indexedTimestamp.includes(genesisTimestamp)) { + // Add genesis block manually + if (config.MEMPOOL.INDEXING_BLOCKS_AMOUNT === -1 && !indexedTimestamp.includes(genesisTimestamp / 1000)) { hashrates.push({ hashrateTimestamp: genesisTimestamp / 1000, avgHashrate: await bitcoinClient.getNetworkHashPs(1, 1), @@ -405,27 +389,37 @@ class Mining { } const blocks: any = await BlocksRepository.$getBlocksDifficulty(); - - let currentDifficulty = 0; + const genesisBlock = await bitcoinClient.getBlock(await bitcoinClient.getBlockHash(0)); + let currentDifficulty = genesisBlock.difficulty; let totalIndexed = 0; - if (indexedHeights[0] !== true) { + if (config.MEMPOOL.INDEXING_BLOCKS_AMOUNT === -1 && indexedHeights[0] !== true) { await DifficultyAdjustmentsRepository.$saveAdjustments({ - time: (config.MEMPOOL.NETWORK === 'signet') ? 1598918400 : 1231006505, + time: genesisBlock.time, height: 0, - difficulty: (config.MEMPOOL.NETWORK === 'signet') ? 0.001126515290698186 : 1.0, + difficulty: currentDifficulty, adjustment: 0.0, }); } + const oldestConsecutiveBlock = await BlocksRepository.$getOldestConsecutiveBlock(); + if (config.MEMPOOL.INDEXING_BLOCKS_AMOUNT !== -1) { + currentDifficulty = oldestConsecutiveBlock.difficulty; + } + + let totalBlockChecked = 0; + let timer = new Date().getTime() / 1000; + for (const block of blocks) { if (block.difficulty !== currentDifficulty) { - if (block.height === 0 || indexedHeights[block.height] === true) { // Already indexed - currentDifficulty = block.difficulty; + if (indexedHeights[block.height] === true) { // Already indexed + if (block.height >= oldestConsecutiveBlock.height) { + currentDifficulty = block.difficulty; + } continue; } - let adjustment = block.difficulty / Math.max(1, currentDifficulty); + let adjustment = block.difficulty / currentDifficulty; adjustment = Math.round(adjustment * 1000000) / 1000000; // Remove float point noise await DifficultyAdjustmentsRepository.$saveAdjustments({ @@ -436,7 +430,17 @@ class Mining { }); totalIndexed++; - currentDifficulty = block.difficulty; + if (block.height >= oldestConsecutiveBlock.height) { + currentDifficulty = block.difficulty; + } + } + + totalBlockChecked++; + const elapsedSeconds = Math.max(1, Math.round((new Date().getTime() / 1000) - timer)); + if (elapsedSeconds > 5) { + const progress = Math.round(totalBlockChecked / blocks.length * 100); + logger.info(`Indexing difficulty adjustment at block #${block.height} | Progress: ${progress}%`); + timer = new Date().getTime() / 1000; } } diff --git a/backend/src/api/pools-parser.ts b/backend/src/api/pools-parser.ts index 15a4fe7be..731653a83 100644 --- a/backend/src/api/pools-parser.ts +++ b/backend/src/api/pools-parser.ts @@ -1,6 +1,7 @@ import DB from '../database'; import logger from '../logger'; import config from '../config'; +import BlocksRepository from '../repositories/BlocksRepository'; interface Pool { name: string; @@ -32,7 +33,6 @@ class PoolsParser { // First we save every entries without paying attention to pool duplication const poolsDuplicated: Pool[] = []; - logger.debug('Parse coinbase_tags'); const coinbaseTags = Object.entries(poolsJson['coinbase_tags']); for (let i = 0; i < coinbaseTags.length; ++i) { poolsDuplicated.push({ @@ -43,7 +43,6 @@ class PoolsParser { 'slug': '' }); } - logger.debug('Parse payout_addresses'); const addressesTags = Object.entries(poolsJson['payout_addresses']); for (let i = 0; i < addressesTags.length; ++i) { poolsDuplicated.push({ @@ -56,7 +55,6 @@ class PoolsParser { } // Then, we find unique mining pool names - logger.debug('Identify unique mining pools'); const poolNames: string[] = []; for (let i = 0; i < poolsDuplicated.length; ++i) { if (poolNames.indexOf(poolsDuplicated[i].name) === -1) { @@ -119,8 +117,15 @@ class PoolsParser { 'slug': slug }; - if (existingPools.find((pool) => pool.name === poolNames[i]) !== undefined) { - finalPoolDataUpdate.push(poolObj); + const existingPool = existingPools.find((pool) => pool.name === poolNames[i]); + if (existingPool !== undefined) { + // Check if any data was actually updated + const equals = (a, b) => + a.length === b.length && + a.every((v, i) => v === b[i]); + if (!equals(JSON.parse(existingPool.addresses), poolObj.addresses) || !equals(JSON.parse(existingPool.regexes), poolObj.regexes)) { + finalPoolDataUpdate.push(poolObj); + } } else { logger.debug(`Add '${finalPoolName}' mining pool`); finalPoolDataAdd.push(poolObj); @@ -140,40 +145,51 @@ class PoolsParser { return; } - logger.debug(`Update pools table now`); + if (finalPoolDataAdd.length > 0 || finalPoolDataUpdate.length > 0) { + logger.debug(`Update pools table now`); - // Add new mining pools into the database - let queryAdd: string = 'INSERT INTO pools(name, link, regexes, addresses, slug) VALUES '; - for (let i = 0; i < finalPoolDataAdd.length; ++i) { - queryAdd += `('${finalPoolDataAdd[i].name}', '${finalPoolDataAdd[i].link}', - '${JSON.stringify(finalPoolDataAdd[i].regexes)}', '${JSON.stringify(finalPoolDataAdd[i].addresses)}', - ${JSON.stringify(finalPoolDataAdd[i].slug)}),`; - } - queryAdd = queryAdd.slice(0, -1) + ';'; + // Add new mining pools into the database + let queryAdd: string = 'INSERT INTO pools(name, link, regexes, addresses, slug) VALUES '; + for (let i = 0; i < finalPoolDataAdd.length; ++i) { + queryAdd += `('${finalPoolDataAdd[i].name}', '${finalPoolDataAdd[i].link}', + '${JSON.stringify(finalPoolDataAdd[i].regexes)}', '${JSON.stringify(finalPoolDataAdd[i].addresses)}', + ${JSON.stringify(finalPoolDataAdd[i].slug)}),`; + } + queryAdd = queryAdd.slice(0, -1) + ';'; - // Updated existing mining pools in the database - const updateQueries: string[] = []; - for (let i = 0; i < finalPoolDataUpdate.length; ++i) { - updateQueries.push(` - UPDATE pools - SET name='${finalPoolDataUpdate[i].name}', link='${finalPoolDataUpdate[i].link}', - regexes='${JSON.stringify(finalPoolDataUpdate[i].regexes)}', addresses='${JSON.stringify(finalPoolDataUpdate[i].addresses)}', - slug='${finalPoolDataUpdate[i].slug}' - WHERE name='${finalPoolDataUpdate[i].name}' - ;`); + // Updated existing mining pools in the database + const updateQueries: string[] = []; + for (let i = 0; i < finalPoolDataUpdate.length; ++i) { + updateQueries.push(` + UPDATE pools + SET name='${finalPoolDataUpdate[i].name}', link='${finalPoolDataUpdate[i].link}', + regexes='${JSON.stringify(finalPoolDataUpdate[i].regexes)}', addresses='${JSON.stringify(finalPoolDataUpdate[i].addresses)}', + slug='${finalPoolDataUpdate[i].slug}' + WHERE name='${finalPoolDataUpdate[i].name}' + ;`); + } + + try { + await this.$deleteBlocskToReindex(finalPoolDataUpdate); + + if (finalPoolDataAdd.length > 0) { + await DB.query({ sql: queryAdd, timeout: 120000 }); + } + for (const query of updateQueries) { + await DB.query({ sql: query, timeout: 120000 }); + } + await this.insertUnknownPool(); + logger.info('Mining pools.json import completed'); + } catch (e) { + logger.err(`Cannot import pools in the database`); + throw e; + } } try { - if (finalPoolDataAdd.length > 0) { - await DB.query({ sql: queryAdd, timeout: 120000 }); - } - for (const query of updateQueries) { - await DB.query({ sql: query, timeout: 120000 }); - } await this.insertUnknownPool(); - logger.info('Mining pools.json import completed'); } catch (e) { - logger.err(`Cannot import pools in the database`); + logger.err(`Cannot insert unknown pool in the database`); throw e; } } @@ -201,6 +217,36 @@ class PoolsParser { logger.err('Unable to insert "Unknown" mining pool'); } } + + /** + * Delete blocks which needs to be reindexed + */ + private async $deleteBlocskToReindex(finalPoolDataUpdate: any[]) { + if (config.MEMPOOL.AUTOMATIC_BLOCK_REINDEXING === false) { + return; + } + + const blockCount = await BlocksRepository.$blockCount(null, null); + if (blockCount === 0) { + return; + } + + for (const updatedPool of finalPoolDataUpdate) { + const [pool]: any[] = await DB.query(`SELECT id, name from pools where slug = "${updatedPool.slug}"`); + if (pool.length > 0) { + logger.notice(`Deleting blocks from ${pool[0].name} mining pool for future re-indexing`); + await DB.query(`DELETE FROM blocks WHERE pool_id = ${pool[0].id}`); + } + } + + // Ignore early days of Bitcoin as there were not mining pool yet + logger.notice('Deleting blocks with unknown mining pool from height 130635 for future re-indexing'); + const [unknownPool] = await DB.query(`SELECT id from pools where slug = "unknown"`); + await DB.query(`DELETE FROM blocks WHERE pool_id = ${unknownPool[0].id} AND height > 130635`); + + logger.notice('Truncating hashrates for future re-indexing'); + await DB.query(`DELETE FROM hashrates`); + } } export default new PoolsParser(); diff --git a/backend/src/config.ts b/backend/src/config.ts index c9ec65e76..49892f064 100644 --- a/backend/src/config.ts +++ b/backend/src/config.ts @@ -23,6 +23,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; }; ESPLORA: { REST_API_URL: string; @@ -122,6 +123,7 @@ const defaults: IConfig = { 'EXTERNAL_RETRY_INTERVAL': 0, 'USER_AGENT': 'mempool', 'STDOUT_LOG_MIN_PRIORITY': 'debug', + 'AUTOMATIC_BLOCK_REINDEXING': false, }, 'ESPLORA': { 'REST_API_URL': 'http://127.0.0.1:3000', diff --git a/backend/src/indexer.ts b/backend/src/indexer.ts index 8e4e7e87f..e34c43e8d 100644 --- a/backend/src/indexer.ts +++ b/backend/src/indexer.ts @@ -35,6 +35,8 @@ class Indexer { this.runIndexer = false; this.indexerRunning = true; + logger.debug(`Running mining indexer`); + try { const chainValid = await blocks.$generateBlockDatabase(); if (chainValid === false) { @@ -54,9 +56,15 @@ class Indexer { this.indexerRunning = false; logger.err(`Indexer failed, trying again in 10 seconds. Reason: ` + (e instanceof Error ? e.message : e)); setTimeout(() => this.reindex(), 10000); + this.indexerRunning = false; + return; } this.indexerRunning = false; + + const runEvery = 1000 * 3600; // 1 hour + logger.debug(`Indexing completed. Next run planned at ${new Date(new Date().getTime() + runEvery).toUTCString()}`); + setTimeout(() => this.reindex(), runEvery); } async $resetHashratesIndexingState() { diff --git a/backend/src/repositories/BlocksRepository.ts b/backend/src/repositories/BlocksRepository.ts index c6b14ff51..4388c46f6 100644 --- a/backend/src/repositories/BlocksRepository.ts +++ b/backend/src/repositories/BlocksRepository.ts @@ -610,6 +610,24 @@ class BlocksRepository { throw e; } } + + /** + * Return the oldest block from a consecutive chain of block from the most recent one + */ + public async $getOldestConsecutiveBlock(): Promise { + try { + const [rows]: any = await DB.query(`SELECT height, UNIX_TIMESTAMP(blockTimestamp) as timestamp, difficulty FROM blocks ORDER BY height DESC`); + for (let i = 0; i < rows.length - 1; ++i) { + if (rows[i].height - rows[i + 1].height > 1) { + return rows[i]; + } + } + return rows[rows.length - 1]; + } catch (e) { + logger.err('Cannot generate block size and weight history. Reason: ' + (e instanceof Error ? e.message : e)); + throw e; + } + } } export default new BlocksRepository(); diff --git a/backend/src/repositories/DifficultyAdjustmentsRepository.ts b/backend/src/repositories/DifficultyAdjustmentsRepository.ts index 6952b3be9..910c65c10 100644 --- a/backend/src/repositories/DifficultyAdjustmentsRepository.ts +++ b/backend/src/repositories/DifficultyAdjustmentsRepository.ts @@ -46,9 +46,38 @@ class DifficultyAdjustmentsRepository { query += ` GROUP BY UNIX_TIMESTAMP(time) DIV ${86400}`; if (descOrder === true) { - query += ` ORDER BY time DESC`; + query += ` ORDER BY height DESC`; } else { - query += ` ORDER BY time`; + query += ` ORDER BY height`; + } + + try { + const [rows] = await DB.query(query); + return rows as IndexedDifficultyAdjustment[]; + } catch (e) { + logger.err(`Cannot get difficulty adjustments from the database. Reason: ` + (e instanceof Error ? e.message : e)); + throw e; + } + } + + public async $getRawAdjustments(interval: string | null, descOrder: boolean = false): Promise { + interval = Common.getSqlInterval(interval); + + let query = `SELECT + UNIX_TIMESTAMP(time) as time, + height as height, + difficulty as difficulty, + adjustment as adjustment + FROM difficulty_adjustments`; + + if (interval) { + query += ` WHERE time BETWEEN DATE_SUB(NOW(), INTERVAL ${interval}) AND NOW()`; + } + + if (descOrder === true) { + query += ` ORDER BY height DESC`; + } else { + query += ` ORDER BY height`; } try { diff --git a/backend/src/repositories/HashratesRepository.ts b/backend/src/repositories/HashratesRepository.ts index 5e6048abc..e5a193477 100644 --- a/backend/src/repositories/HashratesRepository.ts +++ b/backend/src/repositories/HashratesRepository.ts @@ -1,6 +1,5 @@ import { escape } from 'mysql2'; import { Common } from '../api/common'; -import config from '../config'; import DB from '../database'; import logger from '../logger'; import PoolsRepository from './PoolsRepository'; @@ -30,6 +29,32 @@ class HashratesRepository { } } + public async $getRawNetworkDailyHashrate(interval: string | null): Promise { + interval = Common.getSqlInterval(interval); + + let query = `SELECT + UNIX_TIMESTAMP(hashrate_timestamp) as timestamp, + avg_hashrate as avgHashrate + FROM hashrates`; + + if (interval) { + query += ` WHERE hashrate_timestamp BETWEEN DATE_SUB(NOW(), INTERVAL ${interval}) AND NOW() + AND hashrates.type = 'daily'`; + } else { + query += ` WHERE hashrates.type = 'daily'`; + } + + query += ` ORDER by hashrate_timestamp`; + + try { + const [rows]: any[] = await DB.query(query); + return rows; + } catch (e) { + logger.err('Cannot fetch network hashrate history. Reason: ' + (e instanceof Error ? e.message : e)); + throw e; + } + } + public async $getNetworkDailyHashrate(interval: string | null): Promise { interval = Common.getSqlInterval(interval); diff --git a/backend/src/repositories/PricesRepository.ts b/backend/src/repositories/PricesRepository.ts index 61d092ca6..a3b4f2fb9 100644 --- a/backend/src/repositories/PricesRepository.ts +++ b/backend/src/repositories/PricesRepository.ts @@ -4,6 +4,12 @@ import { Prices } from '../tasks/price-updater'; class PricesRepository { public async $savePrices(time: number, prices: Prices): Promise { + if (prices.USD === -1) { + // Some historical price entries have not USD prices, so we just ignore them to avoid future UX issues + // As of today there are only 4 (on 2013-09-05, 2013-09-19, 2013-09-12 and 2013-09-26) so that's fine + return; + } + try { await DB.query(` INSERT INTO prices(time, USD, EUR, GBP, CAD, CHF, AUD, JPY) @@ -17,17 +23,17 @@ class PricesRepository { } public async $getOldestPriceTime(): Promise { - const [oldestRow] = await DB.query(`SELECT UNIX_TIMESTAMP(time) as time from prices ORDER BY time LIMIT 1`); + const [oldestRow] = await DB.query(`SELECT UNIX_TIMESTAMP(time) as time from prices WHERE USD != -1 ORDER BY time LIMIT 1`); return oldestRow[0] ? oldestRow[0].time : 0; } public async $getLatestPriceTime(): Promise { - const [oldestRow] = await DB.query(`SELECT UNIX_TIMESTAMP(time) as time from prices ORDER BY time DESC LIMIT 1`); + const [oldestRow] = await DB.query(`SELECT UNIX_TIMESTAMP(time) as time from prices WHERE USD != -1 ORDER BY time DESC LIMIT 1`); return oldestRow[0] ? oldestRow[0].time : 0; } public async $getPricesTimes(): Promise { - const [times]: any[] = await DB.query(`SELECT UNIX_TIMESTAMP(time) as time from prices`); + const [times]: any[] = await DB.query(`SELECT UNIX_TIMESTAMP(time) as time from prices WHERE USD != -1`); return times.map(time => time.time); } } diff --git a/backend/src/routes.ts b/backend/src/routes.ts index 57c64ddf5..aeda734e1 100644 --- a/backend/src/routes.ts +++ b/backend/src/routes.ts @@ -734,7 +734,7 @@ class Routes { public async $getDifficultyAdjustments(req: Request, res: Response) { try { - const difficulty = await DifficultyAdjustmentsRepository.$getAdjustments(req.params.interval, true); + const difficulty = await DifficultyAdjustmentsRepository.$getRawAdjustments(req.params.interval, true); res.header('Pragma', 'public'); res.header('Cache-control', 'public'); res.setHeader('Expires', new Date(Date.now() + 1000 * 300).toUTCString()); @@ -790,7 +790,7 @@ class Routes { public async getBlocks(req: Request, res: Response) { try { - if (['mainnet', 'testnet', 'signet', 'regtest'].includes(config.MEMPOOL.NETWORK)) { // Bitcoin + if (['mainnet', 'testnet', 'signet'].includes(config.MEMPOOL.NETWORK)) { // Bitcoin const height = req.params.height === undefined ? undefined : parseInt(req.params.height, 10); res.setHeader('Expires', new Date(Date.now() + 1000 * 60).toUTCString()); res.json(await blocks.$getBlocks(height, 15)); diff --git a/docker/backend/mempool-config.json b/docker/backend/mempool-config.json index daa4fddc3..b5b1a16b7 100644 --- a/docker/backend/mempool-config.json +++ b/docker/backend/mempool-config.json @@ -20,7 +20,8 @@ "USER_AGENT": "__MEMPOOL_USER_AGENT__", "STDOUT_LOG_MIN_PRIORITY": "__MEMPOOL_STDOUT_LOG_MIN_PRIORITY__", "INDEXING_BLOCKS_AMOUNT": __MEMPOOL_INDEXING_BLOCKS_AMOUNT__, - "BLOCKS_SUMMARIES_INDEXING": __MEMPOOL_BLOCKS_SUMMARIES_INDEXING__ + "BLOCKS_SUMMARIES_INDEXING": __MEMPOOL_BLOCKS_SUMMARIES_INDEXING__, + "AUTOMATIC_BLOCK_REINDEXING": __MEMPOOL_AUTOMATIC_BLOCK_REINDEXING__ }, "CORE_RPC": { "HOST": "__CORE_RPC_HOST__", diff --git a/docker/backend/start.sh b/docker/backend/start.sh index 5c4213a1c..c31273bb6 100644 --- a/docker/backend/start.sh +++ b/docker/backend/start.sh @@ -22,6 +22,8 @@ __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_INDEXING_BLOCKS_AMOUNT__=${MEMPOOL_INDEXING_BLOCKS_AMOUNT:=false} +__MEMPOOL_AUTOMATIC_BLOCK_REINDEXING__=${MEMPOOL_AUTOMATIC_BLOCK_REINDEXING:=false} # CORE_RPC __CORE_RPC_HOST__=${CORE_RPC_HOST:=127.0.0.1} @@ -110,6 +112,8 @@ 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_INDEXING_BLOCKS_AMOUNT__/${__MEMPOOL_INDEXING_BLOCKS_AMOUNT__}/g" mempool-config.json +sed -i "s/__MEMPOOL_AUTOMATIC_BLOCK_REINDEXING__/${__MEMPOOL_AUTOMATIC_BLOCK_REINDEXING__}/g" mempool-config.json sed -i "s/__CORE_RPC_HOST__/${__CORE_RPC_HOST__}/g" mempool-config.json sed -i "s/__CORE_RPC_PORT__/${__CORE_RPC_PORT__}/g" mempool-config.json diff --git a/frontend/src/locale/messages.ar.xlf b/frontend/src/locale/messages.ar.xlf index 11c794c44..f108a070f 100644 --- a/frontend/src/locale/messages.ar.xlf +++ b/frontend/src/locale/messages.ar.xlf @@ -952,6 +952,10 @@ src/app/bisq/bisq-transactions/bisq-transactions.component.html 20,21 + + src/app/components/block-overview-tooltip/block-overview-tooltip.component.html + 18 + src/app/dashboard/dashboard.component.html 124,125 @@ -1363,7 +1367,7 @@ تداولات src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 90 + 99 @@ -1371,7 +1375,7 @@ حجم التداول src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 91 + 100 @@ -1993,6 +1997,7 @@ At block: + في الكتله: src/app/components/block-fee-rates-graph/block-fee-rates-graph.component.ts 188 @@ -2016,6 +2021,7 @@ Around block: + تقريبا في الكتله: src/app/components/block-fee-rates-graph/block-fee-rates-graph.component.ts 190 @@ -2074,16 +2080,6 @@ 264,266 - - Value - القيمه - - src/app/components/block-overview-tooltip/block-overview-tooltip.component.html - 18 - - Transaction value - transaction.value - Fee الرسوم @@ -2240,6 +2236,7 @@ Block Prediction Accuracy + دقة توقع الكتلة src/app/components/block-prediction-graph/block-prediction-graph.component.html 5,7 @@ -2256,6 +2253,7 @@ Match rate + معدل المطابقة src/app/components/block-prediction-graph/block-prediction-graph.component.ts 176,174 @@ -2873,6 +2871,7 @@ Usually places your transaction in between the second and third mempool blocks + عادةً ما تضع معاملتك بين كتل الميم بول الثانية والثالثة src/app/components/fees-box/fees-box.component.html 8,9 @@ -2894,6 +2893,7 @@ Usually places your transaction in between the first and second mempool blocks + عادةً ما تضع معاملتك بين كتل الأولى والثانية src/app/components/fees-box/fees-box.component.html 9,10 @@ -3078,6 +3078,7 @@ Hashrate (MA) + الهاش ريت (معدل التحرك) src/app/components/hashrate-chart/hashrate-chart.component.ts 288,287 @@ -3250,6 +3251,7 @@ Pools luck (1 week) + حظ حوض التعدين (١ اسبوع) src/app/components/pool-ranking/pool-ranking.component.html 9 @@ -3258,6 +3260,7 @@ Pools luck + حظ احواض التعدين src/app/components/pool-ranking/pool-ranking.component.html 9,11 @@ -3266,6 +3269,7 @@ The overall luck of all mining pools over the past week. A luck bigger than 100% means the average block time for the current epoch is less than 10 minutes. + الحظ العام لجميع أحواض التعدين خلال الأسبوع الماضي. الحظ الأكبر من 100٪ يعني أن متوسط وقت الكتلة الحالي أقل من 10 دقائق. src/app/components/pool-ranking/pool-ranking.component.html 11,15 @@ -3274,6 +3278,7 @@ Pools count (1w) + عدد الاحواض (١ اسبوع) src/app/components/pool-ranking/pool-ranking.component.html 17 @@ -3282,6 +3287,7 @@ Pools count + عدد الاحواض src/app/components/pool-ranking/pool-ranking.component.html 17,19 @@ -3290,6 +3296,7 @@ How many unique pools found at least one block over the past week. + كم عدد أحواض التعدين الفريدة التي وجدت كتلة واحدة على الأقل خلال الأسبوع الماضي. src/app/components/pool-ranking/pool-ranking.component.html 19,23 @@ -3315,6 +3322,7 @@ The number of blocks found over the past week. + عدد الكتل المعثور عليها خلال الاسبوع الماضي. src/app/components/pool-ranking/pool-ranking.component.html 27,31 @@ -4471,6 +4479,7 @@ REST API service + اعادة تشغيل خادم API src/app/docs/api-docs/api-docs.component.html 34,35 diff --git a/frontend/src/locale/messages.ca.xlf b/frontend/src/locale/messages.ca.xlf index 14317e89e..1b044f005 100644 --- a/frontend/src/locale/messages.ca.xlf +++ b/frontend/src/locale/messages.ca.xlf @@ -940,6 +940,10 @@ src/app/bisq/bisq-transactions/bisq-transactions.component.html 20,21 + + src/app/components/block-overview-tooltip/block-overview-tooltip.component.html + 18 + src/app/dashboard/dashboard.component.html 124,125 @@ -1347,7 +1351,7 @@ Intercanvis src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 90 + 99 @@ -1355,7 +1359,7 @@ Volum src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 91 + 100 @@ -2025,15 +2029,6 @@ 264,266 - - Value - - src/app/components/block-overview-tooltip/block-overview-tooltip.component.html - 18 - - Transaction value - transaction.value - Fee Quota diff --git a/frontend/src/locale/messages.cs.xlf b/frontend/src/locale/messages.cs.xlf index 4917973d5..be04f6dc1 100644 --- a/frontend/src/locale/messages.cs.xlf +++ b/frontend/src/locale/messages.cs.xlf @@ -952,6 +952,10 @@ src/app/bisq/bisq-transactions/bisq-transactions.component.html 20,21 + + src/app/components/block-overview-tooltip/block-overview-tooltip.component.html + 18 + src/app/dashboard/dashboard.component.html 124,125 @@ -1363,7 +1367,7 @@ Obchody src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 90 + 99 @@ -1371,7 +1375,7 @@ Objem src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 91 + 100 @@ -1993,6 +1997,7 @@ At block: + V bloku: src/app/components/block-fee-rates-graph/block-fee-rates-graph.component.ts 188 @@ -2016,6 +2021,7 @@ Around block: + Kolem bloku: src/app/components/block-fee-rates-graph/block-fee-rates-graph.component.ts 190 @@ -2074,16 +2080,6 @@ 264,266 - - Value - Hodnota - - src/app/components/block-overview-tooltip/block-overview-tooltip.component.html - 18 - - Transaction value - transaction.value - Fee Poplatek @@ -2240,6 +2236,7 @@ Block Prediction Accuracy + Přesnost předpovědi bloku src/app/components/block-prediction-graph/block-prediction-graph.component.html 5,7 @@ -2256,6 +2253,7 @@ Match rate + Míra shody src/app/components/block-prediction-graph/block-prediction-graph.component.ts 176,174 @@ -2873,6 +2871,7 @@ Usually places your transaction in between the second and third mempool blocks + Obvykle umístí transakci mezi druhý a třetí blok mempoolu. src/app/components/fees-box/fees-box.component.html 8,9 @@ -2894,6 +2893,7 @@ Usually places your transaction in between the first and second mempool blocks + Obvykle umístí transakci mezi první a druhý blok mempoolu. src/app/components/fees-box/fees-box.component.html 9,10 @@ -3078,6 +3078,7 @@ Hashrate (MA) + Hashrate (KP) src/app/components/hashrate-chart/hashrate-chart.component.ts 288,287 @@ -3250,6 +3251,7 @@ Pools luck (1 week) + Štěstí poolů (1 týden) src/app/components/pool-ranking/pool-ranking.component.html 9 @@ -3258,6 +3260,7 @@ Pools luck + Štěstí poolů src/app/components/pool-ranking/pool-ranking.component.html 9,11 @@ -3266,6 +3269,7 @@ The overall luck of all mining pools over the past week. A luck bigger than 100% means the average block time for the current epoch is less than 10 minutes. + Celkové štěstí všech těžebních poolů za uplynulý týden. Štěstí větší než 100 % znamená, že průměrná doba bloku v aktuální epoše je kratší než 10 minut. src/app/components/pool-ranking/pool-ranking.component.html 11,15 @@ -3274,6 +3278,7 @@ Pools count (1w) + Počet poolů (1t) src/app/components/pool-ranking/pool-ranking.component.html 17 @@ -3282,6 +3287,7 @@ Pools count + Počet poolů src/app/components/pool-ranking/pool-ranking.component.html 17,19 @@ -3290,6 +3296,7 @@ How many unique pools found at least one block over the past week. + Kolik unikátních poolů našlo za poslední týden alespoň jeden blok. src/app/components/pool-ranking/pool-ranking.component.html 19,23 @@ -3315,6 +3322,7 @@ The number of blocks found over the past week. + Počet nalezených bloků za poslední týden. src/app/components/pool-ranking/pool-ranking.component.html 27,31 @@ -4471,6 +4479,7 @@ REST API service + Služba REST API src/app/docs/api-docs/api-docs.component.html 34,35 diff --git a/frontend/src/locale/messages.de.xlf b/frontend/src/locale/messages.de.xlf index 089d52057..c858432dc 100644 --- a/frontend/src/locale/messages.de.xlf +++ b/frontend/src/locale/messages.de.xlf @@ -952,6 +952,10 @@ src/app/bisq/bisq-transactions/bisq-transactions.component.html 20,21 + + src/app/components/block-overview-tooltip/block-overview-tooltip.component.html + 18 + src/app/dashboard/dashboard.component.html 124,125 @@ -1363,7 +1367,7 @@ Trades src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 90 + 99 @@ -1371,7 +1375,7 @@ Volumen src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 91 + 100 @@ -2076,16 +2080,6 @@ 264,266 - - Value - Wert - - src/app/components/block-overview-tooltip/block-overview-tooltip.component.html - 18 - - Transaction value - transaction.value - Fee Gebühr diff --git a/frontend/src/locale/messages.en_US.xlf b/frontend/src/locale/messages.en_US.xlf index 89d2126ed..c74255ca9 100644 --- a/frontend/src/locale/messages.en_US.xlf +++ b/frontend/src/locale/messages.en_US.xlf @@ -877,6 +877,10 @@ src/app/bisq/bisq-transactions/bisq-transactions.component.html 20,21 + + src/app/components/block-overview-tooltip/block-overview-tooltip.component.html + 18 + src/app/dashboard/dashboard.component.html 124,125 @@ -1254,14 +1258,14 @@ Trades src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 90 + 99 Volume src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 91 + 100 @@ -1909,15 +1913,6 @@ 264,266 - - Value - - src/app/components/block-overview-tooltip/block-overview-tooltip.component.html - 18 - - Transaction value - transaction.value - Fee diff --git a/frontend/src/locale/messages.es.xlf b/frontend/src/locale/messages.es.xlf index a065f762b..3cfa11f61 100644 --- a/frontend/src/locale/messages.es.xlf +++ b/frontend/src/locale/messages.es.xlf @@ -952,6 +952,10 @@ src/app/bisq/bisq-transactions/bisq-transactions.component.html 20,21 + + src/app/components/block-overview-tooltip/block-overview-tooltip.component.html + 18 + src/app/dashboard/dashboard.component.html 124,125 @@ -1363,7 +1367,7 @@ Intercambios src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 90 + 99 @@ -1371,7 +1375,7 @@ Volumen src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 91 + 100 @@ -2074,16 +2078,6 @@ 264,266 - - Value - Valor - - src/app/components/block-overview-tooltip/block-overview-tooltip.component.html - 18 - - Transaction value - transaction.value - Fee Tasa diff --git a/frontend/src/locale/messages.fa.xlf b/frontend/src/locale/messages.fa.xlf index 1dab8a4d3..4d8c0bdc6 100644 --- a/frontend/src/locale/messages.fa.xlf +++ b/frontend/src/locale/messages.fa.xlf @@ -952,6 +952,10 @@ src/app/bisq/bisq-transactions/bisq-transactions.component.html 20,21 + + src/app/components/block-overview-tooltip/block-overview-tooltip.component.html + 18 + src/app/dashboard/dashboard.component.html 124,125 @@ -1363,7 +1367,7 @@ معاملات src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 90 + 99 @@ -1371,7 +1375,7 @@ حجم src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 91 + 100 @@ -1993,6 +1997,7 @@ At block: + در بلاک: src/app/components/block-fee-rates-graph/block-fee-rates-graph.component.ts 188 @@ -2016,6 +2021,7 @@ Around block: + حدودا در بلاک: src/app/components/block-fee-rates-graph/block-fee-rates-graph.component.ts 190 @@ -2039,7 +2045,7 @@ Block Fees - کارمزدهای بلاک + کارمزد بلاک src/app/components/block-fees-graph/block-fees-graph.component.html 5,7 @@ -2074,16 +2080,6 @@ 264,266 - - Value - مقدار - - src/app/components/block-overview-tooltip/block-overview-tooltip.component.html - 18 - - Transaction value - transaction.value - Fee کارمزد @@ -2240,6 +2236,7 @@ Block Prediction Accuracy + دقت پیش‌بینی بلاک src/app/components/block-prediction-graph/block-prediction-graph.component.html 5,7 @@ -2256,6 +2253,7 @@ Match rate + نرخ برابری src/app/components/block-prediction-graph/block-prediction-graph.component.ts 176,174 @@ -2873,6 +2871,7 @@ Usually places your transaction in between the second and third mempool blocks + معمولا تراکنش شما را بین بلاک‌های دوم و سوم ممپول قرار می‌دهد src/app/components/fees-box/fees-box.component.html 8,9 @@ -2894,6 +2893,7 @@ Usually places your transaction in between the first and second mempool blocks + معمولا تراکنش شما را بین بلاک‌های اول و دوم ممپول قرار می‌دهد src/app/components/fees-box/fees-box.component.html 9,10 @@ -3078,6 +3078,7 @@ Hashrate (MA) + نرخ تولید هش (میانگین متحرک) src/app/components/hashrate-chart/hashrate-chart.component.ts 288,287 @@ -3250,6 +3251,7 @@ Pools luck (1 week) + شانس استخرها (1 هفته‌ای) src/app/components/pool-ranking/pool-ranking.component.html 9 @@ -3258,6 +3260,7 @@ Pools luck + شانس استخرها src/app/components/pool-ranking/pool-ranking.component.html 9,11 @@ -3266,6 +3269,7 @@ The overall luck of all mining pools over the past week. A luck bigger than 100% means the average block time for the current epoch is less than 10 minutes. + شانس کلی همه استخرهای استخراج طی هفته پیش. شانس بیشتر از 100 درصد یعنی متوسط زمان بلاک در دوره فعلی کمتر از 10 دقیقه است. src/app/components/pool-ranking/pool-ranking.component.html 11,15 @@ -3274,6 +3278,7 @@ Pools count (1w) + تعداد استخرها (1 هفته‌ای) src/app/components/pool-ranking/pool-ranking.component.html 17 @@ -3282,6 +3287,7 @@ Pools count + تعداد استخرها src/app/components/pool-ranking/pool-ranking.component.html 17,19 @@ -3290,6 +3296,7 @@ How many unique pools found at least one block over the past week. + تعداد استخرهای منحصر به فردی که حداقل یک بلاک طی هفته گذشته پیدا کرده‌اند. src/app/components/pool-ranking/pool-ranking.component.html 19,23 @@ -3315,6 +3322,7 @@ The number of blocks found over the past week. + تعداد بلاک‌هایی که طی هفته پیش پیدا کرده است. src/app/components/pool-ranking/pool-ranking.component.html 27,31 @@ -4471,6 +4479,7 @@ REST API service + خدمات REST API src/app/docs/api-docs/api-docs.component.html 34,35 diff --git a/frontend/src/locale/messages.fi.xlf b/frontend/src/locale/messages.fi.xlf index 747b786c7..8142419b9 100644 --- a/frontend/src/locale/messages.fi.xlf +++ b/frontend/src/locale/messages.fi.xlf @@ -952,6 +952,10 @@ src/app/bisq/bisq-transactions/bisq-transactions.component.html 20,21 + + src/app/components/block-overview-tooltip/block-overview-tooltip.component.html + 18 + src/app/dashboard/dashboard.component.html 124,125 @@ -1363,7 +1367,7 @@ Vaihdot src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 90 + 99 @@ -1371,7 +1375,7 @@ Volyymi src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 91 + 100 @@ -2074,16 +2078,6 @@ 264,266 - - Value - Arvo - - src/app/components/block-overview-tooltip/block-overview-tooltip.component.html - 18 - - Transaction value - transaction.value - Fee Siirtokulu diff --git a/frontend/src/locale/messages.he.xlf b/frontend/src/locale/messages.he.xlf index 0c6e4aa9f..5048d65d2 100644 --- a/frontend/src/locale/messages.he.xlf +++ b/frontend/src/locale/messages.he.xlf @@ -952,6 +952,10 @@ src/app/bisq/bisq-transactions/bisq-transactions.component.html 20,21 + + src/app/components/block-overview-tooltip/block-overview-tooltip.component.html + 18 + src/app/dashboard/dashboard.component.html 124,125 @@ -1363,7 +1367,7 @@ עסקאות src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 90 + 99 @@ -1371,7 +1375,7 @@ נפח src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 91 + 100 @@ -2074,16 +2078,6 @@ 264,266 - - Value - שווי ערך - - src/app/components/block-overview-tooltip/block-overview-tooltip.component.html - 18 - - Transaction value - transaction.value - Fee עמלה diff --git a/frontend/src/locale/messages.hi.xlf b/frontend/src/locale/messages.hi.xlf index c50da9c76..99acc8d1f 100644 --- a/frontend/src/locale/messages.hi.xlf +++ b/frontend/src/locale/messages.hi.xlf @@ -947,6 +947,10 @@ src/app/bisq/bisq-transactions/bisq-transactions.component.html 20,21 + + src/app/components/block-overview-tooltip/block-overview-tooltip.component.html + 18 + src/app/dashboard/dashboard.component.html 124,125 @@ -1358,7 +1362,7 @@ ट्रेडों src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 90 + 99 @@ -1366,7 +1370,7 @@ आयतन src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 91 + 100 @@ -2055,15 +2059,6 @@ 264,266 - - Value - - src/app/components/block-overview-tooltip/block-overview-tooltip.component.html - 18 - - Transaction value - transaction.value - Fee शुल्क diff --git a/frontend/src/locale/messages.hr.xlf b/frontend/src/locale/messages.hr.xlf index 029145c7c..9d049379d 100644 --- a/frontend/src/locale/messages.hr.xlf +++ b/frontend/src/locale/messages.hr.xlf @@ -877,6 +877,10 @@ src/app/bisq/bisq-transactions/bisq-transactions.component.html 20,21 + + src/app/components/block-overview-tooltip/block-overview-tooltip.component.html + 18 + src/app/dashboard/dashboard.component.html 124,125 @@ -1260,14 +1264,14 @@ Trades src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 90 + 99 Volume src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 91 + 100 @@ -1915,15 +1919,6 @@ 264,266 - - Value - - src/app/components/block-overview-tooltip/block-overview-tooltip.component.html - 18 - - Transaction value - transaction.value - Fee Naknada diff --git a/frontend/src/locale/messages.hu.xlf b/frontend/src/locale/messages.hu.xlf index bf8c087fe..4f3f259fe 100644 --- a/frontend/src/locale/messages.hu.xlf +++ b/frontend/src/locale/messages.hu.xlf @@ -950,6 +950,10 @@ src/app/bisq/bisq-transactions/bisq-transactions.component.html 20,21 + + src/app/components/block-overview-tooltip/block-overview-tooltip.component.html + 18 + src/app/dashboard/dashboard.component.html 124,125 @@ -1361,7 +1365,7 @@ Kereskedések src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 90 + 99 @@ -1369,7 +1373,7 @@ Mennyiség src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 91 + 100 @@ -2062,15 +2066,6 @@ 264,266 - - Value - - src/app/components/block-overview-tooltip/block-overview-tooltip.component.html - 18 - - Transaction value - transaction.value - Fee Díj diff --git a/frontend/src/locale/messages.it.xlf b/frontend/src/locale/messages.it.xlf index 8a2f972c4..699f07853 100644 --- a/frontend/src/locale/messages.it.xlf +++ b/frontend/src/locale/messages.it.xlf @@ -952,6 +952,10 @@ src/app/bisq/bisq-transactions/bisq-transactions.component.html 20,21 + + src/app/components/block-overview-tooltip/block-overview-tooltip.component.html + 18 + src/app/dashboard/dashboard.component.html 124,125 @@ -1363,7 +1367,7 @@ Scambi src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 90 + 99 @@ -1371,7 +1375,7 @@ Volume src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 91 + 100 @@ -2074,16 +2078,6 @@ 264,266 - - Value - Valore - - src/app/components/block-overview-tooltip/block-overview-tooltip.component.html - 18 - - Transaction value - transaction.value - Fee Commissione diff --git a/frontend/src/locale/messages.ja.xlf b/frontend/src/locale/messages.ja.xlf index eb374f62b..fb6f0fa84 100644 --- a/frontend/src/locale/messages.ja.xlf +++ b/frontend/src/locale/messages.ja.xlf @@ -952,6 +952,10 @@ src/app/bisq/bisq-transactions/bisq-transactions.component.html 20,21 + + src/app/components/block-overview-tooltip/block-overview-tooltip.component.html + 18 + src/app/dashboard/dashboard.component.html 124,125 @@ -1363,7 +1367,7 @@ 取引 src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 90 + 99 @@ -1371,7 +1375,7 @@ src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 91 + 100 @@ -2076,16 +2080,6 @@ 264,266 - - Value - - - src/app/components/block-overview-tooltip/block-overview-tooltip.component.html - 18 - - Transaction value - transaction.value - Fee 手数料 diff --git a/frontend/src/locale/messages.ka.xlf b/frontend/src/locale/messages.ka.xlf index a1390d9e4..8b6c16ce9 100644 --- a/frontend/src/locale/messages.ka.xlf +++ b/frontend/src/locale/messages.ka.xlf @@ -952,6 +952,10 @@ src/app/bisq/bisq-transactions/bisq-transactions.component.html 20,21 + + src/app/components/block-overview-tooltip/block-overview-tooltip.component.html + 18 + src/app/dashboard/dashboard.component.html 124,125 @@ -1363,7 +1367,7 @@ ტრეიდები src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 90 + 99 @@ -1371,7 +1375,7 @@ ბრუნვა src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 91 + 100 @@ -2074,16 +2078,6 @@ 264,266 - - Value - ღირებულება - - src/app/components/block-overview-tooltip/block-overview-tooltip.component.html - 18 - - Transaction value - transaction.value - Fee საკომისიო diff --git a/frontend/src/locale/messages.ko.xlf b/frontend/src/locale/messages.ko.xlf index 49fc54d80..a01ec86cd 100644 --- a/frontend/src/locale/messages.ko.xlf +++ b/frontend/src/locale/messages.ko.xlf @@ -952,6 +952,10 @@ src/app/bisq/bisq-transactions/bisq-transactions.component.html 20,21 + + src/app/components/block-overview-tooltip/block-overview-tooltip.component.html + 18 + src/app/dashboard/dashboard.component.html 124,125 @@ -1363,7 +1367,7 @@ 거래 src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 90 + 99 @@ -1371,7 +1375,7 @@ src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 91 + 100 @@ -2074,16 +2078,6 @@ 264,266 - - Value - 금액 - - src/app/components/block-overview-tooltip/block-overview-tooltip.component.html - 18 - - Transaction value - transaction.value - Fee 수수료 diff --git a/frontend/src/locale/messages.mk.xlf b/frontend/src/locale/messages.mk.xlf index c73908bd0..02763a9a1 100644 --- a/frontend/src/locale/messages.mk.xlf +++ b/frontend/src/locale/messages.mk.xlf @@ -947,6 +947,10 @@ src/app/bisq/bisq-transactions/bisq-transactions.component.html 20,21 + + src/app/components/block-overview-tooltip/block-overview-tooltip.component.html + 18 + src/app/dashboard/dashboard.component.html 124,125 @@ -1358,7 +1362,7 @@ Тргувања src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 90 + 99 @@ -1366,7 +1370,7 @@ Количина src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 91 + 100 @@ -2055,15 +2059,6 @@ 264,266 - - Value - - src/app/components/block-overview-tooltip/block-overview-tooltip.component.html - 18 - - Transaction value - transaction.value - Fee Провизија diff --git a/frontend/src/locale/messages.nl.xlf b/frontend/src/locale/messages.nl.xlf index 98a3f8d33..2d6473d3c 100644 --- a/frontend/src/locale/messages.nl.xlf +++ b/frontend/src/locale/messages.nl.xlf @@ -952,6 +952,10 @@ src/app/bisq/bisq-transactions/bisq-transactions.component.html 20,21 + + src/app/components/block-overview-tooltip/block-overview-tooltip.component.html + 18 + src/app/dashboard/dashboard.component.html 124,125 @@ -1363,7 +1367,7 @@ Transacties src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 90 + 99 @@ -1371,7 +1375,7 @@ Volume src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 91 + 100 @@ -2074,16 +2078,6 @@ 264,266 - - Value - Waarde - - src/app/components/block-overview-tooltip/block-overview-tooltip.component.html - 18 - - Transaction value - transaction.value - Fee Vergoeding diff --git a/frontend/src/locale/messages.pl.xlf b/frontend/src/locale/messages.pl.xlf index 1cec701ba..67e48fcf7 100644 --- a/frontend/src/locale/messages.pl.xlf +++ b/frontend/src/locale/messages.pl.xlf @@ -952,6 +952,10 @@ src/app/bisq/bisq-transactions/bisq-transactions.component.html 20,21 + + src/app/components/block-overview-tooltip/block-overview-tooltip.component.html + 18 + src/app/dashboard/dashboard.component.html 124,125 @@ -1363,7 +1367,7 @@ Transakcje src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 90 + 99 @@ -1371,7 +1375,7 @@ Wolumen src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 91 + 100 @@ -2074,16 +2078,6 @@ 264,266 - - Value - Wartość - - src/app/components/block-overview-tooltip/block-overview-tooltip.component.html - 18 - - Transaction value - transaction.value - Fee Opłata diff --git a/frontend/src/locale/messages.pt.xlf b/frontend/src/locale/messages.pt.xlf index d3ebb471a..bfc0718da 100644 --- a/frontend/src/locale/messages.pt.xlf +++ b/frontend/src/locale/messages.pt.xlf @@ -952,6 +952,10 @@ src/app/bisq/bisq-transactions/bisq-transactions.component.html 20,21 + + src/app/components/block-overview-tooltip/block-overview-tooltip.component.html + 18 + src/app/dashboard/dashboard.component.html 124,125 @@ -1363,7 +1367,7 @@ Trades src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 90 + 99 @@ -1371,7 +1375,7 @@ Volume src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 91 + 100 @@ -2076,16 +2080,6 @@ 264,266 - - Value - Valor - - src/app/components/block-overview-tooltip/block-overview-tooltip.component.html - 18 - - Transaction value - transaction.value - Fee Taxa @@ -2242,6 +2236,7 @@ Block Prediction Accuracy + Precisão do Bloco Projetado src/app/components/block-prediction-graph/block-prediction-graph.component.html 5,7 diff --git a/frontend/src/locale/messages.ro.xlf b/frontend/src/locale/messages.ro.xlf index 075dde3de..f643f0b98 100644 --- a/frontend/src/locale/messages.ro.xlf +++ b/frontend/src/locale/messages.ro.xlf @@ -952,6 +952,10 @@ src/app/bisq/bisq-transactions/bisq-transactions.component.html 20,21 + + src/app/components/block-overview-tooltip/block-overview-tooltip.component.html + 18 + src/app/dashboard/dashboard.component.html 124,125 @@ -1363,7 +1367,7 @@ Tranzacții src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 90 + 99 @@ -1371,7 +1375,7 @@ Volum src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 91 + 100 @@ -2074,16 +2078,6 @@ 264,266 - - Value - Valoare - - src/app/components/block-overview-tooltip/block-overview-tooltip.component.html - 18 - - Transaction value - transaction.value - Fee Comision diff --git a/frontend/src/locale/messages.ru.xlf b/frontend/src/locale/messages.ru.xlf index 81e490e56..cfbd1fa16 100644 --- a/frontend/src/locale/messages.ru.xlf +++ b/frontend/src/locale/messages.ru.xlf @@ -952,6 +952,10 @@ src/app/bisq/bisq-transactions/bisq-transactions.component.html 20,21 + + src/app/components/block-overview-tooltip/block-overview-tooltip.component.html + 18 + src/app/dashboard/dashboard.component.html 124,125 @@ -1363,7 +1367,7 @@ Сделки src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 90 + 99 @@ -1371,7 +1375,7 @@ Объем src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 91 + 100 @@ -2074,16 +2078,6 @@ 264,266 - - Value - Значение - - src/app/components/block-overview-tooltip/block-overview-tooltip.component.html - 18 - - Transaction value - transaction.value - Fee Комиссия diff --git a/frontend/src/locale/messages.sl.xlf b/frontend/src/locale/messages.sl.xlf index 5582d6bbf..a9f4caecf 100644 --- a/frontend/src/locale/messages.sl.xlf +++ b/frontend/src/locale/messages.sl.xlf @@ -952,6 +952,10 @@ src/app/bisq/bisq-transactions/bisq-transactions.component.html 20,21 + + src/app/components/block-overview-tooltip/block-overview-tooltip.component.html + 18 + src/app/dashboard/dashboard.component.html 124,125 @@ -1363,7 +1367,7 @@ Posli src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 90 + 99 @@ -1371,7 +1375,7 @@ Obseg src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 91 + 100 @@ -1993,6 +1997,7 @@ At block: + Pri bloku: src/app/components/block-fee-rates-graph/block-fee-rates-graph.component.ts 188 @@ -2016,6 +2021,7 @@ Around block: + Približno pri bloku: src/app/components/block-fee-rates-graph/block-fee-rates-graph.component.ts 190 @@ -2074,16 +2080,6 @@ 264,266 - - Value - Vrednost - - src/app/components/block-overview-tooltip/block-overview-tooltip.component.html - 18 - - Transaction value - transaction.value - Fee Omrežnina @@ -2240,6 +2236,7 @@ Block Prediction Accuracy + Natančnost napovedi vsebine blokov src/app/components/block-prediction-graph/block-prediction-graph.component.html 5,7 @@ -2256,6 +2253,7 @@ Match rate + Stopnja ujemanja src/app/components/block-prediction-graph/block-prediction-graph.component.ts 176,174 @@ -2873,6 +2871,7 @@ Usually places your transaction in between the second and third mempool blocks + Vašo transakcijo običajno postavi med drugi in tretji blok mempool-a src/app/components/fees-box/fees-box.component.html 8,9 @@ -2894,6 +2893,7 @@ Usually places your transaction in between the first and second mempool blocks + Vašo transakcijo običajno postavi med prvi in drugi blok mempool-a src/app/components/fees-box/fees-box.component.html 9,10 @@ -3078,6 +3078,7 @@ Hashrate (MA) + Procesorska moč (MA) src/app/components/hashrate-chart/hashrate-chart.component.ts 288,287 @@ -3250,6 +3251,7 @@ Pools luck (1 week) + Sreča združenj (1 teden) src/app/components/pool-ranking/pool-ranking.component.html 9 @@ -3258,6 +3260,7 @@ Pools luck + Sreča združenj src/app/components/pool-ranking/pool-ranking.component.html 9,11 @@ -3266,6 +3269,7 @@ The overall luck of all mining pools over the past week. A luck bigger than 100% means the average block time for the current epoch is less than 10 minutes. + Skupna sreča vseh rudarskih združenj v zadnjem tednu. Sreča večja kot 100% pomeni, da je povprečen čas med bloki za trenutno obdobje manj kot 10 minut. src/app/components/pool-ranking/pool-ranking.component.html 11,15 @@ -3274,6 +3278,7 @@ Pools count (1w) + Število združenj (1 teden) src/app/components/pool-ranking/pool-ranking.component.html 17 @@ -3282,6 +3287,7 @@ Pools count + Število združenj src/app/components/pool-ranking/pool-ranking.component.html 17,19 @@ -3290,6 +3296,7 @@ How many unique pools found at least one block over the past week. + Število združenj z vsaj enim najdenim blokom v zadnjem tednu. src/app/components/pool-ranking/pool-ranking.component.html 19,23 @@ -3315,6 +3322,7 @@ The number of blocks found over the past week. + Število najdenih blokov v zadnjem tednu. src/app/components/pool-ranking/pool-ranking.component.html 27,31 @@ -4471,6 +4479,7 @@ REST API service + REST API storitev src/app/docs/api-docs/api-docs.component.html 34,35 diff --git a/frontend/src/locale/messages.sv.xlf b/frontend/src/locale/messages.sv.xlf index 6f34e2494..8dab5d45d 100644 --- a/frontend/src/locale/messages.sv.xlf +++ b/frontend/src/locale/messages.sv.xlf @@ -952,6 +952,10 @@ src/app/bisq/bisq-transactions/bisq-transactions.component.html 20,21 + + src/app/components/block-overview-tooltip/block-overview-tooltip.component.html + 18 + src/app/dashboard/dashboard.component.html 124,125 @@ -1363,7 +1367,7 @@ Transaktioner src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 90 + 99 @@ -1371,7 +1375,7 @@ Volym src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 91 + 100 @@ -2076,16 +2080,6 @@ 264,266 - - Value - Värde - - src/app/components/block-overview-tooltip/block-overview-tooltip.component.html - 18 - - Transaction value - transaction.value - Fee Avgift diff --git a/frontend/src/locale/messages.th.xlf b/frontend/src/locale/messages.th.xlf index b8d2b4878..5fe772084 100644 --- a/frontend/src/locale/messages.th.xlf +++ b/frontend/src/locale/messages.th.xlf @@ -952,6 +952,10 @@ src/app/bisq/bisq-transactions/bisq-transactions.component.html 20,21 + + src/app/components/block-overview-tooltip/block-overview-tooltip.component.html + 18 + src/app/dashboard/dashboard.component.html 124,125 @@ -1363,7 +1367,7 @@ เทรด src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 90 + 99 @@ -1371,7 +1375,7 @@ ปริมาณ src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 91 + 100 @@ -2074,16 +2078,6 @@ 264,266 - - Value - ค่า - - src/app/components/block-overview-tooltip/block-overview-tooltip.component.html - 18 - - Transaction value - transaction.value - Fee ค่าธรรมเนียม diff --git a/frontend/src/locale/messages.tr.xlf b/frontend/src/locale/messages.tr.xlf index f1119f3cf..57ee539ac 100644 --- a/frontend/src/locale/messages.tr.xlf +++ b/frontend/src/locale/messages.tr.xlf @@ -952,6 +952,10 @@ src/app/bisq/bisq-transactions/bisq-transactions.component.html 20,21 + + src/app/components/block-overview-tooltip/block-overview-tooltip.component.html + 18 + src/app/dashboard/dashboard.component.html 124,125 @@ -1363,7 +1367,7 @@ İşlemler src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 90 + 99 @@ -1371,7 +1375,7 @@ Hacim src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 91 + 100 @@ -2074,16 +2078,6 @@ 264,266 - - Value - Miktar - - src/app/components/block-overview-tooltip/block-overview-tooltip.component.html - 18 - - Transaction value - transaction.value - Fee Ücret diff --git a/frontend/src/locale/messages.uk.xlf b/frontend/src/locale/messages.uk.xlf index eb41c98c0..dc6f29bfb 100644 --- a/frontend/src/locale/messages.uk.xlf +++ b/frontend/src/locale/messages.uk.xlf @@ -952,6 +952,10 @@ src/app/bisq/bisq-transactions/bisq-transactions.component.html 20,21 + + src/app/components/block-overview-tooltip/block-overview-tooltip.component.html + 18 + src/app/dashboard/dashboard.component.html 124,125 @@ -1363,7 +1367,7 @@ Торги src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 90 + 99 @@ -1371,7 +1375,7 @@ Об'єм src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 91 + 100 @@ -2074,16 +2078,6 @@ 264,266 - - Value - Сума - - src/app/components/block-overview-tooltip/block-overview-tooltip.component.html - 18 - - Transaction value - transaction.value - Fee Комісія diff --git a/frontend/src/locale/messages.vi.xlf b/frontend/src/locale/messages.vi.xlf index f29faa7fd..babf362fc 100644 --- a/frontend/src/locale/messages.vi.xlf +++ b/frontend/src/locale/messages.vi.xlf @@ -952,6 +952,10 @@ src/app/bisq/bisq-transactions/bisq-transactions.component.html 20,21 + + src/app/components/block-overview-tooltip/block-overview-tooltip.component.html + 18 + src/app/dashboard/dashboard.component.html 124,125 @@ -1363,7 +1367,7 @@ Giao dịch src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 90 + 99 @@ -1371,7 +1375,7 @@ Khối lượng src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 91 + 100 @@ -2074,16 +2078,6 @@ 264,266 - - Value - Giá trị - - src/app/components/block-overview-tooltip/block-overview-tooltip.component.html - 18 - - Transaction value - transaction.value - Fee Phí diff --git a/frontend/src/locale/messages.zh.xlf b/frontend/src/locale/messages.zh.xlf index 4db9c0477..c2caf210b 100644 --- a/frontend/src/locale/messages.zh.xlf +++ b/frontend/src/locale/messages.zh.xlf @@ -952,6 +952,10 @@ src/app/bisq/bisq-transactions/bisq-transactions.component.html 20,21 + + src/app/components/block-overview-tooltip/block-overview-tooltip.component.html + 18 + src/app/dashboard/dashboard.component.html 124,125 @@ -1363,7 +1367,7 @@ 交易 src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 90 + 99 @@ -1371,7 +1375,7 @@ 交易量 src/app/bisq/lightweight-charts-area/lightweight-charts-area.component.ts - 91 + 100 @@ -2065,16 +2069,6 @@ 264,266 - - Value - 价值 - - src/app/components/block-overview-tooltip/block-overview-tooltip.component.html - 18 - - Transaction value - transaction.value - Fee 手续费 diff --git a/production/install b/production/install index ea2b9ced7..22d15b5af 100755 --- a/production/install +++ b/production/install @@ -183,6 +183,9 @@ case $OS in TOR_PKG=tor TOR_USER=_tor TOR_GROUP=_tor + NGINX_USER=www + NGINX_ETC_FOLDER=/usr/local/etc/nginx + NGINX_CONFIGURATION=/usr/local/etc/nginx/nginx.conf CERTBOT_PKG=py39-certbot ;; @@ -197,6 +200,7 @@ case $OS in TOR_USER=debian-tor TOR_GROUP=debian-tor CERTBOT_PKG=python3-certbot-nginx + NGINX_USER=www-data NGINX_ETC_FOLDER=/etc/nginx NGINX_CONFIGURATION=/etc/nginx/nginx.conf ;; @@ -1534,26 +1538,17 @@ NGINX_BISQ_ONION=$(cat "${TOR_RESOURCES}/bisq/hostname") NGINX_LIQUID_ONION=$(cat "${TOR_RESOURCES}/liquid/hostname") echo "[*] Adding Nginx configuration" -case $OS in - - FreeBSD) - echo "[*] FIXME: nginx must be configured manually on FreeBSD" - ;; - - Debian) - osSudo "${ROOT_USER}" install -c -o "${ROOT_USER}" -g "${ROOT_GROUP}" -m 644 "${MEMPOOL_HOME}/${MEMPOOL_REPO_NAME}/production/nginx/nginx.conf" "${NGINX_CONFIGURATION}" - mkdir -p /var/cache/nginx/services /var/cache/nginx/api - chown www-data: /var/cache/nginx/services /var/cache/nginx/api - ln -s /mempool/mempool /etc/nginx/mempool - osSudo "${ROOT_USER}" sed -i.orig "s!__NGINX_USER__!www-data!" "${NGINX_CONFIGURATION}" - osSudo "${ROOT_USER}" sed -i.orig "s!__NGINX_ETC_FOLDER__!${NGINX_ETC_FOLDER}!" "${NGINX_CONFIGURATION}" - osSudo "${ROOT_USER}" sed -i.orig "s!__NGINX_MEMPOOL_ONION__!${NGINX_MEMPOOL_ONION%.onion}!" "${NGINX_CONFIGURATION}" - osSudo "${ROOT_USER}" sed -i.orig "s!__NGINX_BISQ_ONION__!${NGINX_BISQ_ONION%.onion}!" "${NGINX_CONFIGURATION}" - osSudo "${ROOT_USER}" sed -i.orig "s!__NGINX_LIQUID_ONION__!${NGINX_LIQUID_ONIONi%.onion}!" "${NGINX_CONFIGURATION}" - echo "[*] Restarting Nginx" - osSudo "${ROOT_USER}" service nginx restart - ;; -esac +osSudo "${ROOT_USER}" install -c -o "${ROOT_USER}" -g "${ROOT_GROUP}" -m 644 "${MEMPOOL_HOME}/${MEMPOOL_REPO_NAME}/production/nginx/nginx.conf" "${NGINX_CONFIGURATION}" +mkdir -p /var/cache/nginx/services /var/cache/nginx/api +chown ${NGINX_USER}: /var/cache/nginx/services /var/cache/nginx/api +ln -s /mempool/mempool /etc/nginx/mempool +osSudo "${ROOT_USER}" sed -i.orig "s!__NGINX_USER__!${NGINX_USER}!" "${NGINX_CONFIGURATION}" +osSudo "${ROOT_USER}" sed -i.orig "s!__NGINX_ETC_FOLDER__!${NGINX_ETC_FOLDER}!" "${NGINX_CONFIGURATION}" +osSudo "${ROOT_USER}" sed -i.orig "s!__NGINX_MEMPOOL_ONION__!${NGINX_MEMPOOL_ONION%.onion}!" "${NGINX_CONFIGURATION}" +osSudo "${ROOT_USER}" sed -i.orig "s!__NGINX_BISQ_ONION__!${NGINX_BISQ_ONION%.onion}!" "${NGINX_CONFIGURATION}" +osSudo "${ROOT_USER}" sed -i.orig "s!__NGINX_LIQUID_ONION__!${NGINX_LIQUID_ONIONi%.onion}!" "${NGINX_CONFIGURATION}" +echo "[*] Restarting Nginx" +osSudo "${ROOT_USER}" service nginx restart ##### OS systemd