Author

Topic: NodeJS stratum-client (Read 117 times)

newbie
Activity: 1
Merit: 0
December 13, 2017, 08:37:48 PM
#1
stratum-client
A NodeJS based stratum client for communication with stratum pool

Installation
Code:
$ npm i stratum-client --save

Code:
const client = require('stratum-client');
client({
  server: "stratum.slushpool.com",
  port: 3333,
  worker: "arnabk.1",
  autoReconnectOnError: true,
  onConnect: () => console.log('Connected to server'),
  onClose: () => console.log('Connection closed'),
  onError: (error) => console.log('Error', error.message),
  onAuthorize: () => console.log('Worker authorized'),
  onNewDifficulty: (newDiff) => console.log('New difficulty', newDiff),
  onSubscribe: (subscribeData) => console.log('[Subscribe]', subscribeData),
  onNewMiningWork: (newWork) => console.log('[New Work]', newWork),
});

worker is required in order for onNewMiningWork() to receive new work continuously

Open Source - https://github.com/arnabk/stratum-client/
Jump to: