Bitcoin Forum

Bitcoin => Mining software (miners) => Topic started by: zone117x on February 22, 2014, 07:56:18 PM



Title: Stratum Pool Server [Node.js] (supports POS/POW, SHA/Scrypt/Quark/X11, Vardiff)
Post by: zone117x on February 22, 2014, 07:56:18 PM
Open source: https://github.com/zone117x/node-stratum (https://github.com/zone117x/node-stratum)

High performance Stratum poolserver in Node.js. One instance of this software can startup and manage multiple coin pools, each with their own daemon and stratum port :)

This project does not do any payment processing. For a full featured portal that uses this module, see NOMP (Node Open Mining Portal) (https://github.com/zone117x/node-open-mining-portal). It handles payments, website front-end, database layer, mutli-coin/pool support, auto-switching miners between coins/pools, etc.. The portal also has an MPOS compatibility mode so that the it can function as a drop-in-replacement for python-stratum-mining (https://github.com/Crypto-Expert/stratum-mining/).


Features

  • Daemon RPC interface
  • Stratum TCP socket server
  • Block template / job manager
  • Optimized generation transaction building
  • Connecting to multiple daemons for redundancy
  • Process share submissions
  • Session managing for purging DDoS/flood initiated zombie workers
  • Auto ban IPs that are flooding with invalid shares
  • POW (proof-of-work) & POS (proof-of-stake) support
  • Transaction messages support
  • Vardiff (variable difficulty / share limiter)
  • When started with a coin deamon that hasn't finished syncing to the network it shows the blockchain download progress and initializes once synced
  • Supports algorithms:
    • SHA256 (Bitcoin, Freicoin, Peercoin/PPCoin, Terracoin, etc..)
    • Scrypt (Litecoin, Dogecoin, Feathercoin, etc..)
    • Scrypt-Jane (YaCoin, CopperBars, Pennies, Tickets, etc..)
    • Scrypt-N (YaCoin, CopperBars, Pennies, Tickets, etc..)
    • Quark (Quarkcoin [QRK])
    • X11 (Darkcoin [DRK])


Example usage:

Create the configuration for your coin:

Code:
var myCoin = {
    "name": "Dogecoin",
    "symbol": "DOGE",
    "algorithm": "scrypt", //or "sha256", "scrypt-jane", "scrypt-n", "quark", "x11"
    "txMessages": false, //or true (not required, defaults to false)
};

If you are using the `scrypt-jane` algorithm there are additional configurations:

Code:
var myCoin = {
    "name": "Freecoin",
    "symbol": "FEC",
    "algorithm": "scrypt-jane",
    "chainStartTime": 1375801200, //defaults to 1367991200 (YACoin) if not used
    "nMin": 6, //defaults to 4 if not used
    "nMax": 32 //defaults to 30 if not used
};

If you are using the `scrypt-n` algorithm there is an additional configuration:
Code:
var myCoin = {
    "name": "Execoin",
    "symbol": "EXE",
    "algorithm": "scrypt-n",
    /* This defaults to Vertcoin's timetable if not used. It is required for scrypt-n coins that have
       modified their N-factor timetable to be different than Vertcoin's. */
    "timeTable": {
        "2048": 1390959880,
        "4096": 1438295269,
        "8192": 1485630658,
        "16384": 1532966047,
        "32768": 1580301436,
        "65536": 1627636825,
        "131072": 1674972214,
        "262144": 1722307603
    }
};

Create and start new pool with configuration options and authentication function

Code:
var Stratum = require('stratum-pool');

var pool = Stratum.createPool({

    "coin": myCoin,

    "address": "mi4iBXbBsydtcc5yFmsff2zCFVX4XG7qJc", //Address to where block rewards are given
    "blockRefreshInterval": 1000, //How often to poll RPC daemons for new blocks, in milliseconds

    /* How many milliseconds should have passed before new block transactions will trigger a new
       job broadcast. */
    "txRefreshInterval": 20000,

    /* Some miner software is bugged and will consider the pool offline if it doesn't receive
       anything for around a minute, so every time we broadcast jobs, set a timeout to rebroadcast
       in this many seconds unless we find a new job. Set to zero or remove to disable this. */
    "jobRebroadcastTimeout": 55,

    //instanceId: 37, //Recommend not using this because a crypto-random one will be generated

    /* Some attackers will create thousands of workers that use up all available socket connections,
       usually the workers are zombies and don't submit shares after connecting. This features
       detects those and disconnects them. */
    "connectionTimeout": 600, //Remove workers that haven't been in contact for this many seconds

    /* If a worker is submitting a good deal of invalid shares we can temporarily ban them to
       reduce system/network load. Also useful to fight against flooding attacks. */
    "banning": {
        "enabled": true,
        "time": 600, //How many seconds to ban worker for
        "invalidPercent": 50, //What percent of invalid shares triggers ban
        "checkThreshold": 500, //Check invalid percent when this many shares have been submitted
        "purgeInterval": 300 //Every this many seconds clear out the list of old bans
    },

    /* Each pool can have as many ports for your miners to connect to as you wish. Each port can
       be configured to use its own pool difficulty and variable difficulty settings. varDiff is
       optional and will only be used for the ports you configure it for. */
    "ports": {
        "3032": { //A port for your miners to connect to
            "diff": 32, //the pool difficulty for this port

            /* Variable difficulty is a feature that will automatically adjust difficulty for
               individual miners based on their hashrate in order to lower networking overhead */
            "varDiff": {
                "minDiff": 8, //Minimum difficulty
                "maxDiff": 512, //Network difficulty will be used if it is lower than this
                "targetTime": 15, //Try to get 1 share per this many seconds
                "retargetTime": 90, //Check to see if we should retarget every this many seconds
                "variancePercent": 30 //Allow time to very this % from target without retargeting
            }
        },
        "3256": { //Another port for your miners to connect to, this port does not use varDiff
            "diff": 256 //The pool difficulty
        }
    },


    /* Recommended to have at least two daemon instances running in case one drops out-of-sync
       or offline. For redundancy, all instances will be polled for block/transaction updates
       and be used for submitting blocks. Creating a backup daemon involves spawning a daemon
       using the "-datadir=/backup" argument which creates a new daemon instance with it's own
       RPC config. For more info on this see:
          - https://en.bitcoin.it/wiki/Data_directory
          - https://en.bitcoin.it/wiki/Running_bitcoind */
    "daemons": [
        {   //Main daemon instance
            "host": "localhost",
            "port": 19332,
            "user": "litecoinrpc",
            "password": "testnet"
        },
        {   //Backup daemon instance
            "host": "localhost",
            "port": 19344,
            "user": "litecoinrpc",
            "password": "testnet"
        }
    ],


    /* This allows the pool to connect to the daemon as a node peer to recieve block updates.
       It may be the most efficient way to get block updates (faster than polling, less
       intensive than blocknotify script). However its still under development (not yet working). */
    "p2p": {
        "enabled": false,
        "host": "localhost",
        "port": 19333,

        /* Magic value is different for main/testnet and for each coin. It is found in the daemon
           source code as the pchMessageStart variable.
           For example, litecoin mainnet magic: http://git.io/Bi8YFw
           And for litecoin testnet magic: http://git.io/NXBYJA
         */
        "magic": "fcc1b7dc",

        //Found in src as the PROTOCOL_VERSION variable, for example: http://git.io/KjuCrw
        "protocolVersion": 70002,
    }

}, function(ip, workerName, password, callback){ //stratum authorization function
    console.log("Authorize " + workerName + ":" + password + "@" + ip);
    callback({
        error: null,
        authorized: true,
        disconnect: false
    });
});


Listen to pool events
Code:
/*
'data' object contains:
    job: 4, //stratum work job ID
    ip: '71.33.19.37', //ip address of client
    worker: 'matt.worker1', //stratum worker name
    difficulty: 64, //stratum client difficulty
    reward: 5000000000, //the number of satoshis received as payment for solving this block
    height: 443795, //block height
    networkDifficulty: 3349 //network difficulty for this block

    //solution is set if block was found
    solution: '110c0447171ad819dd181216d5d80f41e9218e25d833a2789cb8ba289a52eee4',

    //tx is the coinbase transaction hash from the block
    tx: '41bb22d6cc409f9c0bae2c39cecd2b3e3e1be213754f23d12c5d6d2003d59b1d,

    error: 'low share difficulty' //set if share is rejected for some reason
*/
pool.on('share', function(isValidShare, isValidBlock, data){

    if (isValidBlock)
        console.log('Block found');
    else if (isValidShare)
        console.log('Valid share submitted');
    else if (data.solution)
        console.log('We thought a block solution was found but it was rejected by the daemon');
    else
        console.log('Invalid share submitted')

    console.log('share data: ' + JSON.stringify(data));
});



/*
'severity': can be 'debug', 'warning', 'error'
'logKey':   can be 'system' or 'client' indicating if the error
            was caused by our system or a stratum client
*/
pool.on('log', function(severity, logKey, logText){
    console.log(severity + ': ' + '[' + logKey + '] ' + logText);
});

Start pool
Code:
pool.start();


Title: Re: Stratum Pool Server [Node.js] (supports POS/POW, SHA/Scrypt/Quark/X11, Vardiff)
Post by: justmine on February 25, 2014, 12:07:16 AM
It seems that this don't work properly on x11 hash algo...
The workers cannot connect to stratum


Title: Re: Stratum Pool Server [Node.js] (supports POS/POW, SHA/Scrypt/Quark/X11, Vardiff)
Post by: zone117x on February 27, 2014, 04:06:26 AM
Can you give me some more detail? If it was a problem with the x11 hashing then you would be seeing low-difficulty shares most likely. Workers not being able to connect sounds like you just have a configuration problem.


Title: Re: Stratum Pool Server [Node.js] (supports POS/POW, SHA/Scrypt/Quark/X11, Vardiff)
Post by: embicoin on February 27, 2014, 04:51:16 AM
Is there any live site currently running this module to watch it for testing purposes?


Title: Re: Stratum Pool Server [Node.js] (supports POS/POW, SHA/Scrypt/Quark/X11, Vardiff)
Post by: zone117x on February 27, 2014, 08:42:33 AM
clevermining.com is in the process of integrating it into their system - not sure where they are at on that. It may or may not be running live on there at this point. Other than that, people have implied that they have been running it live but have not disclosed their pool to me.
The project is still fairly new - but in time I expect to add a list to the README of pools running it live  :)


Title: Re: Stratum Pool Server [Node.js] (supports POS/POW, SHA/Scrypt/Quark/X11, Vardiff)
Post by: Tersken on March 06, 2014, 01:10:39 PM
Tried this, however after your address is validated, it goes trough base58.decode. A few steps inside that you will eventually use the bignum function toString(base);
Now in here when running the .tostring(base) function the whole thing stops without an error. Any ideas?


Title: Re: Stratum Pool Server [Node.js] (supports POS/POW, SHA/Scrypt/Quark/X11, Vardiff)
Post by: zone117x on March 07, 2014, 07:16:35 AM
Hi Tersken,
You need to provide much more information if you want help debugging. Open an issue on github and provide as many details as you can - especially your configuration and error stack trace.


Title: Re: Stratum Pool Server [Node.js] (supports POS/POW, SHA/Scrypt/Quark/X11, Vardiff)
Post by: gpson on March 08, 2014, 08:05:57 AM
I cloned the project to my tmp folder and updated npm

created stratum.js as in your example

when starting

Code:
$ node stratum.js

module.js:340
    throw err;
          ^
Error: Cannot find module 'x11-hash'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/home/gpson/tmp/node_modules/stratum-pool/lib/jobManager.js:9:11)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)

Code:
npm -v
1.4.3
node -v
v0.10.26


Title: Re: Stratum Pool Server [Node.js] (supports POS/POW, SHA/Scrypt/Quark/X11, Vardiff)
Post by: zone117x on April 02, 2014, 04:37:55 AM
Sorry for the delayed reply.. Be sure to read the setup/require instructions in the readme. One of the commands is
Code:
npm update
Which fetches all modules/dependencies.  :)


Title: Re: Stratum Pool Server [Node.js] (supports POS/POW, SHA/Scrypt/Quark/X11, Vardiff)
Post by: sellbuy on April 06, 2014, 04:34:28 AM
how to instal it and launch in nodejs on windows?


Code:
C:\Users\user\Documents\GitHub> npm update
npm http GET https://registry.npmjs.org/stratum-pool
npm http 304 https://registry.npmjs.org/stratum-pool
npm http GET https://registry.npmjs.org/base58-native
npm http GET https://registry.npmjs.org/bignum
npm http GET https://registry.npmjs.org/async
npm http 304 https://registry.npmjs.org/async
npm http 304 https://registry.npmjs.org/bignum
npm http 304 https://registry.npmjs.org/base58-native
npm http GET https://registry.npmjs.org/bignum/0.6.2
npm http GET https://registry.npmjs.org/base58-native/0.1.3
npm http 304 https://registry.npmjs.org/bignum/0.6.2

> bignum@0.6.2 install C:\Users\user\Documents\GitHub\node_modules\stratum-p
ool\node_modules\bignum
> node-gyp configure build


C:\Users\user\Documents\GitHub\node_modules\stratum-pool\node_modules\bignum
>node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_mod
ules\node-gyp\bin\node-gyp.js" configure build
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYT
HON env variable.
gyp ERR! stack     at failNoPython (C:\Program Files\nodejs\node_modules\npm\nod
e_modules\node-gyp\lib\configure.js:101:14)
gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node
-gyp\lib\configure.js:64:11
gyp ERR! stack     at Object.oncomplete (fs.js:107:15)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modu
les\\node-gyp\\bin\\node-gyp.js" "configure" "build"
gyp ERR! cwd C:\Users\user\Documents\GitHub\node_modules\stratum-pool\node_m
odules\bignum
gyp ERR! node -v v0.10.26
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok
npm ERR! bignum@0.6.2 install: `node-gyp configure build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bignum@0.6.2 install script.
npm ERR! This is most likely a problem with the bignum package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp configure build
npm ERR! You can get their info via:
npm ERR!     npm owner ls bignum
npm ERR! There is likely additional logging output above.

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nod
ejs\\node_modules\\npm\\bin\\npm-cli.js" "update"
npm ERR! cwd C:\Users\user\Documents\GitHub
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! code ELIFECYCLE
npm http GET https://registry.npmjs.org/bindings
npm http 304 https://registry.npmjs.org/base58-native/0.1.3

> bignum@0.6.2 install C:\Users\user\Documents\GitHub\node_modules\stratum-p
ool\node_modules\base58-native\node_modules\bignum
> node-gyp configure build


C:\Users\user\Documents\GitHub\node_modules\stratum-pool\node_modules\base58
-native\node_modules\bignum>node "C:\Program Files\nodejs\node_modules\npm\bin\n
ode-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" configure build
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYT
HON env variable.
gyp ERR! stack     at failNoPython (C:\Program Files\nodejs\node_modules\npm\nod
e_modules\node-gyp\lib\configure.js:101:14)
gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node
-gyp\lib\configure.js:64:11
gyp ERR! stack     at Object.oncomplete (fs.js:107:15)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modu
les\\node-gyp\\bin\\node-gyp.js" "configure" "build"
gyp ERR! cwd C:\Users\user\Documents\GitHub\node_modules\stratum-pool\node_m
odules\base58-native\node_modules\bignum
gyp ERR! node -v v0.10.26
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok
npm http 304 https://registry.npmjs.org/bindings

> multi-hashing@0.0.7 install C:\Users\user\Documents\GitHub\node_modules\st
ratum-pool\node_modules\multi-hashing
> node-gyp rebuild


C:\Users\user\Documents\GitHub\node_modules\stratum-pool\node_modules\multi-
hashing>node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\n
ode_modules\node-gyp\bin\node-gyp.js" rebuild
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYT
HON env variable.
gyp ERR! stack     at failNoPython (C:\Program Files\nodejs\node_modules\npm\nod
e_modules\node-gyp\lib\configure.js:101:14)
gyp ERR! stack     at C:\Program Files\nodejs\node_modules\npm\node_modules\node
-gyp\lib\configure.js:64:11
gyp ERR! stack     at Object.oncomplete (fs.js:107:15)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modu
les\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\user\Documents\GitHub\node_modules\stratum-pool\node_m
odules\multi-hashing
gyp ERR! node -v v0.10.26
gyp ERR! node-gyp -v v0.12.2
gyp ERR! not ok
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\Users\user\Documents\GitHub\npm-debug.log
npm ERR! not ok code 0
C:\Users\user\Documents\GitHub>



Title: Re: Stratum Pool Server [Node.js] (supports POS/POW, SHA/Scrypt/Quark/X11, Vardiff)
Post by: CaptEmulation on April 08, 2014, 03:31:43 AM
Quote
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYT
HON env variable.
Need to install python and put it on the PATH


Title: Re: Stratum Pool Server [Node.js] (supports POS/POW, SHA/Scrypt/Quark/X11, Vardiff)
Post by: grandMasterHash on April 08, 2014, 07:08:22 PM
How do you activate the MPOS compatibility mode?


Title: Re: Stratum Pool Server [Node.js] (supports POS/POW, SHA/Scrypt/Quark/X11, Vardiff)
Post by: Taugeran on April 14, 2014, 05:09:14 AM
take a look at https://github.com/bitcoinjs/bitcoinjs-server/ for a nodejs implementation of the p2p functionality


Title: Re: Stratum Pool Server [Node.js] (supports POS/POW, SHA/Scrypt/Quark/X11, Vardiff)
Post by: mapleshadow on May 05, 2014, 12:25:44 PM
Good~~~~~~~~~~~~~~~~ ;D


Title: Re: Stratum Pool Server [Node.js] (supports POS/POW, SHA/Scrypt/Quark/X11, Vardiff)
Post by: mapleshadow on May 05, 2014, 12:35:21 PM
ERROR................

events.js:72
throw er; // Unhandled 'error' event
^
Error: bind EACCES
at errnoException (net.js:904:11)
at net.js:1072:30
at Object.12:1 (cluster.js:592:5)
at handleResponse (cluster.js:171:41)
at respond (cluster.js:192:5)
at handleMessage (cluster.js:202:5)
at process.EventEmitter.emit (events.js:117:20)
at handleMessage (child_process.js:322:10)
at Pipe.channel.onread (child_process.js:349:11)
2014-05-05 17:21:19 [Master] [Website] Website process died, spawning replacement...

xxxxx@mpos:~/nomp$

PS:
config.json

"website": {
    "enabled": true,
    "port": 80,
    "stratumHost": "localhost",
    "stats": {
        "updateInterval": 60,
        "historicalRetention": 43200,
        "hashrateWindow": 300
    },
    "adminCenter": {
        "enabled": true,
        "password": "password"
    }
},


Title: Re: Stratum Pool Server [Node.js] (supports POS/POW, SHA/Scrypt/Quark/X11, Vardiff)
Post by: Taugeran on May 05, 2014, 01:17:11 PM
ERROR................

events.js:72
throw er; // Unhandled 'error' event
^
Error: bind EACCES
at errnoException (net.js:904:11)
at net.js:1072:30
at Object.12:1 (cluster.js:592:5)
at handleResponse (cluster.js:171:41)
at respond (cluster.js:192:5)
at handleMessage (cluster.js:202:5)
at process.EventEmitter.emit (events.js:117:20)
at handleMessage (child_process.js:322:10)
at Pipe.channel.onread (child_process.js:349:11)
2014-05-05 17:21:19 [Master] [Website] Website process died, spawning replacement...

xxxxx@mpos:~/nomp$

PS:
config.json

"website": {
    "enabled": true,
    "port": 80,
    "stratumHost": "localhost",
    "stats": {
        "updateInterval": 60,
        "historicalRetention": 43200,
        "hashrateWindow": 300
    },
    "adminCenter": {
        "enabled": true,
        "password": "password"
    }
},

Are you trying to bind to port 80 on a Linux machine?  If so only processes owned by root can do that. So try sudo


Title: Re: Stratum Pool Server [Node.js] (supports POS/POW, SHA/Scrypt/Quark/X11, Vardiff)
Post by: vaskomobile on May 14, 2014, 01:02:16 AM
Hello ,

I have some difficult`s setting up NOMP module.
I have configured everything noticed in README but what is happening:
Connection is established between miner and back-end.Subscribe and authorize messages are sent by miner, and miner receive job . Miner start solving  the job and... then nothing. Any idea?


Title: Re: Stratum Pool Server [Node.js] (supports POS/POW, SHA/Scrypt/Quark/X11, Vardiff)
Post by: pttinh on May 15, 2014, 04:23:21 PM
Please help me, I'm a newbie in pool configuration, I want to add node stratum for MPOS but still have some questiions:

1.
Code:
Create the configuration for your coin:
   
Code:
Create and start new pool with configuration options and authentication function
   
Code:
Listen to pool events
   What is their name and where to put them?
2. Where to run this command?
   
Code:
pool.start();
3. I add successfully NOMP to MPOS but when mining, pool shows my hash rate very low, where am I wrong?

Thanks for your help.


Title: Re: Stratum Pool Server [Node.js] (supports POS/POW, SHA/Scrypt/Quark/X11, Vardiff)
Post by: vaskomobile on May 15, 2014, 10:36:40 PM
Hello ,

I have some difficult`s setting up NOMP module.
I have configured everything noticed in README but what is happening:
Connection is established between miner and back-end.Subscribe and authorize messages are sent by miner, and miner receive job . Miner start solving  the job and... then nothing. Any idea?

That`s because i`m trying to mine x11 with vardiff min32 max1024 ;) Very difficult.


Title: Re: Stratum Pool Server [Node.js] (supports POS/POW, SHA/Scrypt/Quark/X11, Vardiff)
Post by: maryanlukuts on June 01, 2014, 06:12:37 PM
how to add x13stratum ?


Title: Re: Stratum Pool Server [Node.js] (supports POS/POW, SHA/Scrypt/Quark/X11, Vardiff)
Post by: frankie2fingers on June 10, 2014, 06:53:19 PM
So, I keep getting an error while trying to install this stratum server code on Ubuntu.  I've tried several systems, and updating redis and python as described in the readme, but the error never changes or improves. 

I get the following a little ways through running "npm update"....

npm http 304 https://registry.npmjs.org/bignum/0.7.0
npm http 404 https://registry.npmjs.org/multi-hashing/0.0.9
npm ERR! Error: version not found: 0.0.9 : multi-hashing/0.0.9
npm ERR!     at RegClient.<anonymous> (/usr/share/npm/node_modules/npm-registry-client/lib/request.js:269:14)
npm ERR!     at Request.self.callback (/usr/lib/nodejs/request/main.js:119:22)
npm ERR!     at Request.<anonymous> (/usr/lib/nodejs/request/main.js:525:16)
npm ERR!     at Request.EventEmitter.emit (events.js:95:17)
npm ERR!     at IncomingMessage.<anonymous> (/usr/lib/nodejs/request/main.js:484:14)
npm ERR!     at IncomingMessage.EventEmitter.emit (events.js:117:20)
npm ERR!     at _stream_readable.js:910:16
npm ERR!     at process._tickCallback (node.js:415:13)
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://bugs.debian.org/npm>
npm ERR! or use
npm ERR!     reportbug --attach npm-debug.log npm

npm ERR! System Linux 3.11.0-12-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "update"
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.2.18

Can anyone help?


Title: Re: Stratum Pool Server [Node.js] (supports POS/POW, SHA/Scrypt/Quark/X11, Vardiff)
Post by: SpAcEDeViL on June 26, 2014, 05:05:17 PM
Hy,

i will install node-stratum-pool but... how?

Iam a node newbie. But iam a php, c# and java (jquery) programmer.
But i will save time.

so i had install node on my centOS Server and had made npm update. All ok. No errors on install.

So now i have the pool here... where i must place the config.js or config.json?
Where is the including in the code?

Must i place all https://github.com/zone117x/node-stratum-pool install infos in the config.js?

Where must i place the config? /lib/ ? or root?

node stratum.js to start? or must i make a start.js file with pool.start(); ?

Have anyone a step by step instruction ?

THX

Best Regards


Title: Re: Stratum Pool Server [Node.js] (supports POS/POW, SHA/Scrypt/Quark/X11, Vardiff)
Post by: CaptEmulation on July 02, 2014, 03:39:55 PM
I am trying to understand how to use NOMP to multi-mine using a Base58Check compatible pubkey and a custom profit switcher algo.  In my case, I am working from a simple implementation of being able to manually switch the auto-switch pool from a web service.  I've looked at the bitcoin code and wiki so understand the mechanics of key creation-- now I am wondering if someone can point me towards a handy utility to help generate WIF keys from a common key to import into an arbitrary wallet.  So I don't have to write one.  Not wanting to reinvent the wheel ( I was doing that already before I found NOMP <3 ) and I figure I'm overlooking a key piece of information to do this easily.

Thanks.


Title: Re: Stratum Pool Server [Node.js] (supports POS/POW, SHA/Scrypt/Quark/X11, Vardiff)
Post by: tuaris on July 04, 2014, 10:11:29 AM
- No orphaned blocks

Really??
How do you manage to achieve that???
LOL  :D


Title: Re: Stratum Pool Server [Node.js] (supports POS/POW, SHA/Scrypt/Quark/X11, Vardiff)
Post by: gperez2000 on July 08, 2014, 11:47:21 PM
So, I keep getting an error while trying to install this stratum server code on Ubuntu.  I've tried several systems, and updating redis and python as described in the readme, but the error never changes or improves. 

I get the following a little ways through running "npm update"....

npm http 304 https://registry.npmjs.org/bignum/0.7.0
npm http 404 https://registry.npmjs.org/multi-hashing/0.0.9
npm ERR! Error: version not found: 0.0.9 : multi-hashing/0.0.9
npm ERR!     at RegClient.<anonymous> (/usr/share/npm/node_modules/npm-registry-client/lib/request.js:269:14)
npm ERR!     at Request.self.callback (/usr/lib/nodejs/request/main.js:119:22)
npm ERR!     at Request.<anonymous> (/usr/lib/nodejs/request/main.js:525:16)
npm ERR!     at Request.EventEmitter.emit (events.js:95:17)
npm ERR!     at IncomingMessage.<anonymous> (/usr/lib/nodejs/request/main.js:484:14)
npm ERR!     at IncomingMessage.EventEmitter.emit (events.js:117:20)
npm ERR!     at _stream_readable.js:910:16
npm ERR!     at process._tickCallback (node.js:415:13)
npm ERR! If you need help, you may report this log at:
npm ERR!     <http://bugs.debian.org/npm>
npm ERR! or use
npm ERR!     reportbug --attach npm-debug.log npm

npm ERR! System Linux 3.11.0-12-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "update"
npm ERR! node -v v0.10.15
npm ERR! npm -v 1.2.18

Can anyone help?

Install nodes legacy, I had the same issue, now is working perfectly


Title: Re: Stratum Pool Server [Node.js] (supports POS/POW, SHA/Scrypt/Quark/X11, Vardiff)
Post by: alenevaa on July 14, 2014, 07:19:41 AM
Hi zone117x!

I've successfully installed nomp in mpos compatibility mode as replacement for python-stratum-mining. I am using yacoin config file.
All seems to be OK! The shares are accepted.

When the block was found it accepted by wallet successfully. But nomp gives the error in console: "We thought a block was found but it was rejected by the daemon"

Code:
2014-07-13 18:29:06 [Pool]      [yacoin] (Thread 1) We thought a block was found but it was rejected by the daemon, share data: {"job":"387","ip":"192.168.1.101","port":3333,"worker":"ya.R9270X","height":629143,"blockReward":58760000,"difficulty":1,"shareDiff":"510.48249361","blockDiff":388.841603072,"blockDiffActual":0.005933252,"blockHash":"fe1b703bf84eae45499dc7a186279fc6bd5dcb82591537739303f283884fce06"}
2014-07-13 18:29:06 [Pool]      [yacoin] (Thread 1) Share accepted at diff 1/510.48249361 by ya.R9270X [192.168.1.101]

Why is the block hash so weird? (not filled with leading zeroes)

So info about block doesn't stored in mysql base. And MPOS doesn't see any blocks found.


Title: Re: Stratum Pool Server [Node.js] (supports POS/POW, SHA/Scrypt/Quark/X11, Vardiff)
Post by: polz on August 10, 2014, 07:59:01 PM
Hi zone117x!

I've successfully installed nomp in mpos compatibility mode as replacement for python-stratum-mining. I am using yacoin config file.
All seems to be OK! The shares are accepted.

When the block was found it accepted by wallet successfully. But nomp gives the error in console: "We thought a block was found but it was rejected by the daemon"

Code:
2014-07-13 18:29:06 [Pool]      [yacoin] (Thread 1) We thought a block was found but it was rejected by the daemon, share data: {"job":"387","ip":"192.168.1.101","port":3333,"worker":"ya.R9270X","height":629143,"blockReward":58760000,"difficulty":1,"shareDiff":"510.48249361","blockDiff":388.841603072,"blockDiffActual":0.005933252,"blockHash":"fe1b703bf84eae45499dc7a186279fc6bd5dcb82591537739303f283884fce06"}
2014-07-13 18:29:06 [Pool]      [yacoin] (Thread 1) Share accepted at diff 1/510.48249361 by ya.R9270X [192.168.1.101]

Why is the block hash so weird? (not filled with leading zeroes)



So info about block doesn't stored in mysql base. And MPOS doesn't see any blocks found.


Can you make tutorial config stratum ?


Title: Re: Stratum Pool Server [Node.js] (supports POS/POW, SHA/Scrypt/Quark/X11, Vardiff)
Post by: Elmit on August 14, 2014, 05:17:22 AM

node init.js   gives me:
Quote
events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: bind EACCES
    at errnoException (net.js:904:11)
    at net.js:1072:30
    at Object.5:1 (cluster.js:592:5)
    at handleResponse (cluster.js:171:41)
    at respond (cluster.js:192:5)
    at handleMessage (cluster.js:202:5)
    at process.emit (events.js:117:20)
    at handleMessage (child_process.js:322:10)
    at Pipe.channel.onread (child_process.js:349:11)
2014-08-14 13:10:05 [Master]    [Website] Website process died, spawning replacement...



sudo node init.js

Quote
events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: bind EADDRINUSE
    at errnoException (net.js:904:11)
    at net.js:1084:30
    at Object.8:1 (cluster.js:592:5)
    at handleResponse (cluster.js:171:41)
    at respond (cluster.js:192:5)
    at handleMessage (cluster.js:202:5)
    at process.emit (events.js:117:20)
    at handleMessage (child_process.js:322:10)
    at child_process.js:396:7
    at process.handleConversion.net.Native.got (child_process.js:91:7)
2014-08-14 12:56:51 [Master]    [Website] Website process died, spawning replacement...

/etc/apache2/sites-available/coins.abc.com.conf  looks like:
Quote
<VirtualHost *:80>
    ServerAdmin ronald@me.com
    ServerName coins.abc.com

    DocumentRoot /var/www/html/coins
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>


config.json includes:
Quote
"website": {
        "enabled": true,
        "host": "127.0.0.1",
        "port": 80,
        "stratumHost": "coins.abc.com",
        "stats": {
            "updateInterval": 60,
            "historicalRetention": 43200,
            "hashrateWindow": 300
        },
        "adminCenter": {
            "enabled": true,
            "password": "1234"
        }
    },

I tried as host ip 0.0.0.0   and my real ip 1.2.3.4

What am I missing?


Title: Re: Stratum Pool Server [Node.js] (supports POS/POW, SHA/Scrypt/Quark/X11, Vardiff)
Post by: lifeforcepools on October 27, 2014, 11:18:00 PM
I have a question - I'm running a guncoin pool now which is scrypt, but they're switching to neo-scrypt?

will this products support neo-scrypt and if so what changes to I need to make. I installed the stratum from git source about 10 week ago

thanks


Title: Re: Stratum Pool Server [Node.js] (supports POS/POW, SHA/Scrypt/Quark/X11, Vardiff)
Post by: drwatson84 on July 09, 2015, 04:15:43 AM
I have installed nomp + MPOS,  it's working and accepting shares and blocks are being solved but it's not displaying in the list of solved blocks neither in the block Explorer. There are transactions in the central wallet of solved blocks.
What could be the problem?


Title: Re: Stratum Pool Server [Node.js] (supports POS/POW, SHA/Scrypt/Quark/X11, Vardiff)
Post by: coinmyne on September 10, 2015, 06:17:31 PM
On updating npm, I get the following, at the end of the output:

Code:
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23)
gyp ERR! stack     at ChildProcess.emit (events.js:110:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Linux 3.19.0-28-generic
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/tom/nomp/node_modules/stratum-pool/node_modules/multi-hashing
gyp ERR! node -v v0.12.7
gyp ERR! node-gyp -v v2.0.2
gyp ERR! not ok
npm ERR! Linux 3.19.0-28-generic
npm ERR! argv "node" "/usr/local/bin/npm" "update"
npm ERR! node v0.12.7
npm ERR! npm  v2.14.2
npm ERR! code ELIFECYCLE

npm ERR! multi-hashing@0.0.9 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the multi-hashing@0.0.9 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the multi-hashing package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls multi-hashing
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/tom/nomp/npm-debug.log

and on trying node init.js, I get:

Code:
module.js:338
    throw err;
          ^
Error: Cannot find module 'stratum-pool'
    at Function.Module._resolveFilename (module.js:336:15)
    at Function.Module._load (module.js:278:25)
    at Module.require (module.js:365:17)
    at require (module.js:384:17)
    at Object.<anonymous> (/home/tom/nomp/libs/poolWorker.js:1:77)
    at Module._compile (module.js:460:26)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Module.require (module.js:365:17)

Any advice on how to fix it?

npm is version 2.14.2
node is version 0.12.7

Thanks.


Title: Re: Stratum Pool Server [Node.js] (supports POS/POW, SHA/Scrypt/Quark/X11, Vardiff)
Post by: AndreyNag on November 18, 2015, 09:20:11 PM
Quote
Error: Cannot find module 'stratum-pool'
try "npm install stratum-pool"