forked from yoshuki43/node-stratum-pool-yescrypt
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
37a4541
commit af3451d
Showing
1 changed file
with
19 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,27 @@ | ||
var net = require('net'); | ||
var events = require('events'); | ||
|
||
//Gives us global access to everything we need for each hashing algorithm | ||
require('./algoProperties.js'); | ||
// Ensure global access to algorithm properties if needed | ||
require('./algoProperties.js'); // Ensure documentation explains why this is needed globally | ||
|
||
var pool = require('./pool.js'); | ||
// Import pool and daemon functionality | ||
var Pool = require('./pool.js'); | ||
var daemon = require('./daemon.js'); | ||
var varDiff = require('./varDiff.js'); | ||
|
||
exports.daemon = require('./daemon.js'); | ||
exports.varDiff = require('./varDiff.js'); | ||
exports.daemon = daemon; | ||
exports.varDiff = varDiff; | ||
|
||
|
||
exports.createPool = function(poolOptions, authorizeFn){ | ||
var newPool = new pool(poolOptions, authorizeFn); | ||
/** | ||
* Create a new mining pool with given options and authorization function. | ||
* @param {Object} poolOptions - Configuration options for the pool | ||
* @param {Function} authorizeFn - Function to authorize mining clients | ||
* @returns {Pool} A new pool instance | ||
*/ | ||
exports.createPool = function(poolOptions, authorizeFn) { | ||
if (!poolOptions || typeof authorizeFn !== 'function') { | ||
throw new Error("Invalid poolOptions or authorizeFn"); | ||
} | ||
var newPool = new Pool(poolOptions, authorizeFn); | ||
return newPool; | ||
}; |