Restructured module - removed stratum object so only pool object is exposed

This commit is contained in:
Matt 2014-03-01 12:18:18 -07:00
parent 75dfeccd8c
commit a0a46621a2
2 changed files with 8 additions and 34 deletions

View File

@ -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",

View File

@ -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;
};