From e8da12ad70c50a427a05150a3d663f2ab3f55d2c Mon Sep 17 00:00:00 2001 From: Matthew Little Date: Thu, 16 Jan 2014 13:59:54 -0700 Subject: [PATCH] Updated usage instructions --- README.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f3c2852..fcd1489 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,7 @@ npm update #### Module usage +Initialize a new Stratum object ```javascript var Stratum = require('stratum-pool'); @@ -58,7 +59,11 @@ var stratum = new Stratum({ stratum.on('log', function(text){ console.log(text); }); +``` + +Create and start new pool with configuration options and authentication function +```javascript var pool = stratum.createPool({ name: "Dogecoin", @@ -93,9 +98,11 @@ var pool = stratum.createPool({ disconnect: false }); }); +``` - +Listen to pool events +```javascript /* 'data' object contains: job: 4, //stratum work job ID @@ -130,7 +137,10 @@ pool.on('share', function(isValidShare, isValidBlock, data){ pool.on('log', function(severity, logKey, logText){ console.log(severity + ': ' + '[' + logKey + '] ' + logText); }; +``` +Start pool +```javascript pool.start(); ```