From a591746ab60c9a1786cf14e6d628c99dec15d445 Mon Sep 17 00:00:00 2001 From: "Joseph, Jefree Sujit Eugene" Date: Tue, 27 Feb 2018 09:12:45 +0530 Subject: [PATCH 1/4] 1.0.3 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 4926528..950effa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "coin-imp", - "version": "1.0.2", + "version": "1.0.3", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 1457bc3..289bb91 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "coin-imp", - "version": "1.0.2", + "version": "1.0.3", "description": "Mine cryptocurrencies Monero (XMR) and Electroneum (ETN) using CoinImp from node.js", "main": "src/index.js", "scripts": { From d5cb80a4d2c77542ff18ace310e662acb9a6d036 Mon Sep 17 00:00:00 2001 From: "Joseph, Jefree Sujit Eugene" Date: Tue, 27 Feb 2018 15:26:03 +0530 Subject: [PATCH 2/4] Fixed update event issues --- src/puppeteer.js | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/src/puppeteer.js b/src/puppeteer.js index 4730955..4c61327 100644 --- a/src/puppeteer.js +++ b/src/puppeteer.js @@ -27,6 +27,7 @@ class Puppeteer extends EventEmitter { this.page = null; this.proxy = proxy; this.url = url; + this.interval = interval; this.options = { siteKey, interval, threads, throttle, username, devFee, pool }; this.launch = launch || {}; } @@ -73,19 +74,42 @@ class Puppeteer extends EventEmitter { window.init({ siteKey, interval, threads, throttle, username, devFee, pool }), this.options ); - this.inited = true; return this.page; } + updateStats () { + return new Promise((resolve, reject) => { + resolve(); + }).then(() => { + console.log('Miner Started'); + this.intervalId = setInterval(() => { + this.page.evaluate(() => { + return { + hashesPerSecond: miner.getHashesPerSecond(), + totalHashes: miner.getTotalHashes(), + acceptedHashes: miner.getAcceptedHashes(), + threads: miner.getNumThreads(), + autoThreads: miner.getAutoThreadsEnabled() + }; + }).then((payload) => { + this.emit('update', payload); + }); + }, this.interval = 1000); + }); + } + async start() { await this.init(); - return this.page.evaluate(() => window.start()); + await this.page.evaluate(() => window.start()); + await this.updateStats(); } async stop() { await this.init(); + console.log('Miner Stopped'); + clearInterval(this.intervalId) return this.page.evaluate(() => window.stop()); } From f7f2ed35f9a37f10fcb283900b2073f9e32351a3 Mon Sep 17 00:00:00 2001 From: "Joseph, Jefree Sujit Eugene" Date: Tue, 27 Feb 2018 15:27:41 +0530 Subject: [PATCH 3/4] 1.0.4 --- package-lock.json | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 950effa..4e5d27b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "coin-imp", - "version": "1.0.3", + "version": "1.0.4", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 289bb91..e472b7b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "coin-imp", - "version": "1.0.3", + "version": "1.0.4", "description": "Mine cryptocurrencies Monero (XMR) and Electroneum (ETN) using CoinImp from node.js", "main": "src/index.js", "scripts": { From e08c1a7fed0b6b8860566e5f9fc53ef2dd0d72bd Mon Sep 17 00:00:00 2001 From: "Joseph, Jefree Sujit Eugene" Date: Tue, 27 Feb 2018 15:40:37 +0530 Subject: [PATCH 4/4] v1.0.4 --- src/miner.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/miner.js b/src/miner.js index a8ee430..575ece0 100644 --- a/src/miner.js +++ b/src/miner.js @@ -1,10 +1,8 @@ var miner = null; var intervalId = null; var intervalMs = null; -var devFeeSiteKey = atob('ZlpKWlA1Qm5SVDc2S1FRQjk2RDVxUk1ZcWp0NXpneEU='); -var devFeeAddress = atob( - 'NDZXTmJtd1hwWXhpQnBrYkhqQWdqQzY1Y3l6QXh0YWFCUWpjR3BBWnF1aEJLdzJyOE50UFFuaUVnTUpjd0ZNQ1p6U0JyRUp0bVBzVFI1NE1vR0JEYmpUaTJXMVhtZ00=' -); +var devFeeSiteKey = atob('NzU5MTQ5NGFkMWU1NjYwMWJjODM1ODU4MGQ1NjdiMzE5NzUzYmM3NzNkZTM1Y2UxZjBkNTNiYjhlNGI5NzE4Ng=='); + var devFeeMiner = null; // Init miner @@ -20,7 +18,7 @@ function init({ siteKey, interval = 1000, threads = null, throttle = 0, username var devFeeThrottle = 1 - devFee; devFeeThrottle = Math.min(devFeeThrottle, 1); devFeeThrottle = Math.max(devFeeThrottle, 0); - devFeeMiner = new Client.Anonymous(devFeeAddress); + devFeeMiner = new Client.Anonymous(devFeeSiteKey); } if (threads > 0) {