updated
This commit is contained in:
parent
0a70bd3061
commit
c4adf3b282
14
README.md
14
README.md
@ -67,18 +67,24 @@ Installation
|
||||
"stratumPort": 3334,
|
||||
"difficulty": 8,
|
||||
"daemon": {
|
||||
"bin": "dogecoind",
|
||||
"host": "localhost",
|
||||
"port": 8332,
|
||||
"user": "test",
|
||||
"password": "test",
|
||||
"blocknotify": "blockNotify.js doge %s",
|
||||
"startIfOffline": true
|
||||
"password": "test"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
* Supported `"algorithm"` options: `"sha256"` `"scrypt"` `"scrypt-jane"` `"quark"`
|
||||
* Supported `"reward"` options: `"POW"` `"POS"`
|
||||
* Ensure the `daemon` properties are configured correctly for RPC communication
|
||||
|
||||
* Setting up blocknotify (optional, recommended)
|
||||
* Inside `config.json` make sure `blockNotifyListener.enabled` is set to true
|
||||
* Set the `blockNotifyListener.port` and `blockNotifyListener.password`
|
||||
* Inside your daemon startup parameters or conf file, use `-blocknotify="[path to blockNotify.js] [pool host]:[pool blockNotifyListener port] [blockNotifyListener password] [coin symbole set in coin's json config] %s"`
|
||||
* Example: `dogecoind -blocknotify="blockNotify.js localhost:8117 mySuperSecurePassword doge %s"
|
||||
* If your daemon is on a different host you will have to copy the `blockNotify.js` to it
|
||||
|
||||
* To start the poolserver run:
|
||||
|
||||
|
||||
@ -2,9 +2,20 @@
|
||||
|
||||
var net = require('net');
|
||||
|
||||
var client = net.connect({port: 8124}, function() {
|
||||
var config = process.argv[1];
|
||||
var parts = config.split(':');
|
||||
var host = parts[0];
|
||||
var port = parts[1];
|
||||
var password = process.argv[2];
|
||||
var coin = process.argv[3];
|
||||
var blockHash = process.argv[4];
|
||||
|
||||
var client = net.connect(port, host, function() {
|
||||
console.log('client connected');
|
||||
client.write(JSON.stringify(process.argv) + '\n');
|
||||
client.write(JSON.stringify({
|
||||
password: password,
|
||||
blockHash: blockHash
|
||||
}) + '\n');
|
||||
});
|
||||
|
||||
client.on('data', function(data) {
|
||||
|
||||
40
init.js
40
init.js
@ -2,8 +2,6 @@ var net = require('net');
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
|
||||
var bignum = require('bignum');
|
||||
|
||||
var pool = require('./pool.js');
|
||||
|
||||
var logRef = console.log;
|
||||
@ -12,12 +10,15 @@ console.log = function(s){
|
||||
logRef(time + ': ' + s);
|
||||
};
|
||||
|
||||
|
||||
var config = JSON.parse(fs.readFileSync("config.json"));
|
||||
|
||||
|
||||
function Coin(options){
|
||||
this.options = options;
|
||||
}
|
||||
Coin.prototype = {};
|
||||
|
||||
|
||||
var coins = [];
|
||||
|
||||
var confFolder = 'coins';
|
||||
@ -40,20 +41,21 @@ fs.readdir(confFolder, function(err, files){
|
||||
});
|
||||
|
||||
|
||||
|
||||
var blockNotifyServer = net.createServer(function(c) {
|
||||
console.log('server connected');
|
||||
var data = '';
|
||||
c.on('data', function(d){
|
||||
console.log('got blocknotify data');
|
||||
data += d;
|
||||
if (data.slice(-1) === '\n'){
|
||||
c.end();
|
||||
}
|
||||
if (config.blockNotifyListener.enabled){
|
||||
var blockNotifyServer = net.createServer(function(c) {
|
||||
console.log('server connected');
|
||||
var data = '';
|
||||
c.on('data', function(d){
|
||||
console.log('got blocknotify data');
|
||||
data += d;
|
||||
if (data.slice(-1) === '\n'){
|
||||
c.end();
|
||||
}
|
||||
});
|
||||
c.on('end', function() {
|
||||
console.log(data);
|
||||
console.log('server disconnected');
|
||||
});
|
||||
});
|
||||
c.on('end', function() {
|
||||
console.log(data);
|
||||
console.log('server disconnected');
|
||||
});
|
||||
});
|
||||
//blockNotifyServer.listen(8124, function() {});
|
||||
blockNotifyServer.listen(config.blockNotifyListener.port, function() {});
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user