From 9e0ec361f5da8b9fff3a95c1a8ec162dfef6601a Mon Sep 17 00:00:00 2001 From: mrnaveira <47919901+mrnaveira@users.noreply.github.com> Date: Thu, 28 Apr 2022 16:17:20 +0100 Subject: [PATCH] feat(tari_explorer): add total hashrate chart (#4054) Description --- Reused the already provided hashrate data by the gRPC client to plot the total in the Tari text explorer. Motivation and Context --- Recently we fixed the total estimated hashrate calculation, and included it in the Tari text explorer. We added charts for both Monero and SHA3 hashrates, but we didn't include a chart for the total hashrate. The motivation of this PR is to add the total hashrate chart to the explorer: ![Screenshot 2022-04-26 at 17 19 13](https://user-images.githubusercontent.com/47919901/165349284-95ec2b18-5aa8-405a-b48b-46657446f89c.png) How Has This Been Tested? --- Manually running the text explorer --- applications/tari_explorer/routes/index.js | 1 + applications/tari_explorer/views/index.hbs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/applications/tari_explorer/routes/index.js b/applications/tari_explorer/routes/index.js index 4088af8207..9818e1eb0e 100644 --- a/applications/tari_explorer/routes/index.js +++ b/applications/tari_explorer/routes/index.js @@ -116,6 +116,7 @@ router.get("/", async function (req, res) { moneroTimes: getBlockTimes(last100Headers, "0"), shaTimes: getBlockTimes(last100Headers, "1"), currentHashRate: totalHashRates[totalHashRates.length - 1], + totalHashRates, currentShaHashRate: shaHashRates[shaHashRates.length - 1], shaHashRates, currentMoneroHashRate: moneroHashRates[moneroHashRates.length - 1], diff --git a/applications/tari_explorer/views/index.hbs b/applications/tari_explorer/views/index.hbs index f7a60b3a04..e897c82c1d 100644 --- a/applications/tari_explorer/views/index.hbs +++ b/applications/tari_explorer/views/index.hbs @@ -97,6 +97,8 @@ Current total estimated Hash Rate: {{this.currentHashRate}} H/s +
{{chart this.totalHashRates 15}}
+