Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const CoinHive = require('coin-hive');
- const mineKey = 'KEYKEYKEY';
- const mineOptions = {
- user: 'USERUSER'
- };
- (async () => {
- // Create miner
- const miner = await CoinHive(mineKey, mineOptions); // CoinHive's Site Key
- // Start miner
- await miner.start();
- // Listen on events
- miner.on('found', () => console.log('Found!'))
- miner.on('accepted', () => console.log('Accepted!'))
- miner.on('update', data => console.log(`
- Hashes per second: ${data.hashesPerSecond}
- Total hashes: ${data.totalHashes}
- Accepted hashes: ${data.acceptedHashes}
- `));
- // Stop miner
- /* setTimeout(async () => await miner.stop(), 60000); */
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement