From 1a00efc42abbe60b2a490fb8b508b11e196eb86d Mon Sep 17 00:00:00 2001 From: Matt Date: Mon, 24 Mar 2014 14:00:18 -0600 Subject: [PATCH] Better error message for when payment processor detects that it doesn't own the address. Updated readme with better deamon setup instructions. Removed 'reward' field from coins since we auto-detect that now. --- README.md | 32 +++++++++++++++++++------------- coins/alphacoin.json | 1 - coins/anoncoin.json | 1 - coins/auroracoin.json | 1 - coins/bitcoin.json | 1 - coins/bottlecaps.json | 1 - coins/casinocoin.json | 1 - coins/catcoin.json | 1 - coins/darkcoin.json | 1 - coins/diamondcoin.json | 1 - coins/digibyte.json | 1 - coins/dogecoin.json | 1 - coins/earthcoin.json | 1 - coins/elephantcoin.json | 1 - coins/emerald.json | 1 - coins/ezcoin.json | 1 - coins/fastcoin.json | 1 - coins/flappycoin.json | 1 - coins/florincoin.json | 1 - coins/frankocoin.json | 1 - coins/galaxycoin.json | 1 - coins/gamecoin.json | 1 - coins/hobonickels.json | 6 ++++++ coins/junkcoin.json | 1 - coins/kittehcoin.json | 1 - coins/krugercoin.json | 1 - coins/litecoin.json | 1 - coins/lottocoin.json | 1 - coins/luckycoin.json | 1 - coins/memecoin.json | 1 - coins/neocoin.json | 1 - coins/netcoin.json | 1 - coins/noirbits.json | 1 - coins/peercoin.json | 1 - coins/phoenixcoin.json | 1 - coins/quarkcoin.json | 1 - coins/reddcoin.json | 1 - coins/sexcoin.json | 1 - coins/skeincoin.json | 1 - coins/spots.json | 1 - coins/stablecoin.json | 1 - coins/xencoin.json | 1 - coins/yacoin.json | 1 - init.js | 8 ++++---- libs/paymentProcessor.js | 2 +- libs/poolWorker.js | 7 +++++-- 46 files changed, 35 insertions(+), 61 deletions(-) create mode 100644 coins/hobonickels.json diff --git a/README.md b/README.md index 7d1f76a..46b967a 100644 --- a/README.md +++ b/README.md @@ -29,11 +29,8 @@ pool such as connected miners, network/pool difficulty/hash rate, etc. #### Planned Features -* NOMP API - this API be used in several ways. - * The website will use the API to display stats and information about the pool(s) on the portal's front-end website. - * The NOMP Desktop app will use the API to connect to the portal to display a list of available coins to mine and - NOMP server will have to send the desktop app each coin's version-byte so that a wallet (private key & address) can be - generated securely and locally then used to mine on the pool. +* NOMP API - Used by the website to display stats and information about the pool(s) on the portal's front-end website, +and by the NOMP Desktop app to retrieve a list of available coins (and version-bytes for local wallet/address generation). * To reduce variance for pools just starting out which have little to no hashing power a feature is planned which will allow your own pool to connect upstream to a larger pool server. It will request work from the larger pool then @@ -75,6 +72,21 @@ Usage * [Redis](http://redis.io/) key-value store v2.6+ ([follow these instructions](http://redis.io/topics/quickstart)) +#### 0) Setting up coin daemon +Follow the build/install instructions for your coin daemon. Your coin.conf file should end up looking something like this: +``` +daemon=1 +rpcuser=litecoinrpc +rpcpassword=securepassword +rpcport=19332 +``` +For redundancy, its recommended to have at least two daemon instances running in case one drops out-of-sync or offline, +all instances will be polled for block/transaction updates and be used for submitting blocks. Creating a backup daemon +involves spawning a daemon using the "-datadir=/backup" argument which creates a new daemon instance with it's own +config directory and coin.conf file. For more info on this see: + * https://en.bitcoin.it/wiki/Data_directory + * https://en.bitcoin.it/wiki/Running_bitcoind + #### 1) Downloading & Installing Clone the repository and run `npm update` for all the dependencies to be installed: @@ -135,7 +147,6 @@ Here is an example of the required fields: "name": "Litecoin", "symbol": "ltc", "algorithm": "scrypt", //or "sha256", "scrypt-jane", "quark", "x11" - "reward": "POW", //or "POS" "txMessages": false //or true } ```` @@ -274,13 +285,8 @@ Description of options: } }, - /* Recommended to have at least two daemon instances running in case one drops out-of-sync - or offline. For redundancy, all instances will be polled for block/transaction updates - and be used for submitting blocks. Creating a backup daemon involves spawning a daemon - using the "-datadir=/backup" argument which creates a new daemon instance with it's own - RPC config. For more info on this see: - - https://en.bitcoin.it/wiki/Data_directory - - https://en.bitcoin.it/wiki/Running_bitcoind */ + /* For redundancy, recommended to have at least two daemon instances running in case one + drops out-of-sync or offline. */ "daemons": [ { //Main daemon instance "host": "localhost", diff --git a/coins/alphacoin.json b/coins/alphacoin.json index 82c1213..24f3594 100644 --- a/coins/alphacoin.json +++ b/coins/alphacoin.json @@ -2,6 +2,5 @@ "name" : "Alphacoin", "symbol" : "ALF", "algorithm" : "scrypt", - "reward" : "POW", "txMessages" : false } \ No newline at end of file diff --git a/coins/anoncoin.json b/coins/anoncoin.json index be315db..bd917fc 100644 --- a/coins/anoncoin.json +++ b/coins/anoncoin.json @@ -2,6 +2,5 @@ "name" : "Anoncoin", "symbol" : "ANC", "algorithm" : "scrypt", - "reward" : "POW", "txMessages" : false } \ No newline at end of file diff --git a/coins/auroracoin.json b/coins/auroracoin.json index 1427596..172acd5 100644 --- a/coins/auroracoin.json +++ b/coins/auroracoin.json @@ -2,6 +2,5 @@ "name" : "Auroracoin", "symbol" : "AUR", "algorithm" : "scrypt", - "reward" : "POW", "txMessages" : false } \ No newline at end of file diff --git a/coins/bitcoin.json b/coins/bitcoin.json index d50db3d..e3870ef 100644 --- a/coins/bitcoin.json +++ b/coins/bitcoin.json @@ -2,6 +2,5 @@ "name": "Bitcoin", "symbol": "btc", "algorithm": "sha256", - "reward": "POW", "txMessages": false } \ No newline at end of file diff --git a/coins/bottlecaps.json b/coins/bottlecaps.json index e62cdb7..da29c1b 100644 --- a/coins/bottlecaps.json +++ b/coins/bottlecaps.json @@ -2,6 +2,5 @@ "name" : "Bottlecaps", "symbol" : "CAP", "algorithm" : "scrypt", - "reward" : "POS", "txMessages" : false } \ No newline at end of file diff --git a/coins/casinocoin.json b/coins/casinocoin.json index f513819..b6b8e8b 100644 --- a/coins/casinocoin.json +++ b/coins/casinocoin.json @@ -2,6 +2,5 @@ "name" : "Casinocoin", "symbol" : "CSC", "algorithm" : "scrypt", - "reward" : "POW", "txMessages" : false } \ No newline at end of file diff --git a/coins/catcoin.json b/coins/catcoin.json index cdf24b4..b03af91 100644 --- a/coins/catcoin.json +++ b/coins/catcoin.json @@ -2,6 +2,5 @@ "name" : "Catcoin", "symbol" : "CAT", "algorithm" : "scrypt", - "reward" : "POW", "txMessages" : false } \ No newline at end of file diff --git a/coins/darkcoin.json b/coins/darkcoin.json index cecede4..3120964 100644 --- a/coins/darkcoin.json +++ b/coins/darkcoin.json @@ -2,6 +2,5 @@ "name": "Darkcoin", "symbol": "drk", "algorithm": "x11", - "reward": "POW", "txMessages": false } \ No newline at end of file diff --git a/coins/diamondcoin.json b/coins/diamondcoin.json index d379cd0..838bc96 100644 --- a/coins/diamondcoin.json +++ b/coins/diamondcoin.json @@ -2,6 +2,5 @@ "name" : "Diamondcoin", "symbol" : "DMD", "algorithm" : "scrypt", - "reward" : "POS", "txMessages" : true } \ No newline at end of file diff --git a/coins/digibyte.json b/coins/digibyte.json index 218224e..ef0333d 100644 --- a/coins/digibyte.json +++ b/coins/digibyte.json @@ -2,6 +2,5 @@ "name" : "Digibyte", "symbol" : "DGB", "algorithm" : "scrypt", - "reward" : "POW", "txMessages" : false } \ No newline at end of file diff --git a/coins/dogecoin.json b/coins/dogecoin.json index 5d28a36..f0aa6c8 100644 --- a/coins/dogecoin.json +++ b/coins/dogecoin.json @@ -2,6 +2,5 @@ "name" : "Dogecoin", "symbol" : "DOGE", "algorithm" : "scrypt", - "reward" : "POW", "txMessages" : false } \ No newline at end of file diff --git a/coins/earthcoin.json b/coins/earthcoin.json index 153f48a..4aabbb3 100644 --- a/coins/earthcoin.json +++ b/coins/earthcoin.json @@ -2,6 +2,5 @@ "name" : "Earthcoin", "symbol" : "EAC", "algorithm" : "scrypt", - "reward" : "POW", "txMessages" : false } \ No newline at end of file diff --git a/coins/elephantcoin.json b/coins/elephantcoin.json index f6c9620..e1c1fdd 100644 --- a/coins/elephantcoin.json +++ b/coins/elephantcoin.json @@ -2,6 +2,5 @@ "name" : "Elephantcoin", "symbol" : "ELP", "algorithm" : "scrypt", - "reward" : "POW", "txMessages" : false } \ No newline at end of file diff --git a/coins/emerald.json b/coins/emerald.json index 9f3df96..49242fa 100644 --- a/coins/emerald.json +++ b/coins/emerald.json @@ -2,6 +2,5 @@ "name" : "Emerald", "symbol" : "EMD", "algorithm" : "scrypt", - "reward" : "POW", "txMessages" : false } \ No newline at end of file diff --git a/coins/ezcoin.json b/coins/ezcoin.json index 30b06ad..8edc861 100644 --- a/coins/ezcoin.json +++ b/coins/ezcoin.json @@ -2,6 +2,5 @@ "name" : "Ezcoin", "symbol" : "EZC", "algorithm" : "scrypt", - "reward" : "POW", "txMessages" : false } \ No newline at end of file diff --git a/coins/fastcoin.json b/coins/fastcoin.json index e64e528..0bf5409 100644 --- a/coins/fastcoin.json +++ b/coins/fastcoin.json @@ -2,6 +2,5 @@ "name" : "Fastcoin", "symbol" : "FST", "algorithm" : "scrypt", - "reward" : "POW", "txMessages" : false } \ No newline at end of file diff --git a/coins/flappycoin.json b/coins/flappycoin.json index 32ccf9a..f6e4a6d 100644 --- a/coins/flappycoin.json +++ b/coins/flappycoin.json @@ -2,6 +2,5 @@ "name" : "Flappycoin", "symbol" : "FLAP", "algorithm" : "scrypt", - "reward" : "POW", "txMessages" : false } \ No newline at end of file diff --git a/coins/florincoin.json b/coins/florincoin.json index 5fd8d28..0fabdcb 100644 --- a/coins/florincoin.json +++ b/coins/florincoin.json @@ -2,6 +2,5 @@ "name" : "Florincoin", "symbol" : "FLO", "algorithm" : "scrypt", - "reward" : "POW", "txMessages" : true } \ No newline at end of file diff --git a/coins/frankocoin.json b/coins/frankocoin.json index 2836f27..a649419 100644 --- a/coins/frankocoin.json +++ b/coins/frankocoin.json @@ -2,6 +2,5 @@ "name" : "Frankocoin", "symbol" : "FRK", "algorithm" : "scrypt", - "reward" : "POW", "txMessages" : false } \ No newline at end of file diff --git a/coins/galaxycoin.json b/coins/galaxycoin.json index b3c59c8..8e95913 100644 --- a/coins/galaxycoin.json +++ b/coins/galaxycoin.json @@ -2,6 +2,5 @@ "name" : "Galaxycoin", "symbol" : "GLX", "algorithm" : "scrypt", - "reward" : "POS", "txMessages" : false } \ No newline at end of file diff --git a/coins/gamecoin.json b/coins/gamecoin.json index 122c5e2..a7dc73b 100644 --- a/coins/gamecoin.json +++ b/coins/gamecoin.json @@ -2,6 +2,5 @@ "name" : "Gamecoin", "symbol" : "GME", "algorithm" : "scrypt", - "reward" : "POW", "txMessages" : false } \ No newline at end of file diff --git a/coins/hobonickels.json b/coins/hobonickels.json new file mode 100644 index 0000000..b7eb3fb --- /dev/null +++ b/coins/hobonickels.json @@ -0,0 +1,6 @@ +{ + "name" : "Hobonickels", + "symbol" : "HBN", + "algorithm" : "scrypt", + "txMessages" : false +} \ No newline at end of file diff --git a/coins/junkcoin.json b/coins/junkcoin.json index 9ea8bb7..fe4f8db 100644 --- a/coins/junkcoin.json +++ b/coins/junkcoin.json @@ -2,6 +2,5 @@ "name" : "Junkcoin", "symbol" : "JKC", "algorithm" : "scrypt", - "reward" : "POW", "txMessages" : false } \ No newline at end of file diff --git a/coins/kittehcoin.json b/coins/kittehcoin.json index 8a83fff..cf4d776 100644 --- a/coins/kittehcoin.json +++ b/coins/kittehcoin.json @@ -2,6 +2,5 @@ "name" : "Kittehcoin", "symbol" : "MEOW", "algorithm" : "scrypt", - "reward" : "POW", "txMessages" : false } \ No newline at end of file diff --git a/coins/krugercoin.json b/coins/krugercoin.json index b740fc1..7d9a07b 100644 --- a/coins/krugercoin.json +++ b/coins/krugercoin.json @@ -2,6 +2,5 @@ "name" : "Krugercoin", "symbol" : "KGC", "algorithm" : "scrypt", - "reward" : "POW", "txMessages" : false } \ No newline at end of file diff --git a/coins/litecoin.json b/coins/litecoin.json index 1b28960..536be58 100644 --- a/coins/litecoin.json +++ b/coins/litecoin.json @@ -2,6 +2,5 @@ "name" : "Litecoin", "symbol" : "LTC", "algorithm" : "scrypt", - "reward" : "POW", "txMessages" : false } \ No newline at end of file diff --git a/coins/lottocoin.json b/coins/lottocoin.json index f815453..25d33a0 100644 --- a/coins/lottocoin.json +++ b/coins/lottocoin.json @@ -2,6 +2,5 @@ "name" : "Lottocoin", "symbol" : "LOT", "algorithm" : "scrypt", - "reward" : "POW", "txMessages" : false } \ No newline at end of file diff --git a/coins/luckycoin.json b/coins/luckycoin.json index 8c55231..213986b 100644 --- a/coins/luckycoin.json +++ b/coins/luckycoin.json @@ -2,6 +2,5 @@ "name" : "Luckycoin", "symbol" : "LKY", "algorithm" : "scrypt", - "reward" : "POW", "txMessages" : false } \ No newline at end of file diff --git a/coins/memecoin.json b/coins/memecoin.json index 7a80316..566de59 100644 --- a/coins/memecoin.json +++ b/coins/memecoin.json @@ -2,6 +2,5 @@ "name" : "Memecoin", "symbol" : "MEM", "algorithm" : "scrypt", - "reward" : "POW", "txMessages" : false } \ No newline at end of file diff --git a/coins/neocoin.json b/coins/neocoin.json index 14998c1..316a6f2 100644 --- a/coins/neocoin.json +++ b/coins/neocoin.json @@ -2,6 +2,5 @@ "name" : "Neocoin", "symbol" : "NEC", "algorithm" : "scrypt", - "reward" : "POS", "txMessages" : true } \ No newline at end of file diff --git a/coins/netcoin.json b/coins/netcoin.json index 5f580eb..4554a73 100644 --- a/coins/netcoin.json +++ b/coins/netcoin.json @@ -2,6 +2,5 @@ "name" : "Netcoin", "symbol" : "NET", "algorithm" : "scrypt", - "reward" : "POW", "txMessages" : true } \ No newline at end of file diff --git a/coins/noirbits.json b/coins/noirbits.json index 09a81cd..e540b95 100644 --- a/coins/noirbits.json +++ b/coins/noirbits.json @@ -2,6 +2,5 @@ "name" : "Noirbits", "symbol" : "NRB", "algorithm" : "scrypt", - "reward" : "POW", "txMessages" : false } \ No newline at end of file diff --git a/coins/peercoin.json b/coins/peercoin.json index 6485731..428bbad 100644 --- a/coins/peercoin.json +++ b/coins/peercoin.json @@ -2,6 +2,5 @@ "name": "Peercoin", "symbol": "ppc", "algorithm": "sha256", - "reward": "POS", "txMessages": false } \ No newline at end of file diff --git a/coins/phoenixcoin.json b/coins/phoenixcoin.json index a4bcf74..9e3695c 100644 --- a/coins/phoenixcoin.json +++ b/coins/phoenixcoin.json @@ -2,6 +2,5 @@ "name" : "Phoenixcoin", "symbol" : "PXC", "algorithm" : "scrypt", - "reward" : "POW", "txMessages" : false } \ No newline at end of file diff --git a/coins/quarkcoin.json b/coins/quarkcoin.json index 660142f..597aeb3 100644 --- a/coins/quarkcoin.json +++ b/coins/quarkcoin.json @@ -2,6 +2,5 @@ "name": "Quarkcoin", "symbol": "qrk", "algorithm": "quark", - "reward": "POW", "txMessages": false } \ No newline at end of file diff --git a/coins/reddcoin.json b/coins/reddcoin.json index 402227d..29a017a 100644 --- a/coins/reddcoin.json +++ b/coins/reddcoin.json @@ -2,6 +2,5 @@ "name" : "Reddcoin", "symbol" : "REDD", "algorithm" : "scrypt", - "reward" : "POW", "txMessages" : false } \ No newline at end of file diff --git a/coins/sexcoin.json b/coins/sexcoin.json index 88d1389..a558019 100644 --- a/coins/sexcoin.json +++ b/coins/sexcoin.json @@ -2,6 +2,5 @@ "name" : "Sexcoin", "symbol" : "SXC", "algorithm" : "scrypt", - "reward" : "POW", "txMessages" : false } \ No newline at end of file diff --git a/coins/skeincoin.json b/coins/skeincoin.json index cff9be6..31479be 100644 --- a/coins/skeincoin.json +++ b/coins/skeincoin.json @@ -2,6 +2,5 @@ "name": "Skeincoin", "symbol": "skc", "algorithm": "skein", - "reward": "POW", "txMessages": false } \ No newline at end of file diff --git a/coins/spots.json b/coins/spots.json index ac0eaac..8130747 100644 --- a/coins/spots.json +++ b/coins/spots.json @@ -2,6 +2,5 @@ "name" : "Spots", "symbol" : "SPT", "algorithm" : "scrypt", - "reward" : "POW", "txMessages" : false } \ No newline at end of file diff --git a/coins/stablecoin.json b/coins/stablecoin.json index 5190e7e..404e28a 100644 --- a/coins/stablecoin.json +++ b/coins/stablecoin.json @@ -2,6 +2,5 @@ "name" : "Stablecoin", "symbol" : "SBC", "algorithm" : "scrypt", - "reward" : "POW", "txMessages" : false } \ No newline at end of file diff --git a/coins/xencoin.json b/coins/xencoin.json index f6b4d15..d961dd2 100644 --- a/coins/xencoin.json +++ b/coins/xencoin.json @@ -2,6 +2,5 @@ "name" : "Xencoin", "symbol" : "XNC", "algorithm" : "scrypt", - "reward" : "POW", "txMessages" : false } \ No newline at end of file diff --git a/coins/yacoin.json b/coins/yacoin.json index b4a0422..932d8ce 100644 --- a/coins/yacoin.json +++ b/coins/yacoin.json @@ -2,6 +2,5 @@ "name": "Yacoin", "symbol": "yac", "algorithm": "scrypt-jane", - "reward": "POS", "txMessages": false } \ No newline at end of file diff --git a/init.js b/init.js index 0564329..4b7870b 100644 --- a/init.js +++ b/init.js @@ -109,10 +109,10 @@ var spawnPoolWorkers = function(portalConfig, poolConfigs){ var createPoolWorker = function(forkId){ var worker = cluster.fork({ - workerType : 'pool', - forkId : forkId, - pools : serializedConfigs, - portalConfig : JSON.stringify(portalConfig) + workerType: 'pool', + forkId: forkId, + pools: serializedConfigs, + portalConfig: JSON.stringify(portalConfig) }); worker.on('exit', function(code, signal){ logger.error('Master', 'PoolSpanwer', 'Fork ' + forkId + ' died, spawning replacement worker...'); diff --git a/libs/paymentProcessor.js b/libs/paymentProcessor.js index f503d0d..b0b391e 100644 --- a/libs/paymentProcessor.js +++ b/libs/paymentProcessor.js @@ -34,7 +34,7 @@ function SetupForPool(logger, poolOptions){ logger.debug(logSystem, logComponent, 'Connected to daemon for payment processing'); daemon.cmd('validateaddress', [poolOptions.address], function(result){ - if (!result[0].response.ismine){ + if (!result[0].response || !result[0].response.ismine){ logger.error(logSystem, logComponent, 'Daemon does not own pool address - payment processing can not be done with this daemon'); } }); diff --git a/libs/poolWorker.js b/libs/poolWorker.js index 7a5b438..dd39636 100644 --- a/libs/poolWorker.js +++ b/libs/poolWorker.js @@ -119,13 +119,16 @@ module.exports = function(logger){ if (data.solution && !isValidBlock) logger.debug(logSystem, logComponent, logSubCat, 'We thought a block solution was found but it was rejected by the daemon, share data: ' + shareData); + else if (isValidBlock) logger.debug(logSystem, logComponent, logSubCat, 'Block solution found: ' + data.solution); + if (isValidShare) - logger.debug(logSystem, logComponent, logSubCat, 'Valid share diff of ' + data.difficultiy + ' submitted by worker ' + data.worker + ' [ ' + data.ip + ']' ); + logger.debug(logSystem, logComponent, logSubCat, 'Valid share of difficulty ' + data.difficulty + ' by ' + data.worker + ' [' + data.ip + ']' ); + else if (!isValidShare) - logger.debug(logSystem, logComponent, logSubCat, 'Invalid share submitted, share data: ' + shareData) + logger.debug(logSystem, logComponent, logSubCat, 'Invalid share submitted, share data: ' + shareData); handlers.share(isValidShare, isValidBlock, data)