Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
ROZ-MOFUMOFU-ME authored Apr 30, 2024
1 parent 37a4541 commit af3451d
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions lib/index.js
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;
};

0 comments on commit af3451d

Please sign in to comment.