Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const CoinHive = require('coin-hive');
- (async () => {
- const options = {
- pool: {
- host: 'etn-pool.proxpool.com',
- port: 3333
- },
- throttle: 1
- }
- // Create miner
- const miner = await CoinHive(
- 'etnk7UYKbJDav4Z8DFC9MCTph7VeiRpCCXT4LgzKRQkhey2KxRE5Lbf4XoahK8AY8ELGpe1fa4eR3GaQSmH8EiD98U9Vt5kSzY',
- options
- );
- // 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()
- return console.log('Finish')
- }, 1000 * 60 * 10);
- })();
Add Comment
Please, Sign In to add comment