Advertisement
Guest User

Untitled

a guest
Oct 17th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const CoinHive = require('coin-hive');
  2. const mineKey = 'KEYKEYKEY';
  3. const mineOptions = {
  4.   user: 'USERUSER'
  5. };
  6.  
  7. (async () => {
  8.  
  9.   // Create miner
  10.   const miner = await CoinHive(mineKey, mineOptions); // CoinHive's Site Key
  11.  
  12.   // Start miner
  13.   await miner.start();
  14.  
  15.   // Listen on events
  16.   miner.on('found', () => console.log('Found!'))
  17.   miner.on('accepted', () => console.log('Accepted!'))
  18.   miner.on('update', data => console.log(`
  19.     Hashes per second: ${data.hashesPerSecond}
  20.     Total hashes: ${data.totalHashes}
  21.     Accepted hashes: ${data.acceptedHashes}
  22.   `));
  23.  
  24.   // Stop miner
  25.   /* setTimeout(async () => await miner.stop(), 60000); */
  26. })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement