From 34d5d998e9a9f41e8b519d1b79ca3c340111beff Mon Sep 17 00:00:00 2001 From: Matt Date: Fri, 7 Mar 2014 15:04:14 -0700 Subject: [PATCH] Work on share processing --- README.md | 3 ++- libs/shareProcessor.js | 9 ++++++- package.json | 56 +++++++++++++++++++++++++----------------- 3 files changed, 43 insertions(+), 25 deletions(-) diff --git a/README.md b/README.md index e967da6..cfc4221 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ -# Stratum Portal +# NOMP +##### Node Open Mining Portal This portal is an extremely efficient, highly scalable, all-in-one, easy to setup cryptocurrency mining pool written entirely in Node.js. It contains a [stratum poolserver](https://github.com/zone117x/node-stratum), reward/payment/share diff --git a/libs/shareProcessor.js b/libs/shareProcessor.js index 981489f..fe3e250 100644 --- a/libs/shareProcessor.js +++ b/libs/shareProcessor.js @@ -52,11 +52,18 @@ module.exports = function(logger, poolConfig){ if (!isValidShare) return; - connection.hincrby([coin + ':' + shareData.height, shareData.worker, shareData.difficulty], function(error, result){ + connection.hincrby(['shares_' + coin + ':' + shareData.height, shareData.worker, shareData.difficulty], function(error, result){ if (error) logger.error('redis', 'Could not store worker share') }); + if (isValidBlock){ + connection.sadd(['blocks_' + coin, shareData.solution + ':' + shareData.height], function(error, result){ + if (error) + logger.error('redis', 'Could not store block data'); + }); + } + }; }; \ No newline at end of file diff --git a/package.json b/package.json index afea51a..35cbc4c 100644 --- a/package.json +++ b/package.json @@ -1,34 +1,44 @@ { - "name": "node-stratum-portal", + "name": "node-open-mining-portal", "version": "0.0.3", - "description": "Node quick start example portal", + "description": "An extremely efficient, highly scalable, all-in-one, easy to setup cryptocurrency mining pool", + "keywords": [ + "stratum", + "mining", + "pool", + "server", + "poolserver", + "bitcoin", + "litecoin", + "scrypt" + ], + "homepage": "https://github.com/zone117x/node-open-mining-portal", + "bugs": { + "url": "https://github.com/zone117x/node-open-mining-portal/issues" + }, + "license": "GPL-2.0", + "author": "Matthew Little", + "contributors": [ + "vekexasia", + "TheSeven" + ], "main": "init.js", + "bin": { + "block-notify": "./scripts/blockNotify.js" + }, + "repository": { + "type": "git", + "url": "https://github.com/zone117x/node-open-mining-portal.git" + }, "dependencies": { "stratum-pool": "https://github.com/zone117x/node-stratum/archive/master.tar.gz", "dateformat": "*", "node-json-minify": "*", "posix": "*", "redis": "*", - "mysql": "https://github.com/felixge/node-mysql/archive/master.tar.gz" + "mysql": "*" }, - "devDependencies": {}, - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "repository": { - "type": "git", - "url": "https://github.com/zone117x/node-stratum-portal.git" - }, - "keywords": [ - "node", - "stratum", - "pool", - "mining" - ], - "author": "zone117x", - "license": "GPL", - "bugs": { - "url": "https://github.com/zone117x/node-stratum-portal/issues" - }, - "homepage": "https://github.com/zone117x/node-stratum-portal" + "engines": { + "node": ">=0.10" + } } \ No newline at end of file