0.0.17 • Published 6 years ago

js-stratum-proxy v0.0.17

Weekly downloads
2
License
ISC
Repository
github
Last release
6 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

6 years ago

0.0.16

7 years ago

0.0.15

7 years ago

0.0.14

7 years ago

0.0.13

7 years ago

0.0.12

7 years ago

0.0.11

7 years ago

0.0.10

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago