Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
f2497de
http://poollo.com "service unavailable"
nomp Sep 10, 2015
7740d7d
Removed the links to dead pools
nomp Sep 10, 2015
94ef015
Merge pull request #441 from nomp/master
zone117x Feb 20, 2016
9e20064
Added some log info and fixed a typo
helderdb Feb 22, 2016
2d991e4
Merge pull request #452 from heldertb/master
zone117x Feb 22, 2016
6d8781d
Pinned some package versions - included async package
zone117x Jan 23, 2017
34375e1
Update litecoin testnet magic
shaolinfry Feb 13, 2017
6fd15cd
pushing to just get the ball rolling
krisklosterman Jun 20, 2017
4e91ffe
Updated some dep, got them working, still getting malloc error
krisklosterman Jul 9, 2017
5db582c
Merge branch 'master' of https://github.com/krisklosterman/node-open-…
krisklosterman Jul 9, 2017
67851b5
pushing to test on a different platform
krisklosterman Jul 10, 2017
317a6ee
pushing for testing
krisklosterman Jul 12, 2017
fbbe5c0
ready to move to the next step
krisklosterman Jul 12, 2017
11e004a
shareProc update
krisklosterman Jul 17, 2017
81b9380
found a old buffer called, updated it
krisklosterman Aug 6, 2017
676ce86
Removed an un-needed dependecy, and updated code to support new out o…
krisklosterman Aug 15, 2017
c3b98b1
removing something thats not needed yet
krisklosterman Aug 15, 2017
2163971
Add host configuration for CLI
DanielZuwala Aug 18, 2017
7d3c204
Just a small change, but other than that it looks good
krisklosterman Aug 18, 2017
1d7a6e6
Merge pull request #3 from DanielCambray/add-cli-host
krisklosterman Aug 18, 2017
a347349
Bug with payments exceptions fixed
vagabondan Oct 2, 2017
9ecdad4
Merge remote-tracking branch 'krisklosterman/master'
vagabondan Oct 2, 2017
2fc40d9
Added start script
vagabondan Oct 2, 2017
e352976
Reference to node stratum pool with Dash 12.1 support
vagabondan Oct 3, 2017
0043c2a
Learning literature
vagabondan Oct 6, 2017
66c2d5b
Update README.md
vagabondan Oct 6, 2017
53ec37e
Update README.md
vagabondan Oct 6, 2017
8b9ebf8
minor
vagabondan Oct 6, 2017
35ecc5b
Fixed deps
vagabondan Oct 22, 2017
5cbfaaf
Minor changes
vagabondan Oct 22, 2017
1221927
Minor changes
vagabondan Oct 22, 2017
fd98d05
Update package.json
vagabondan Nov 21, 2017
7c4ea4d
Create CONTRIBUTING.md
vagabondan Nov 26, 2017
85abc3c
Update CONTRIBUTING.md
vagabondan Nov 26, 2017
2958c0a
Update CONTRIBUTING.md
vagabondan Nov 26, 2017
cef76c0
Update CONTRIBUTING.md
vagabondan Nov 26, 2017
c3f8a7a
Delete CONTRIBUTING.md
vagabondan Nov 26, 2017
b9428dd
Create CONTRIBUTING.md
vagabondan Nov 26, 2017
dad99af
Merge pull request #3 from vagabondan/vagabondan-patch-1
vagabondan Nov 26, 2017
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
Binary file added Blockchain.Mining.pdf
Binary file not shown.
20 changes: 20 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Contributing

# Issues
Issues are always very welcome - after all, they are a big part of making any code better. However, there are a couple of things you can do to make the lives of the developers _much, much_ easier:

### Tell us:

* What you are doing?
* What do you expect to happen?
* What is actually happening?
* Post an _enough_ log samples that indicates the issue
* Did you try to investigate the problem?
* What are the results?
* Which OS and OS version you are using (Windows/Linux)?
* Which Node.js version you are using?
* Which coin software you are using and its version?

When you post code, please use [Github flavored markdown](https://help.github.com/articles/github-flavored-markdown), in order to get proper syntax highlighting!

If you can even provide a pull request with a failing unit test, we will love you long time! Plus your issue will likely be fixed much faster.
Binary file added Pool_probability_calculator.xlsx
Binary file not shown.
23 changes: 9 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# Some basic considerations of Blockchain, mining, pool.

* ![Blockchain.Mining key concepts](https://github.com/vagabondan/ric-nomp/blob/master/Blockchain.Mining.pdf)
* ![Pool probability calculator](https://github.com/vagabondan/ric-nomp/blob/master/Pool_probability_calculator.xlsx)

# NOMP ![NOMP Logo](http://zone117x.github.io/node-open-mining-portal/logo.svg "NOMP Logo")
#### Node Open Mining Portal

Expand All @@ -9,10 +14,10 @@ responsive user-friendly front-end website featuring mining instructions, in-dep
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. [LiveChains UK](http://www.livechains.net/) offers full hosting, setup and management of NOMP pools with several different configurations.
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. [LiveChains UK](http://www.livechains.net/) however does offer this feature as part of there own customised NOMP called [LivePool](http://www.livechains.net/LivePool.html).
**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
Expand Down Expand Up @@ -110,23 +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://fixminer.com
* http://poollo.com
* http://miningpools.tk
* http://umine.co.uk

Usage
=====
Expand Down
8 changes: 8 additions & 0 deletions coins/dash.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "Dash",
"symbol": "DASH",
"algorithm": "x11",
"mposDiffMultiplier": 256,
"peerMagic": "bf0c6bbd",
"peerMagicTestnet": "cee2caff"
}
4 changes: 2 additions & 2 deletions coins/litecoin.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
"symbol": "LTC",
"algorithm": "scrypt",
"peerMagic": "fbc0b6db",
"peerMagicTestnet": "fcc1b7dc"
}
"peerMagicTestnet": "fdd2c8f1"
}
11 changes: 11 additions & 0 deletions coins/verium.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "Verium",
"symbol": "VRM",
"algorithm": "scrypt-n",
"reward": "POS",
"peerMagic": "70352205",
"peerMagicTestnet": "cdf2c0ef",
"timeTable": {
"1048576": 100
}
}
12 changes: 6 additions & 6 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
},

"defaultPoolConfigs": {
"blockRefreshInterval": 0,
"blockRefreshInterval": 5000,
"jobRebroadcastTimeout": 55,
"connectionTimeout": 600,
"connectionTimeout": 180,
"emitInvalidBlockHashes": false,
"validateWorkerUsername": true,
"tcpProxyProtocol": false,
"tcpProxyProtocol": true,
"shareDiff": 5,
"banning": {
"enabled": true,
Expand Down Expand Up @@ -56,7 +56,7 @@
"enabled": false,
"algorithm": "sha256",
"ports": {
"3333": {
"2222": {
"diff": 10,
"varDiff": {
"minDiff": 16,
Expand All @@ -72,7 +72,7 @@
"enabled": false,
"algorithm": "scrypt",
"ports": {
"4444": {
"3333": {
"diff": 10,
"varDiff": {
"minDiff": 16,
Expand All @@ -88,7 +88,7 @@
"enabled": false,
"algorithm": "x11",
"ports": {
"5555": {
"4443": {
"diff": 0.001,
"varDiff": {
"minDiff": 0.001,
Expand Down
1 change: 1 addition & 0 deletions config_example.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"logLevel": "debug",
"logColors": true,

"cliHost": "127.0.0.1",
"cliPort": 17117,

"clustering": {
Expand Down
16 changes: 11 additions & 5 deletions init.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ var os = require('os');
var cluster = require('cluster');

var async = require('async');
var extend = require('extend');

var PoolLogger = require('./libs/logUtil.js');
var CliListener = require('./libs/cliListener.js');
Expand Down Expand Up @@ -159,10 +158,11 @@ var buildPoolConfigs = function(){
if (!(option in poolOptions)){
var toCloneOption = portalConfig.defaultPoolConfigs[option];
var clonedOption = {};
if (toCloneOption.constructor === Object)
extend(true, clonedOption, toCloneOption);
else
if (toCloneOption.constructor === Object) {
Object.assign(clonedOption, toCloneOption);
} else {
clonedOption = toCloneOption;
}
poolOptions[option] = clonedOption;
}
}
Expand Down Expand Up @@ -255,9 +255,15 @@ var spawnPoolWorkers = function(){

var startCliListener = function(){

// For backward compatibility
var cliHost = '127.0.0.1';
if (portalConfig.cliHost) {
cliHost = portalConfig.cliHost;
}

var cliPort = portalConfig.cliPort;

var listener = new CliListener(cliPort);
var listener = new CliListener(cliHost, cliPort);
listener.on('log', function(text){
logger.debug('Master', 'CLI', text);
}).on('command', function(command, params, options, reply){
Expand Down
6 changes: 3 additions & 3 deletions libs/cliListener.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
var events = require('events');
var net = require('net');

var listener = module.exports = function listener(port){
var listener = module.exports = function listener(host, port){

var _this = this;

Expand Down Expand Up @@ -35,8 +35,8 @@ var listener = module.exports = function listener(port){
emitLog('CLI listener failed to parse message ' + data);
}

}).listen(port, '127.0.0.1', function() {
emitLog('CLI listening on port ' + port)
}).listen(port, host, function() {
emitLog('CLI listening on ' + host + ':' + port)
});
}

Expand Down
79 changes: 79 additions & 0 deletions libs/mongoCompatibility.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
var MongoClient = require('mongodb').MongoClient,
f = require('util').format;
module.exports = function(logger, poolConfig){

var mongoConfig = poolConfig.mongoMode;
var coin = poolConfig.coin.name;

var mongoConfig = {
host: poolConfig.mongoMode.host,
database: poolConfig.mongoMode.database,
user: encodeURIComponent(poolConfig.mongoMode.user),
pass: encodeURIComponent(poolConfig.mongoMode.pass),
authMechanism: poolConfig.mongoMode.authMechanism ? poolConfig.mongoMode.authMechanism : "DEFAULT"
};


var logIdentify = 'MongoDB';
var logComponent = coin;

var connectionURL = "";

if (mongoConfig.user && mongoConfig.pass) {
connectionURL = f('mongodb://%s:%s@%s:27017/myproject?authMechanism=%s', mongoConfig.user, mongoConfig.pass, mongoConfig.host, mongoConfig.database, mongoConfig.authMechanism);
} else {
connectionURL = f('mongodb://%s:27017/%s', mongoConfig.host, mongoConfig.database);
}

//TODO: PRIORITY: Check to see if collection exists and create it if not

var mongoInsert = function(collectionName, data, errCallback, successCallback) {
MongoClient.connect(connectionURL, function(err, db) {

var collection = db.collection(collectionName);

collection.insert(data, function(err, result){
if (err) {
errCallback(err);
//TODO: do we stop it from moving on here?
}

successCallback(result);
db.close(); //TODO: does this work? does it get called before the above callback can do whatever with result?
});

});
};

this.handleShare = function(isValidShare, isValidBlock, shareData){

var dbData = {
rem_host: shareData.ip,
worker: shareData.worker,
valid_share: isValidShare ? 'Y' : 'N',
valid_block: isValidBlock ? 'Y' : 'N',
difficulty: shareData.difficulty * (poolConfig.coin.mposDiffMultiplier || 1),
reason: typeof(shareData.error) === 'undefined' ? null : shareData.error,
solution: shareData.blockHash ? shareData.blockHash : (shareData.blockHashInvalid ? shareData.blockHashInvalid : '')
};

mongoInsert('shares', dbData,
function(err){
logger.error(logIdentify, logComponent, 'Insert error when adding share: ' + JSON.stringify(err));
},
function(result) {
logger.debug(logIdentify, logComponent, 'Share inserted');
});

};

this.handleDifficultyUpdate = function(workerName, diff){
//TODO:
};

this.handleAuth = function(workerName, password, authCallback){
//TODO:
};


};
Loading