Update dev branch (#598)

* modified for my repositry

* Revert

* add lf

* Fixed bug in parsing balances for payment processing

* Added fixminer.com pool

* New pool

Another one using NOMP

* Update 21coin.json

Added peerMagic needed for p2p block notifications

* Update alphacoin.json

Added peerMagic. Needed for p2p block notifications

* Update benjamins.json

Added peerMagic for p2p block notifications

* Update mazacoin.json

Added peerMagic for p2p block notifications

* Update bottlecaps.json

* Update bottlecaps.json

* Create bunnycoin.json

* Update bunnycoin.json

* Update casinocoin.json

* Create coino.json

* Update coino.json

* Create cryptogenicbullion.json

* Update coino.json

* Update bunnycoin.json

* Update cryptogenicbullion.json

* Create cryptographicanomaly.json

* Update cryptographicanomaly.json

* Update cryptographicanomaly.json

* Fix switching port showing

Fix reading of config file to show active switching ports

* Update alphacoin.json

* Update README.md

fixed typo on line 529 node-statum-pool to node-stratum-pool

* Update README.md

* Valid json to Readme example coin conf

* Minor readme change

* Marked emark as POS type coin since auto detection fails

* created infinitecoin.conf

Adding infinitecoin.conf to the coin list.
https://github.com/infinitecoin/infinitecoin/blob/master/src/main.cpp#L2524

* fixed capitolization

Adjusted InfiniteCoin to Infinitecoin to match the naming practice of all the other coins.

* update symbol for Coino

* Wrong hashrate calculation

Hashes are not bytes:
> 1 byte = 8 bits
> 1 kilobyte = 1024 bytes

Hashes are the units, and so therefore - as `k`,  `m` only mean *10^3 and *10^6
> 1 hash = 1 hash
> 1 kh     = 1000 hashes

* Add Viacoin support

Support for Viacoin - viacoin.org

* Add FlutterCoin to coins

* Rename viacoin.conf to viacoin.json

* 42 coin

* Update poolWorker.js

var created above is spelled as initalPool not initialPool.

* http://poollo.com "service unavailable"

* Removed the links to dead pools

* http://poollo.com
* http://fixminer.com
* http://pool.trademybit.com/ (all wallets disabled)
* http://www.omargpools.ca/pools.html (dead link)
* http://mining.theminingpools.com (now called "ad depo", no sign of a mining pool).
* http://minr.es (dead link)
* http://onebtcplace.com (link leads nowhere)
* http://uberpools.org (Apache Test Page)
* http://miningwith.us (domain for sale)
* http://teamdoge.com (blank page)
* http://rapidhash.net (domain for sale)
* http://chunkypools.com

Left these three. Are they still nomp?
* http://miningpoolhub.com (Donations to this project are going directly to TheSerapher, the original author of this project. (https://github.com/MPOS/php-mpos) ###
* http://hashfaster.com (MPOS, sign up) ###
* http://suchpool.pw ###

* Removed " LiveChains UK offers full hosting, setup and management of NOMP pools with several different configurations. [...] LiveChains UK however does offer this feature as part of there own customised NOMP called LivePool." Paid Solution." from 'Paid  Solution'. The  company no longer exists and the links lead to a generic type of forum about software.

* Added some log info and fixed a typo

* Pinned some package versions - included async package

Should fix https://github.com/zone117x/node-open-mining-portal/pull/479

* Update litecoin testnet magic

Litecoin testnet has been reset

2fcf8079ef (diff-64cbe1ad5465e13bc59ee8bb6f3de2e7R207)

* fix orphan stat source

* API does not set the proper header

* Update api.js

Fix : #554

* Update package.json

Pin request npm package version

* Update README.md

* Update README.md

* Updated to new Core 0.16 Format (getaddressinfo)

Since the new Wallet release of Bitcoin Core, they introduced a new Validation format for addresses.
Validateaddress is not longer working.

* Update paymentProcessor.js

* Final change

* Added GLT Coin

* add peer magic for DGB (#592)
This commit is contained in:
Matthew Little 2018-05-13 14:02:08 -07:00 committed by GitHub
parent 8a725c0438
commit 67254f63ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
30 changed files with 166 additions and 51 deletions

View File

@ -1,3 +1,8 @@
## This repo is looking for maintainers! Please reach out if interested.
--------
# NOMP ![NOMP Logo](http://zone117x.github.io/node-open-mining-portal/logo.svg "NOMP Logo")
#### Node Open Mining Portal
@ -8,6 +13,12 @@ responsive user-friendly front-end website featuring mining instructions, in-dep
#### Production Usage Notice
This is beta software. All of the following are things that can change and break an existing NOMP setup: functionality of any feature, structure of configuration files and structure of redis data. If you use this software in production then *DO NOT* pull new code straight into production usage because it can and often will break your setup and require you to tweak things like config files or redis data.
#### Paid Solution
Usage of this software requires abilities with sysadmin, database admin, coin daemons, and sometimes a bit of programming. Running a production pool can literally be more work than a full-time job.
**Coin switching & auto-exchanging for payouts in BTC/LTC** to miners is a feature that very likely will not be included in this project.
#### Table of Contents
* [Features](#features)
@ -104,21 +115,13 @@ didn't follow the instructions in this README. Please __read the usage instructi
If your pool uses NOMP let us know and we will list your website here.
##### Some pools using NOMP or node-stratum-module:
* http://chunkypools.com
* http://clevermining.com
* http://rapidhash.net
* http://suchpool.pw
* http://hashfaster.com
* http://miningpoolhub.com
* http://teamdoge.com
* http://miningwith.us
* http://kryptochaos.com
* http://uberpools.org
* http://onebtcplace.com
* http://minr.es
* http://mining.theminingpools.com
* http://www.omargpools.ca/pools.html
* http://pool.trademybit.com/
* http://miningpools.tk
* http://umine.co.uk
Usage
=====
@ -348,7 +351,7 @@ Here is an example of the required fields:
source code as the pchMessageStart variable.
For example, litecoin mainnet magic: http://git.io/Bi8YFw
And for litecoin testnet magic: http://git.io/NXBYJA */
"peerMagic": "fbc0b6db" //optional
"peerMagic": "fbc0b6db", //optional
"peerMagicTestnet": "fcc1b7dc" //optional
//"txMessages": false, //options - defaults to false
@ -524,7 +527,7 @@ output from NOMP.
#### Upgrading NOMP
When updating NOMP to the latest code its important to not only `git pull` the latest from this repo, but to also update
the `node-statum-pool` and `node-multi-hashing` modules, and any config files that may have been changed.
the `node-stratum-pool` and `node-multi-hashing` modules, and any config files that may have been changed.
* Inside your NOMP directory (where the init.js script is) do `git pull` to get the latest NOMP code.
* Remove the dependenices by deleting the `node_modules` directory with `rm -r node_modules`.
* Run `npm update` to force updating/reinstalling of the dependencies.

View File

@ -1,5 +1,7 @@
{
"name": "21coin",
"symbol": "21",
"algorithm": "sha256"
"algorithm": "sha256", ·····································
"peerMagic": "21212121", ·····································
"peerMagicTestnet": "01fefe05"
}

5
coins/42.json Normal file
View File

@ -0,0 +1,5 @@
{
"name": "42",
"symbol": "42",
"algorithm": "scrypt"
}

View File

@ -1,5 +1,7 @@
{
"name": "Alphacoin",
"symbol": "ALF",
"algorithm": "scrypt"
}
"algorithm": "scrypt",
"peerMagic": "fbc0b6db",
"peerMagicTestnet": "fcc1b7dc"
}

View File

@ -1,5 +1,7 @@
{
"name": "Benjamins",
"symbol": "BEN",
"algorithm": "sha256"
"algorithm": "sha256",
"peerMagic": "de698778", ·····································
"peerMagicTestnet": "0b110907"
}

View File

@ -1,5 +1,7 @@
{
"name": "Bottlecaps",
"symbol": "CAP",
"algorithm": "scrypt"
}
"algorithm": "scrypt",
"peerMagic": "e4e8e9e5",
"peerMagicTestnet": "cdf2c0ef"
}

7
coins/bunnycoin.json Normal file
View File

@ -0,0 +1,7 @@
{
"name": "BunnyCoin",
"symbol": "BUN",
"algorithm": "scrypt",
"peerMagic": "c0c0c0c0",
"peerMagicTestnet": "fcc1b7dc"
}

View File

@ -1,5 +1,7 @@
{
"name": "Casinocoin",
"symbol": "CSC",
"algorithm": "scrypt"
}
"algorithm": "scrypt",
"peerMagic": "fac3b6da",
"peerMagicTestnet": "fcc1b7dc"
}

7
coins/coino.json Normal file
View File

@ -0,0 +1,7 @@
{
"name": "Coino",
"symbol": "COINO",
"algorithm": "scrypt",
"peerMagic": "f1d1a7d8",
"peerMagicTestnet": "fcc1b7dc"
}

View File

@ -0,0 +1,7 @@
{
"name": "CryptogenicBullion",
"symbol": "CGB",
"algorithm": "scrypt",
"peerMagic": "e4e8e9e5",
"peerMagicTestnet": "cdf2c0ef"
}

View File

@ -0,0 +1,7 @@
{
"name": "CryptographicAnomaly",
"symbol": "CGA",
"algorithm": "scrypt",
"peerMagic": "fbc0b6db",
"peerMagicTestnet": "fcc1b7dc"
}

View File

@ -1,5 +1,7 @@
{
"name": "Digibyte",
"symbol": "DGB",
"algorithm": "scrypt"
"algorithm": "scrypt",
"peerMagic": "fac3b6da",
"peerMagicTestnet": "fdc8bddd"
}

View File

@ -1,5 +1,6 @@
{
"name": "eMark",
"symbol": "DEM",
"algorithm": "sha256"
"algorithm": "sha256",
"reward": "POS"
}

5
coins/fluttercoin.json Normal file
View File

@ -0,0 +1,5 @@
{
"name": "FlutterCoin",
"symbol": "FLT",
"algorithm": "scrypt"
}

7
coins/globaltoken.json Normal file
View File

@ -0,0 +1,7 @@
{
"name": "GlobalToken",
"symbol": "GLT",
"algorithm": "sha256",
"peerMagic": "c708d32d",
"peerMagicTestnet": "3a6f375b"
}

7
coins/infinitecoin.conf Normal file
View File

@ -0,0 +1,7 @@
{
"name": "Infinitecoin",
"symbol": "IFC",
"algorithm": "scrypt",
"peerMagic": "fbc0b6db",
"peerMagicTestnet": "fcc1b7dc"
}

6
coins/kumacoin.json Normal file
View File

@ -0,0 +1,6 @@
{
"name": "Kumacoin",
"symbol": "KUMA",
"algorithm": "quark",
"mposDiffMultiplier": 256
}

View File

@ -3,5 +3,5 @@
"symbol": "LTC",
"algorithm": "scrypt",
"peerMagic": "fbc0b6db",
"peerMagicTestnet": "fcc1b7dc"
}
"peerMagicTestnet": "fdd2c8f1"
}

View File

@ -1,5 +1,7 @@
{
"name": "Mazacoin",
"symbol": "MZC",
"algorithm": "sha256"
"algorithm": "sha256",
"peerMagic": "f8b503df", ·····································
"peerMagicTestnet": "05fea901"
}

5
coins/monacoin.json Normal file
View File

@ -0,0 +1,5 @@
{
"name": "Monacoin",
"symbol": "MONA",
"algorithm": "scrypt"
}

5
coins/sayacoin.json Normal file
View File

@ -0,0 +1,5 @@
{
"name": "Sayacoin",
"symbol": "SYC",
"algorithm": "sha256"
}

5
coins/sha1coin.json Normal file
View File

@ -0,0 +1,5 @@
{
"name": "Sha1coin",
"symbol": "SHA",
"algorithm": "sha1coin"
}

7
coins/viacoin.json Normal file
View File

@ -0,0 +1,7 @@
{
"name": "Viacoin",
"symbol": "VIA",
"algorithm": "scrypt",
"peerMagic": "0f68c6cb",
"peerMagicTestnet": "a9c5ef92"
}

View File

@ -15,9 +15,11 @@ module.exports = function(logger, portalConfig, poolConfigs){
this.handleApiRequest = function(req, res, next){
switch(req.params.method){
case 'stats':
res.writeHead(200, { 'Content-Type': 'application/json' });
res.end(portalStats.statsString);
return;
case 'pool_stats':
res.writeHead(200, { 'Content-Type': 'application/json' });
res.end(JSON.stringify(portalStats.statPoolHistory));
return;
case 'live_stats':
@ -51,4 +53,4 @@ module.exports = function(logger, portalConfig, poolConfigs){
}
};
};
};

View File

@ -70,10 +70,21 @@ function SetupForPool(logger, poolOptions, setupFinished){
callback(true);
}
else if (!result.response || !result.response.ismine) {
logger.error(logSystem, logComponent,
'Daemon does not own pool address - payment processing can not be done with this daemon, '
+ JSON.stringify(result.response));
callback(true);
daemon.cmd('getaddressinfo', [poolOptions.address], function(result) {
if (result.error){
logger.error(logSystem, logComponent, 'Error with payment processing daemon, getaddressinfo failed ... ' + JSON.stringify(result.error));
callback(true);
}
else if (!result.response || !result.response.ismine) {
logger.error(logSystem, logComponent,
'Daemon does not own pool address - payment processing can not be done with this daemon, '
+ JSON.stringify(result.response));
callback(true);
}
else{
callback()
}
}, true);
}
else{
callback()
@ -169,7 +180,7 @@ function SetupForPool(logger, poolOptions, setupFinished){
var workers = {};
for (var w in results[0]){
workers[w] = {balance: coinsToSatoshies(parseInt(results[0][w]))};
workers[w] = {balance: coinsToSatoshies(parseFloat(results[0][w]))};
}
var rounds = results[1].map(function(r){

View File

@ -217,12 +217,16 @@ module.exports = function(logger){
logger.debug(logSystem, logComponent, logSubCat, 'We thought a block was found but it was rejected by the daemon, share data: ' + shareData);
else if (isValidBlock)
logger.debug(logSystem, logComponent, logSubCat, 'Block found: ' + data.blockHash);
logger.debug(logSystem, logComponent, logSubCat, 'Block found: ' + data.blockHash + ' by ' + data.worker);
if (isValidShare)
if (isValidShare) {
if(data.shareDiff > 1000000000)
logger.debug(logSystem, logComponent, logSubCat, 'Share was found with diff higher than 1.000.000.000!');
else if(data.shareDiff > 1000000)
logger.debug(logSystem, logComponent, logSubCat, 'Share was found with diff higher than 1.000.000!');
logger.debug(logSystem, logComponent, logSubCat, 'Share accepted at diff ' + data.difficulty + '/' + data.shareDiff + ' by ' + data.worker + ' [' + data.ip + ']' );
else if (!isValidShare)
} else if (!isValidShare)
logger.debug(logSystem, logComponent, logSubCat, 'Share rejected: ' + shareData);
handlers.share(isValidShare, isValidBlock, data)
@ -306,7 +310,7 @@ module.exports = function(logger){
if (pools[currentPool])
pools[currentPool].getStratumServer().handleNewClient(socket);
else
pools[initialPool].getStratumServer().handleNewClient(socket);
pools[initalPool].getStratumServer().handleNewClient(socket);
}).listen(parseInt(port), function() {
logger.debug(logSystem, logComponent, logSubCat, 'Switching "' + switchName

View File

@ -36,7 +36,7 @@ module.exports = function(logger, portalConfig, poolConfig, singleCoinPayoutPort
logger.error(logSystem, logComponent, logSubCat, 'Redis client had an error: ' + JSON.stringify(err))
});
connection.on('end', function(){
logger.error(logSystem, logComponent, logSubCat, 'Connection to redis database as been ended');
logger.error(logSystem, logComponent, logSubCat, 'Connection to redis database has been ended');
});
connection.info(function(error, response){

View File

@ -114,7 +114,7 @@ module.exports = function(logger, portalConfig, poolConfigs){
['hgetall', ':stats'],
['scard', ':blocksPending'],
['scard', ':blocksConfirmed'],
['scard', ':blocksOrphaned']
['scard', ':blocksKicked']
];
var commandsPerCoin = redisCommandTemplates.length;
@ -274,9 +274,9 @@ module.exports = function(logger, portalConfig, poolConfigs){
var i = -1;
var byteUnits = [ ' KH', ' MH', ' GH', ' TH', ' PH' ];
do {
hashrate = hashrate / 1024;
hashrate = hashrate / 1000;
i++;
} while (hashrate > 1024);
} while (hashrate > 1000);
return hashrate.toFixed(2) + byteUnits[i];
};

View File

@ -32,20 +32,20 @@
},
"dependencies": {
"stratum-pool": "git://github.com/zone117x/node-stratum-pool.git",
"dateformat": "*",
"dateformat": "1.0.12",
"node-json-minify": "*",
"redis": "*",
"redis": "0.12.1",
"mysql": "*",
"async": "*",
"async": "1.5.2",
"express": "*",
"body-parser": "*",
"compression": "*",
"dot": "*",
"colors": "*",
"node-watch": "*",
"request": "*",
"request": "2.69.0",
"nonce": "*",
"bignum": "*",
"bignum": "0.12.5",
"extend": "*"
},
"engines": {

View File

@ -185,9 +185,9 @@
<div id="menu">
{{? (function(){
if (!it.portalConfig.proxy) return false;
for (var p in it.portalConfig.proxy){
if (it.portalConfig.proxy[p].enabled)
if (!it.portalConfig.switching) return false;
for (var p in it.portalConfig.switching){
if (it.portalConfig.switching[p].enabled)
return true;
}
return false;
@ -197,14 +197,14 @@
{{?}}
<div class="menuList">
{{ for (var p in it.portalConfig.proxy){
if (!it.portalConfig.proxy[p].enabled) continue;
{{ for (var p in it.portalConfig.switching){
if (!it.portalConfig.switching[p].enabled) continue;
var info = {
algo: p,
ports: {},
host: it.portalConfig.website.stratumHost
};
info.ports[it.portalConfig.proxy[p].port] = {diff: it.portalConfig.proxy[p].diff};
info.ports[it.portalConfig.switching[p].port] = {diff: it.portalConfig.switching[p].diff};
info = JSON.stringify(info).replace(/"/g, '&quot;');
}}
<a href="#" class="poolOption" data-info="{{=info}}">{{=p}}</a>
@ -315,4 +315,4 @@
alert('NOMP App development still in progress...');
return false;
});
</script>
</script>