From fb4dd5af8136ac3fb230a33026f9c7bde74ee55e Mon Sep 17 00:00:00 2001 From: Matthew Little Date: Mon, 13 Jan 2014 18:24:37 -0700 Subject: [PATCH] Updated structure --- example/coins/dogecoin_example.json | 16 ---------- example/config.json | 7 ----- example/init.js | 49 ----------------------------- 3 files changed, 72 deletions(-) delete mode 100644 example/coins/dogecoin_example.json delete mode 100644 example/config.json delete mode 100644 example/init.js diff --git a/example/coins/dogecoin_example.json b/example/coins/dogecoin_example.json deleted file mode 100644 index 8ef6b21..0000000 --- a/example/coins/dogecoin_example.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "name": "Dogecoin", - "symbol": "doge", - "algorithm": "scrypt", - "reward": "POW", - "address": "n3s8iDk1onxyY2nuC1k4HoRQFGJ7BhjFcq", - "stratumPort": 3334, - "difficulty": 8, - "blockRefreshInterval": 5, - "daemon": { - "host": "localhost", - "port": 19334, - "user": "testnet", - "password": "testnet1" - } -} diff --git a/example/config.json b/example/config.json deleted file mode 100644 index feffc01..0000000 --- a/example/config.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "blockNotifyListener": { - "enabled": false, - "port": 8117, - "password": "test" - } -} \ No newline at end of file diff --git a/example/init.js b/example/init.js deleted file mode 100644 index bf77019..0000000 --- a/example/init.js +++ /dev/null @@ -1,49 +0,0 @@ -var fs = require('fs'); - -var Stratum = require('../lib/index.js'); //require('stratum-pool') - - - -var timeLog = function(text, poolName){ - var desc = poolName ? '[' + poolName + '] ' : ''; - var time = new Date().toISOString(); - console.log(time + ': ' + desc + text); -}; - -var config = JSON.parse(fs.readFileSync("config.json")); - - -var stratum = new Stratum(config); -stratum.on('log', function(logText){ - timeLog(logText); -}); - - - -fs.readdirSync('coins').forEach(function(file){ - - var coinOptions = JSON.parse(fs.readFileSync('coins/' + file, {encoding: 'utf8'})); - - var authorizeFN = function (ip, workerName, password, callback) { - // Default implementation just returns true - timeLog(coinOptions.name, "Authorize ["+ip+"] "+workerName+":"+password); - callback({ - error: null, - authorized: true, - disconnect: false - }); - }; - - - var pool = stratum.createPool(coinOptions, authorizeFN); - pool.on('share', function(isValid, data){ - if (isValid) - timeLog(coinOptions.name, "A new Valid share from " + data.client.workerName + " has arrived! - " + data.headerHex); - else - timeLog(coinOptions.name, "Invalid share form " + data.client.workerName + " ErrorCode: " + data.errorCode + " ErrorDescription: " + data.errorDescription); - }).on('log', function(logText){ - timeLog(coinOptions.name, logText); - }); - -}); -