Restructured module - removed stratum object so only pool object is exposed
This commit is contained in:
parent
75dfeccd8c
commit
a0a46621a2
23
README.md
23
README.md
@ -68,27 +68,12 @@ npm update
|
||||
|
||||
#### Module usage
|
||||
|
||||
Initialize a new Stratum object
|
||||
```javascript
|
||||
var Stratum = require('stratum-pool');
|
||||
|
||||
var stratum = new Stratum({
|
||||
blockNotifyListener: {
|
||||
enabled: false,
|
||||
port: 8117,
|
||||
password: "test"
|
||||
}
|
||||
});
|
||||
|
||||
stratum.on('log', function(text){
|
||||
console.log(text);
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
Create and start new pool with configuration options and authentication function
|
||||
```javascript
|
||||
var pool = stratum.createPool({
|
||||
|
||||
var Stratum = require('stratum-pool');
|
||||
|
||||
var pool = Stratum.createPool({
|
||||
|
||||
coin: {
|
||||
name: "Dogecoin",
|
||||
|
||||
19
lib/index.js
19
lib/index.js
@ -3,18 +3,7 @@ var events = require('events');
|
||||
|
||||
var pool = require('./pool.js');
|
||||
|
||||
|
||||
var index = module.exports = function index(options){
|
||||
|
||||
var _this = this;
|
||||
this.pools = [];
|
||||
|
||||
|
||||
this.createPool = function(poolOptions, authorizeFn){
|
||||
var newPool = new pool(poolOptions, authorizeFn);
|
||||
this.pools.push(newPool);
|
||||
return newPool;
|
||||
};
|
||||
|
||||
};
|
||||
index.prototype.__proto__ = events.EventEmitter.prototype;
|
||||
exports.createPool = function(poolOptions, authorizeFn){
|
||||
var newPool = new pool(poolOptions, authorizeFn);
|
||||
return newPool;
|
||||
};
|
||||
Loading…
Reference in New Issue
Block a user