Add daily historical price - show USD in block fee reward charts

This commit is contained in:
nymkappa
2022-07-11 23:16:48 +02:00
parent 40634a0eb8
commit a97675c538
16 changed files with 74 additions and 117 deletions

View File

@@ -5,6 +5,7 @@ import mining from './api/mining/mining';
import logger from './logger';
import HashratesRepository from './repositories/HashratesRepository';
import bitcoinClient from './api/bitcoin/bitcoin-client';
import priceUpdater from './tasks/price-updater';
class Indexer {
runIndexer = true;
@@ -38,6 +39,8 @@ class Indexer {
logger.debug(`Running mining indexer`);
try {
await priceUpdater.$run();
const chainValid = await blocks.$generateBlockDatabase();
if (chainValid === false) {
// Chain of block hash was invalid, so we need to reindex. Stop here and continue at the next iteration
@@ -47,6 +50,7 @@ class Indexer {
return;
}
await mining.$indexBlockPrices();
await mining.$indexDifficultyAdjustments();
await this.$resetHashratesIndexingState(); // TODO - Remove this as it's not efficient
await mining.$generateNetworkHashrateHistory();