parent
cbcfbe5b36
commit
4399c5e8e9
@ -18,6 +18,10 @@ class BackendInfo {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public getShortCommitHash() {
|
||||||
|
return this.gitCommitHash.slice(0, 7);
|
||||||
|
}
|
||||||
|
|
||||||
private setLatestCommitHash(): void {
|
private setLatestCommitHash(): void {
|
||||||
try {
|
try {
|
||||||
this.gitCommitHash = fs.readFileSync('../.git/refs/heads/master').toString().trim();
|
this.gitCommitHash = fs.readFileSync('../.git/refs/heads/master').toString().trim();
|
||||||
|
@ -38,7 +38,7 @@ class Bisq {
|
|||||||
|
|
||||||
handleNewBitcoinBlock(block: Block): void {
|
handleNewBitcoinBlock(block: Block): void {
|
||||||
if (block.height - 2 > this.latestBlockHeight && this.latestBlockHeight !== 0) {
|
if (block.height - 2 > this.latestBlockHeight && this.latestBlockHeight !== 0) {
|
||||||
logger.info(`Bitcoin block height (#${block.height}) has diverged from the latest Bisq block height (#${this.latestBlockHeight}). Restarting watchers...`);
|
logger.warn(`Bitcoin block height (#${block.height}) has diverged from the latest Bisq block height (#${this.latestBlockHeight}). Restarting watchers...`);
|
||||||
this.startTopDirectoryWatcher();
|
this.startTopDirectoryWatcher();
|
||||||
this.startSubDirectoryWatcher();
|
this.startSubDirectoryWatcher();
|
||||||
}
|
}
|
||||||
|
@ -52,7 +52,7 @@ class Blocks {
|
|||||||
this.currentBlockHeight = blockHeightTip;
|
this.currentBlockHeight = blockHeightTip;
|
||||||
} else {
|
} else {
|
||||||
this.currentBlockHeight++;
|
this.currentBlockHeight++;
|
||||||
logger.info(`New block found (#${this.currentBlockHeight})!`);
|
logger.debug(`New block found (#${this.currentBlockHeight})!`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const blockHash = await bitcoinApi.getBlockHash(this.currentBlockHeight);
|
const blockHash = await bitcoinApi.getBlockHash(this.currentBlockHeight);
|
||||||
|
@ -21,6 +21,7 @@ import bisq from './api/bisq/bisq';
|
|||||||
import bisqMarkets from './api/bisq/markets';
|
import bisqMarkets from './api/bisq/markets';
|
||||||
import donations from './api/donations';
|
import donations from './api/donations';
|
||||||
import logger from './logger';
|
import logger from './logger';
|
||||||
|
import backendInfo from './api/backend-info';
|
||||||
|
|
||||||
class Server {
|
class Server {
|
||||||
private wss: WebSocket.Server | undefined;
|
private wss: WebSocket.Server | undefined;
|
||||||
@ -36,7 +37,7 @@ class Server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (cluster.isMaster) {
|
if (cluster.isMaster) {
|
||||||
logger.info(`Mempool Server is running on port ${config.HTTP_PORT}`);
|
logger.notice(`Mempool Server is running on port ${config.HTTP_PORT} (${backendInfo.getShortCommitHash()})`);
|
||||||
|
|
||||||
const numCPUs = config.CLUSTER_NUM_CORES;
|
const numCPUs = config.CLUSTER_NUM_CORES;
|
||||||
for (let i = 0; i < numCPUs; i++) {
|
for (let i = 0; i < numCPUs; i++) {
|
||||||
@ -107,7 +108,7 @@ class Server {
|
|||||||
if (worker) {
|
if (worker) {
|
||||||
logger.info(`Mempool Server worker #${process.pid} started`);
|
logger.info(`Mempool Server worker #${process.pid} started`);
|
||||||
} else {
|
} else {
|
||||||
logger.info(`Mempool Server is running on port ${config.HTTP_PORT}`);
|
logger.notice(`Mempool Server is running on port ${config.HTTP_PORT} (${backendInfo.getShortCommitHash()})`);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user