Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not working #682

Open
wants to merge 18 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ node_modules/
config.json
pool_configs/*.json
!pool_configs/litecoin_example.json
!pool_configs/cpuchain_example.json
29 changes: 8 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,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)
Expand Down Expand Up @@ -101,25 +107,6 @@ Join our subreddit [/r/nomp](http://reddit.com/r/nomp)!
*Having problems getting the portal running due to some module dependency error?* It's probably because you
didn't follow the instructions in this README. Please __read the usage instructions__ including [requirements](#requirements) and [downloading/installing](#1-downloading--installing). If you've followed the instructions completely and are still having problems then open an issue here on github or join our #nomp IRC channel and explain your problem :).

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/

Usage
=====

Expand Down Expand Up @@ -348,7 +335,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
Expand Down Expand Up @@ -524,7 +511,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.
Expand Down
25 changes: 25 additions & 0 deletions coins/00_example.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "Example",
"symbol": "EXM",
"algorithm": "x99",
"peerMagic": "0f0f0f0f",
"peerMagicTestnet": "f0f0f0f0",

"mainnet": {
"bech32": "ex",
"bip32": {
"public": "0f0f0f0f"
},
"pubKeyHash": "00",
"scriptHash": "ff"
},

"testnet": {
"bech32": "tex",
"bip32": {
"public": "f0f0f0f0"
},
"pubKeyHash": "0f",
"scriptHash": "f0"
}
}
4 changes: 3 additions & 1 deletion coins/21coin.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"name": "21coin",
"symbol": "21",
"algorithm": "sha256"
"algorithm": "sha256", │·····································
"peerMagic": "21212121", │·····································
"peerMagicTestnet": "01fefe05"
}
5 changes: 5 additions & 0 deletions coins/42.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "42",
"symbol": "42",
"algorithm": "scrypt"
}
6 changes: 4 additions & 2 deletions coins/alphacoin.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"name": "Alphacoin",
"symbol": "ALF",
"algorithm": "scrypt"
}
"algorithm": "scrypt",
"peerMagic": "fbc0b6db",
"peerMagicTestnet": "fcc1b7dc"
}
4 changes: 3 additions & 1 deletion coins/benjamins.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"name": "Benjamins",
"symbol": "BEN",
"algorithm": "sha256"
"algorithm": "sha256",
"peerMagic": "de698778", │·····································
"peerMagicTestnet": "0b110907"
}
6 changes: 4 additions & 2 deletions coins/bottlecaps.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"name": "Bottlecaps",
"symbol": "CAP",
"algorithm": "scrypt"
}
"algorithm": "scrypt",
"peerMagic": "e4e8e9e5",
"peerMagicTestnet": "cdf2c0ef"
}
7 changes: 7 additions & 0 deletions coins/bunnycoin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "BunnyCoin",
"symbol": "BUN",
"algorithm": "scrypt",
"peerMagic": "c0c0c0c0",
"peerMagicTestnet": "fcc1b7dc"
}
6 changes: 4 additions & 2 deletions coins/casinocoin.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"name": "Casinocoin",
"symbol": "CSC",
"algorithm": "scrypt"
}
"algorithm": "scrypt",
"peerMagic": "fac3b6da",
"peerMagicTestnet": "fcc1b7dc"
}
25 changes: 25 additions & 0 deletions coins/chaincoin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "Chaincoin",
"symbol": "CHC",
"algorithm": "c11",
"peerMagic": "a3d27a03",
"peerMagicTestnet": "fbc21102",

"mainnet": {
"bech32": "chc",
"bip32": {
"public": "0488b21e"
},
"pubKeyHash": "1c",
"scriptHash": "04"
},

"testnet": {
"bech32": "tchc",
"bip32": {
"public": "043587cf"
},
"pubKeyHash": "50",
"scriptHash": "2c"
}
}
7 changes: 7 additions & 0 deletions coins/coino.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "Coino",
"symbol": "COINO",
"algorithm": "scrypt",
"peerMagic": "f1d1a7d8",
"peerMagicTestnet": "fcc1b7dc"
}
16 changes: 16 additions & 0 deletions coins/cpuchain.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "CPUchain",
"symbol": "CPU",
"algorithm": "cpupower",
"peerMagic": "deadbeef",
"peerMagicTestnet": "faceb00c",

"mainnet": {
"bech32": "cpu",
"bip32": {
"public": "0488B21E"
},
"pubKeyHash": "1C",
"scriptHash": "1E"
}
}
7 changes: 7 additions & 0 deletions coins/cryptogenicbullion.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "CryptogenicBullion",
"symbol": "CGB",
"algorithm": "scrypt",
"peerMagic": "e4e8e9e5",
"peerMagicTestnet": "cdf2c0ef"
}
7 changes: 7 additions & 0 deletions coins/cryptographicanomaly.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "CryptographicAnomaly",
"symbol": "CGA",
"algorithm": "scrypt",
"peerMagic": "fbc0b6db",
"peerMagicTestnet": "fcc1b7dc"
}
4 changes: 3 additions & 1 deletion coins/digibyte.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"name": "Digibyte",
"symbol": "DGB",
"algorithm": "scrypt"
"algorithm": "scrypt",
"peerMagic": "fac3b6da",
"peerMagicTestnet": "fdc8bddd"
}
3 changes: 2 additions & 1 deletion coins/emark.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "eMark",
"symbol": "DEM",
"algorithm": "sha256"
"algorithm": "sha256",
"reward": "POS"
}
5 changes: 5 additions & 0 deletions coins/fluttercoin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "FlutterCoin",
"symbol": "FLT",
"algorithm": "scrypt"
}
7 changes: 7 additions & 0 deletions coins/globaltoken.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "GlobalToken",
"symbol": "GLT",
"algorithm": "sha256",
"peerMagic": "c708d32d",
"peerMagicTestnet": "3a6f375b"
}
7 changes: 7 additions & 0 deletions coins/infinitecoin.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "Infinitecoin",
"symbol": "IFC",
"algorithm": "scrypt",
"peerMagic": "fbc0b6db",
"peerMagicTestnet": "fcc1b7dc"
}
6 changes: 6 additions & 0 deletions coins/kumacoin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "Kumacoin",
"symbol": "KUMA",
"algorithm": "quark",
"mposDiffMultiplier": 256
}
30 changes: 24 additions & 6 deletions coins/litecoin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,25 @@
{
"name": "Litecoin",
"symbol": "LTC",
"algorithm": "scrypt",
"peerMagic": "fbc0b6db",
"peerMagicTestnet": "fcc1b7dc"
}
"name": "Litecoin",
"symbol": "LTC",
"algorithm": "scrypt",
"peerMagic": "fbc0b6db",
"peerMagicTestnet": "fdd2c8f1",

"mainnet": {
"bech32": "ltc",
"bip32": {
"public": "0488B21E"
},
"pubKeyHash": "30",
"scriptHash": "05"
},

"testnet": {
"bech32": "tltc",
"bip32": {
"public": "043587CF"
},
"pubKeyHash": "6F",
"scriptHash": "C4"
}
}
4 changes: 3 additions & 1 deletion coins/mazacoin.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"name": "Mazacoin",
"symbol": "MZC",
"algorithm": "sha256"
"algorithm": "sha256",
"peerMagic": "f8b503df", │·····································
"peerMagicTestnet": "05fea901"
}
5 changes: 5 additions & 0 deletions coins/monacoin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "Monacoin",
"symbol": "MONA",
"algorithm": "scrypt"
}
5 changes: 5 additions & 0 deletions coins/sayacoin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "Sayacoin",
"symbol": "SYC",
"algorithm": "sha256"
}
5 changes: 5 additions & 0 deletions coins/sha1coin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"name": "Sha1coin",
"symbol": "SHA",
"algorithm": "sha1coin"
}
7 changes: 7 additions & 0 deletions coins/viacoin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "Viacoin",
"symbol": "VIA",
"algorithm": "scrypt",
"peerMagic": "0f68c6cb",
"peerMagicTestnet": "a9c5ef92"
}
31 changes: 31 additions & 0 deletions init.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ if (cluster.isWorker){
case 'profitSwitch':
new ProfitSwitch(logger);
break;
case 'switchingPaymentProcessor':
var SwitchingPaymentProcessor = require('./libs/switchingPaymentProcessor.js');
new SwitchingPaymentProcessor(logger);
break;
}

return;
Expand Down Expand Up @@ -143,6 +147,17 @@ var buildPoolConfigs = function(){
var coinProfile = JSON.parse(JSON.minify(fs.readFileSync(coinFilePath, {encoding: 'utf8'})));
poolOptions.coin = coinProfile;
poolOptions.coin.name = poolOptions.coin.name.toLowerCase();
if (coinProfile.mainnet) {
poolOptions.coin.mainnet.bip32.public = Buffer.from(coinProfile.mainnet.bip32.public, 'hex').readUInt32LE(0);
poolOptions.coin.mainnet.pubKeyHash = Buffer.from(coinProfile.mainnet.pubKeyHash, 'hex').readUInt8(0);
poolOptions.coin.mainnet.scriptHash = Buffer.from(coinProfile.mainnet.scriptHash, 'hex').readUInt8(0);
}
if (coinProfile.testnet) {
poolOptions.coin.testnet.bip32.public = Buffer.from(coinProfile.testnet.bip32.public, 'hex').readUInt32LE(0);
poolOptions.coin.testnet.pubKeyHash = Buffer.from(coinProfile.testnet.pubKeyHash, 'hex').readUInt8(0);
poolOptions.coin.testnet.scriptHash = Buffer.from(coinProfile.testnet.scriptHash, 'hex').readUInt8(0);
}


if (poolOptions.coin.name in configs){

Expand Down Expand Up @@ -356,7 +371,21 @@ var processCoinSwitchCommand = function(params, options, reply){

};

var startSwitchingPaymentProcessor = function(){
if (!fs.existsSync('libs/switchingPaymentProcessor.js')) return;

var worker = cluster.fork({
workerType: 'switchingPaymentProcessor',
pools: JSON.stringify(poolConfigs),
portalConfig: JSON.stringify(portalConfig)
});
worker.on('exit', function(code, signal){
logger.error('Master', 'Switching Payment Processor', 'Died, spawning replacement...');
setTimeout(function(){
startSwitchingPaymentProcessor();
}, 2000);
});
};

var startPaymentProcessor = function(){

Expand Down Expand Up @@ -434,6 +463,8 @@ var startProfitSwitch = function(){

startPaymentProcessor();

startSwitchingPaymentProcessor();

startWebsite();

startProfitSwitch();
Expand Down
Loading