cazala / coin-hive-stratum

use CoinHive's JavaScript miner on any stratum pool
http://npmjs.com/package/coin-hive-stratum
416 stars 466 forks source link

Most of hashes not accepted #131

Open Lisennk opened 6 years ago

Lisennk commented 6 years ago

Following code:

<script>
  // Configure CoinHive to point to your proxy
  CoinHive.CONFIG.WEBSOCKET_SHARDS = [["ws://localhost:8800"]];

  // Start miner
  var miner = CoinHive.Anonymous('4AnnLEK2k5n7msJqA3t1excg49imMpgtzFFuxBryXh9E17cxhqxZFYJUbUc7X7jkJg6q61va5tnDG82ZV4ngVfEr9ZC5cC6');
  miner.start();

  setInterval(function() {
        var hashesPerSecond = miner.getHashesPerSecond();
        var totalHashes = miner.getTotalHashes();
        var acceptedHashes = miner.getAcceptedHashes();

        console.log(`H/s: `, hashesPerSecond);
    console.log(`Total: `, totalHashes);
    console.log(`accepted: `, acceptedHashes);
    console.log(`dined: `, totalHashes - acceptedHashes);
    console.log(`--`);
    }, 1000);

</script>

Shows this: screenshot from 2017-12-24 19-23-31

Any idea?

adamdupuis commented 6 years ago

It depends on the difficulty of the pool you are using. If I understood @cazala's explanation properly, on a difficulty of 1000, 1 accepted hash is actually 1000. If diff = 100, 1 accepted = 100 accepted hashes. Correct me if I'm wrong.

neverknoww commented 6 years ago

adam is correct, also you have to be quicker than other miners

cazala commented 6 years ago

https://github.com/cazala/coin-hive-stratum/issues/83#issuecomment-349352747