diff --git a/coins/dogecoin_example.json b/coins/dogecoin_example.json index 9485c8a..a9df035 100644 --- a/coins/dogecoin_example.json +++ b/coins/dogecoin_example.json @@ -3,7 +3,7 @@ "symbol": "doge", "algorithm": "scrypt", "reward": "POW", - "address": "n3s8iDk1onxyY2nuC1k4HoRQFGJ7BhjFcq", + "address": "nhfNedMmQ1Rjb62znwaiJgFhL3f4NQztSp", "stratumPort": 3334, "difficulty": 8, "blockRefreshInterval": 1, @@ -11,6 +11,6 @@ "host": "localhost", "port": 19334, "user": "testnet", - "password": "testnet1" + "password": "testnet" } } diff --git a/init.js b/init.js index 3a32291..b985099 100644 --- a/init.js +++ b/init.js @@ -6,9 +6,9 @@ var PoolLogger = require('./libs/logutils.js'); var loggerInstance = new PoolLogger({ 'default': true, 'keys': { - 'client' : 'warning', + //'client' : 'warning', 'system' : true, - 'submitblock' : true, + 'submitblock' : true } }); @@ -41,11 +41,20 @@ fs.readdirSync('coins').forEach(function(file){ var pool = stratum.createPool(coinOptions, authorizeFN); - pool.on('share', function(isValid, data){ - if (isValid) - logDebug(coinOptions.name, 'client', "A new Valid share from " + data.client.workerName + " has arrived! - " + data.blockHeaderHex); + pool.on('share', function(isValidShare, isValidBlock, data){ + + var shareData = JSON.stringify(data); + + if (isValidBlock) + logDebug(coinOptions.name, 'client', 'Block found, share data: ' + shareData); + else if (isValidShare) + logDebug(coinOptions.name, 'client', 'Valid share submitted, share data: ' + shareData); + else if (data.solution) + logDebug(coinOptions.name, 'client', 'We thought a block solution was found but it was rejected by the daemon, share data: ' + shareData); else - logDebug(coinOptions.name, 'client', "Invalid share form " + data.client.workerName + " ErrorCode: " + data.errorCode + " ErrorDescription: " + data.errorDescription); + logDebug(coinOptions.name, 'client', 'Invalid share submitted, share data: ' + shareData) + + }).on('log', function(severity, logKey, logText) { if (severity == 'debug') { logDebug(coinOptions.name, logKey, logText); diff --git a/libs/logutils.js b/libs/logutils.js index 68eeee9..5ef890d 100644 --- a/libs/logutils.js +++ b/libs/logutils.js @@ -56,7 +56,7 @@ var PoolLogger = function (configuration) { var log = function(severity, key, poolName, text) { if ( ! shouldLog(key, severity) ) { // if this tag is set to not be logged or the default value is false then drop it! - //console.log(key+"DROPPED "+text); + //console.log(key+"DROPPED "+text + 'SEV' + severity); return; } diff --git a/package.json b/package.json index c75e08f..a7f3819 100644 --- a/package.json +++ b/package.json @@ -27,4 +27,4 @@ "url": "https://github.com/zone117x/node-stratum-portal/issues" }, "homepage": "https://github.com/zone117x/node-stratum-portal" -} +} \ No newline at end of file