Permalink
Browse files

Added new statistics charts & new admin panel

  • Loading branch information...
fancoder committed Aug 7, 2014
1 parent c2a9aae commit 92ec67f866df047e6477f7f8f6c5b9e1a2b75847
View
@@ -282,6 +282,63 @@ Explanation for each field:
"host": "127.0.0.1",
"port": 6379
}
/* Monitoring RPC services. Statistics will be displayed in Admin panel */
"monitoring": {
"daemon": {
"checkInterval": 60, //interval of sending rpcMethod request
"rpcMethod": "getblockcount" //RPC method name
},
"wallet": {
"checkInterval": 60,
"rpcMethod": "getbalance"
}
/* Collect pool statistics to display in frontend charts */
"charts": {
"pool": {
"hashrate": {
"enabled": true, //enable data collection and chart displaying in frontend
"updateInterval": 60, //how often to get current value
"stepInterval": 1800, //chart step interval calculated as average of all updated values
"maximumPeriod": 86400 //chart maximum periods (chart points number = maximumPeriod / stepInterval = 48)
},
"workers": {
"enabled": true,
"updateInterval": 60,
"stepInterval": 1800, //chart step interval calculated as maximum of all updated values
"maximumPeriod": 86400
},
"difficulty": {
"enabled": true,
"updateInterval": 1800,
"stepInterval": 10800,
"maximumPeriod": 604800
},
"price": { //USD price of one currency coin received from cryptonator.com/api
"enabled": true,
"updateInterval": 1800,
"stepInterval": 10800,
"maximumPeriod": 604800
},
"profit": { //Reward * Rate / Difficulty
"enabled": true,
"updateInterval": 1800,
"stepInterval": 10800,
"maximumPeriod": 604800
}
},
"user": { //chart data displayed in user stats block
"hashrate": {
"enabled": true,
"updateInterval": 180,
"stepInterval": 1800,
"maximumPeriod": 86400
},
"payments": { //payment chart uses all user payments data stored in DB
"enabled": true
}
}
```
#### 3) [Optional] Configure cryptonote-easy-miner for your pool
View
@@ -1,6 +1,7 @@
{
"coin": "monero",
"symbol": "XMR",
"coinUnits": 1000000000000,
"logging": {
"files": {
@@ -113,5 +114,62 @@
"redis": {
"host": "127.0.0.1",
"port": 6379
},
"monitoring": {
"daemon": {
"checkInterval": 60,
"rpcMethod": "getblockcount"
},
"wallet": {
"checkInterval": 60,
"rpcMethod": "getbalance"
}
},
"charts": {
"pool": {
"hashrate": {
"enabled": true,
"updateInterval": 60,
"stepInterval": 1800,
"maximumPeriod": 86400
},
"workers": {
"enabled": true,
"updateInterval": 60,
"stepInterval": 1800,
"maximumPeriod": 86400
},
"difficulty": {
"enabled": true,
"updateInterval": 1800,
"stepInterval": 10800,
"maximumPeriod": 604800
},
"price": {
"enabled": true,
"updateInterval": 1800,
"stepInterval": 10800,
"maximumPeriod": 604800
},
"profit": {
"enabled": true,
"updateInterval": 1800,
"stepInterval": 10800,
"maximumPeriod": 604800
}
},
"user": {
"hashrate": {
"enabled": true,
"updateInterval": 180,
"stepInterval": 1800,
"maximumPeriod": 86400
},
"payments": {
"enabled": true
}
}
}
}
View
26 init.js
@@ -30,6 +30,10 @@ if (cluster.isWorker){
case 'cli':
require('./lib/cli.js');
break
case 'chartsDataCollector':
require('./lib/chartsDataCollector.js');
break
}
return;
}
@@ -40,7 +44,7 @@ require('./lib/exceptionWriter.js')(logSystem);
var singleModule = (function(){
var validModules = ['pool', 'api', 'unlocker', 'payments'];
var validModules = ['pool', 'api', 'unlocker', 'payments', 'chartsDataCollector'];
for (var i = 0; i < process.argv.length; i++){
if (process.argv[i].indexOf('-module=') === 0){
@@ -75,13 +79,17 @@ var singleModule = (function(){
case 'api':
spawnApi();
break;
case 'chartsDataCollector':
spawnChartsDataCollector();
break;
}
}
else{
spawnPoolWorkers();
spawnBlockUnlocker();
spawnPaymentProcessor();
spawnApi();
spawnChartsDataCollector();
}
spawnCli();
@@ -228,4 +236,18 @@ function spawnApi(){
function spawnCli(){
}
}
function spawnChartsDataCollector(){
if (!config.charts) return;
var worker = cluster.fork({
workerType: 'chartsDataCollector'
});
worker.on('exit', function(code, signal){
log('error', logSystem, 'chartsDataCollector died, spawning replacement...');
setTimeout(function(){
spawnChartsDataCollector();
}, 2000);
});
}
Oops, something went wrong.

0 comments on commit 92ec67f

Please sign in to comment.