Bitcoin Forum
November 09, 2024, 09:04:06 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: NodeJS stratum-client  (Read 114 times)
arnabkar (OP)
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile
December 14, 2017, 01:37:48 AM
 #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/
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!