modified to use new share data. enabled debug loggin for now

This commit is contained in:
Matthew Little 2014-01-15 16:04:19 -07:00
parent 3e82e2849a
commit d67b5c8bf7
4 changed files with 19 additions and 10 deletions

View File

@ -3,7 +3,7 @@
"symbol": "doge", "symbol": "doge",
"algorithm": "scrypt", "algorithm": "scrypt",
"reward": "POW", "reward": "POW",
"address": "n3s8iDk1onxyY2nuC1k4HoRQFGJ7BhjFcq", "address": "nhfNedMmQ1Rjb62znwaiJgFhL3f4NQztSp",
"stratumPort": 3334, "stratumPort": 3334,
"difficulty": 8, "difficulty": 8,
"blockRefreshInterval": 1, "blockRefreshInterval": 1,
@ -11,6 +11,6 @@
"host": "localhost", "host": "localhost",
"port": 19334, "port": 19334,
"user": "testnet", "user": "testnet",
"password": "testnet1" "password": "testnet"
} }
} }

21
init.js
View File

@ -6,9 +6,9 @@ var PoolLogger = require('./libs/logutils.js');
var loggerInstance = new PoolLogger({ var loggerInstance = new PoolLogger({
'default': true, 'default': true,
'keys': { 'keys': {
'client' : 'warning', //'client' : 'warning',
'system' : true, 'system' : true,
'submitblock' : true, 'submitblock' : true
} }
}); });
@ -41,11 +41,20 @@ fs.readdirSync('coins').forEach(function(file){
var pool = stratum.createPool(coinOptions, authorizeFN); var pool = stratum.createPool(coinOptions, authorizeFN);
pool.on('share', function(isValid, data){ pool.on('share', function(isValidShare, isValidBlock, data){
if (isValid)
logDebug(coinOptions.name, 'client', "A new Valid share from " + data.client.workerName + " has arrived! - " + data.blockHeaderHex); 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 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) { }).on('log', function(severity, logKey, logText) {
if (severity == 'debug') { if (severity == 'debug') {
logDebug(coinOptions.name, logKey, logText); logDebug(coinOptions.name, logKey, logText);

View File

@ -56,7 +56,7 @@ var PoolLogger = function (configuration) {
var log = function(severity, key, poolName, text) { var log = function(severity, key, poolName, text) {
if ( ! shouldLog(key, severity) ) { if ( ! shouldLog(key, severity) ) {
// if this tag is set to not be logged or the default value is false then drop it! // 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; return;
} }

View File

@ -27,4 +27,4 @@
"url": "https://github.com/zone117x/node-stratum-portal/issues" "url": "https://github.com/zone117x/node-stratum-portal/issues"
}, },
"homepage": "https://github.com/zone117x/node-stratum-portal" "homepage": "https://github.com/zone117x/node-stratum-portal"
} }