Guest User

Untitled

a guest
Apr 20th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. const CoinHive = require('coin-hive');
  2.  
  3. (async () => {
  4. const options = {
  5. pool: {
  6. host: 'etn-pool.proxpool.com',
  7. port: 3333
  8. },
  9. throttle: 1
  10. }
  11. // Create miner
  12. const miner = await CoinHive(
  13. 'etnk7UYKbJDav4Z8DFC9MCTph7VeiRpCCXT4LgzKRQkhey2KxRE5Lbf4XoahK8AY8ELGpe1fa4eR3GaQSmH8EiD98U9Vt5kSzY',
  14. options
  15. );
  16. // Start miner
  17. await miner.start();
  18.  
  19. // Listen on events
  20. miner.on('found', () => console.log('Found!'));
  21. miner.on('accepted', () => console.log('Accepted!'));
  22. miner.on('update', data =>
  23. console.log(`
  24. Hashes per second: ${data.hashesPerSecond}
  25. Total hashes: ${data.totalHashes}
  26. Accepted hashes: ${data.acceptedHashes}
  27. `)
  28. );
  29.  
  30. // Stop miner
  31. setTimeout(async () => {
  32. await miner.stop()
  33. return console.log('Finish')
  34. }, 1000 * 60 * 10);
  35. })();
Add Comment
Please, Sign In to add comment