Git Product home page Git Product logo

kawpow-stratum's Introduction

KAWPoW-Stratum

KAWPoW Standalone implementation for using in a pool or solo mining.

This project has been developed and tested on Node v18.12 and Ubuntu 20.04

Install

NVM (Ubuntu)

# Optional: uninstall current version
sudo apt-get remove node
sudo apt-get remove nodejs

# Install version 10.x
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
source ~/.bashrc
nvm install 18
nvm use 18

Dependencies

# build essentials required to compile kawpow-hasher
sudo apt-get install build-essentials

__Download from Github__
```bash
git clone https://github.com/LabyrinthCore/kawpow-stratum

# install
cd kawpow-stratum
npm install

Usage

The stratum can be used as a module in a pool:

const Stratum = require('kawpow-stratum').Stratum;

class MyStratum extends Stratum {
    /* Override */
    canAuthorizeWorker(client, callback) {
        // implement your own logic
        if (client.minerAddress === 'bad') {
            // do not authorize worker
            callback(null/*error*/, false/*isAuthorized*/);
        }
        else {
            // authorize worker
            callback(null/*error*/, true/*isAuthorized*/);
        }
    }
}

const stratum = new MyStratum({
    coinbaseAddress: 'XyAY3TE3K29nrzQ2oo8JXyVPyGF3f7tq6P', // Only legacy addresses are supported for now
    blockBrand: 'Labyrinth solo miner',
    host: "0.0.0.0",
    port: {
        number: 3010,
        diff: 24 // Generally one share per 20-30 seconds is considered great. A good formula to start is hashrate in MHs*1.5
    },
    rpc: {
        host: '127.0.0.1',
        port: 4571,
        user: 'rpcuser',
        password: 'rpcpassword'
    },
    jobUpdateInterval: 55,
    blockPollIntervalMs: 250
});

stratum.on(Stratum.EVENT_SHARE_SUBMITTED, ev => {
    console.log(ev.share);    
});

stratum.init();

Start Script

There is a start script (start.js) included which contains a ready configuration fir mining.You will need to open and modify the config inside before running it.

> node start.js

kawpow-stratum's People

Contributors

labyrinthcore avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.