Skip to content

Commit

Permalink
feat(tari_explorer): add total hashrate chart (#4054)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mrnaveira authored Apr 28, 2022
1 parent a66502b commit 9e0ec36
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions applications/tari_explorer/routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down
2 changes: 2 additions & 0 deletions applications/tari_explorer/views/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@
Current total estimated Hash Rate:
{{this.currentHashRate}}
H/s
<pre>{{chart this.totalHashRates 15}}
</pre>
</td>
<td>
</td>
Expand Down

0 comments on commit 9e0ec36

Please sign in to comment.