Add json.minify so comments can be used in config files
This commit is contained in:
parent
6cb4ba8c8c
commit
02fa67febe
@ -5,7 +5,7 @@
|
|||||||
"reward": "POW",
|
"reward": "POW",
|
||||||
"address": "nhfNedMmQ1Rjb62znwaiJgFhL3f4NQztSp",
|
"address": "nhfNedMmQ1Rjb62znwaiJgFhL3f4NQztSp",
|
||||||
"stratumPort": 3334,
|
"stratumPort": 3334,
|
||||||
"difficulty": 16,
|
"difficulty": 32,
|
||||||
"blockRefreshInterval": 1,
|
"blockRefreshInterval": 1,
|
||||||
"daemon": {
|
"daemon": {
|
||||||
"host": "localhost",
|
"host": "localhost",
|
||||||
@ -14,12 +14,12 @@
|
|||||||
"password": "testnet"
|
"password": "testnet"
|
||||||
},
|
},
|
||||||
"varDiff": {
|
"varDiff": {
|
||||||
"enabled": true,
|
"enabled": true, //set to false to disable vardiff functionality
|
||||||
"minDifficulty": 4,
|
"minDifficulty": 16, //minimum difficulty. below 16 will cause problems
|
||||||
"maxDifficulty": 1000,
|
"maxDifficulty": 1000, //network difficulty will be used if it is lower than this
|
||||||
"daemonDiffUpdateFrequency": 3600,
|
"daemonDiffUpdateFrequency": 3600, //get the network difficulty every this many seconds
|
||||||
"targetTime": 10,
|
"targetTime": 30, //target time per share (i.e. try to get 1 share per this many seconds)
|
||||||
"retargetTime": 120,
|
"retargetTime": 120, //check to see if we should retarget every this many seconds
|
||||||
"variancePercent": 20
|
"variancePercent": 20 //allow average time to very this % from target without retarget
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
7
init.js
7
init.js
@ -1,8 +1,9 @@
|
|||||||
var fs = require('fs');
|
var fs = require('fs');
|
||||||
var dateFormat = require('dateformat');
|
|
||||||
var Stratum = require('stratum-pool');
|
var Stratum = require('stratum-pool');
|
||||||
var PoolLogger = require('./libs/logutils.js');
|
var PoolLogger = require('./libs/logutils.js');
|
||||||
|
|
||||||
|
JSON.minify = JSON.minify || require("node-json-minify");
|
||||||
|
|
||||||
var loggerInstance = new PoolLogger({
|
var loggerInstance = new PoolLogger({
|
||||||
'default': true,
|
'default': true,
|
||||||
'keys': {
|
'keys': {
|
||||||
@ -16,7 +17,7 @@ var logDebug = loggerInstance.logDebug;
|
|||||||
var logWarning = loggerInstance.logWarning;
|
var logWarning = loggerInstance.logWarning;
|
||||||
var logError = loggerInstance.logError;
|
var logError = loggerInstance.logError;
|
||||||
|
|
||||||
var config = JSON.parse(fs.readFileSync("config.json"));
|
var config = JSON.parse(JSON.minify(fs.readFileSync("config.json", {encoding: 'utf8'})));
|
||||||
|
|
||||||
|
|
||||||
var stratum = new Stratum(config);
|
var stratum = new Stratum(config);
|
||||||
@ -27,7 +28,7 @@ stratum.on('log', function(logText){
|
|||||||
|
|
||||||
fs.readdirSync('coins').forEach(function(file){
|
fs.readdirSync('coins').forEach(function(file){
|
||||||
|
|
||||||
var coinOptions = JSON.parse(fs.readFileSync('coins/' + file, {encoding: 'utf8'}));
|
var coinOptions = JSON.parse(JSON.minify(fs.readFileSync('coins/' + file, {encoding: 'utf8'})));
|
||||||
|
|
||||||
var authorizeFN = function (ip, workerName, password, callback) {
|
var authorizeFN = function (ip, workerName, password, callback) {
|
||||||
// Default implementation just returns true
|
// Default implementation just returns true
|
||||||
|
|||||||
@ -4,8 +4,9 @@
|
|||||||
"description": "Node quick start example portal",
|
"description": "Node quick start example portal",
|
||||||
"main": "init.js",
|
"main": "init.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"stratum-pool": "~0.0.2",
|
"stratum-pool": "*",
|
||||||
"dateformat": "~1.0.7-1.2.3"
|
"dateformat": "*",
|
||||||
|
"node-json-minify": "*"
|
||||||
},
|
},
|
||||||
"devDependencies": {},
|
"devDependencies": {},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user