0.0.17 • Published 5 years ago

js-stratum-proxy v0.0.17

Weekly downloads
2
License
ISC
Repository
github
Last release
5 years ago

js-stratum-proxy

Proxy stratum mining either programatically or staticlly to your desired stratum mining pool.

Install

npm i js-stratum-proxy

Example Usage

You may choose which pools to proxy to by overiding handleAuthorization. The object you return will be used to create a connection with the pool.

const net = require('net');
const StratumProxy = require('js-stratum-proxy');

class MyStratumProxy extends StratumProxy {
  async handleAuthorization(address, minerName) {
    const { poolAddress, poolPort } = await getPoolDataForAddressFromSomewhere(address);
    
    // Make sure you return an object with these keys
    return { address, minerName, poolAddress, poolPort };
  }
}

const app = net.createServer(socket => {
  const connection = new MyStratumProxy(socket);

  connection.on('connected', () => console.log('connected'));
  connection.on('data', data => console.log('data', data));
  connection.on('error', error => console.log('error', error));
  connection.on('disconnected', () => console.log('disconnected'));
});

app.listen(3333, () => {
  console.log(`Proxy server listening at port 3333`);
});
0.0.17

5 years ago

0.0.16

6 years ago

0.0.15

6 years ago

0.0.14

6 years ago

0.0.13

6 years ago

0.0.12

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago