Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Additional card in main window showing the network hashrate #2

Closed
lemois-1337 opened this issue Jan 21, 2024 · 2 comments · Fixed by #4
Closed

Additional card in main window showing the network hashrate #2

lemois-1337 opened this issue Jan 21, 2024 · 2 comments · Fixed by #4
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@lemois-1337
Copy link
Collaborator

lemois-1337 commented Jan 21, 2024

Is your feature request related to a problem? Please describe.
No

Describe the solution you'd like
It is very beneficial if miners will see the network hashrate in comparison to their device hashrate when running miner and node together on the same system. The hashrate has to be in human readable format, so automatic format for KH/sec, MH/sec, GH/sec, TH/sec and PH/sec has to be calculated.

Additional context
See the screenshot below, where to add it:
image

@lemois-1337 lemois-1337 added enhancement New feature or request good first issue Good for newcomers labels Jan 21, 2024
@RoboticWF
Copy link

Any suggestions where to pull the miners hashrate from?

@lemois-1337
Copy link
Collaborator Author

The miner hashrate is already shown, when a miner is started. The node dashboard should also show the global network hashrate. It can be requested from GetBlockDagInfo gRPC call and some additional calculation, CLI example:

~# karlsenctl GetBlockDagInfo 
{
    "getBlockDagInfoResponse": {
        "networkName": "karlsen-mainnet",
        "blockCount": "190534",
        "headerCount": "7726849",
        "tipHashes": [
            "1e2ab01fc305cf3e782674f3bb2bf8c5f0fd2d6aeebe51933ce385292a7f91d2"
        ],
        "difficulty": 102993445633923.78,
        "pastMedianTime": "1706136665163",
        "virtualParentHashes": [
            "1e2ab01fc305cf3e782674f3bb2bf8c5f0fd2d6aeebe51933ce385292a7f91d2"
        ],
        "pruningPointHash": "af59a6315ffdbdbc6cf0f5bf343304e56def9c6005d4726b78e875872aa4a798",
        "virtualDaaScore": "6946012",
        "error": null
    }
}

Use difficulty multiply it with 2 and divide it by 1.000.000.000.000 to get the TH/sec. One-liner using jq:

~# echo "$(karlsenctl GetBlockDagInfo | jq '.getBlockDagInfoResponse.difficulty')*2/1000000000000" | bc -l
206.81829374176844000000

@lemois-1337 lemois-1337 changed the title Additional card in main windows showing the network hashrate Additional card in main window showing the network hashrate Mar 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants