A NodeJS based stratum client for communication with stratum pool
Installation
$ npm i stratum-client --save
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/