Git Product home page Git Product logo

ravencoin-stratum-server's Introduction

Ravencoin Stratum Server

NPM Package

Stratum Conversion to TypeScript from Ravencoin Stratum Server.

Getting Started

# Using npm
npm install @ravenite/ravencoin-stratum-server

# Using yarn
yarn add @ravenite/ravencoin-stratum-server

Usage

import { createPool } from '@ravenite/ravencoin-stratum-server'

const options = {...}

function authorizeFn() {...}

const pool = new createPool(options, authorizeFn)

pool.start()

Authorize Function Example

function authorizeFn(
  ip,
  port,
  workerName,
  password,
  extraNonce1,
  version,
  callback
) {
  // Your Auth Handler
  handlers.auth(port, workerName, password, function(authorized) {
    var authString = authorized ? 'Authorized' : 'Unauthorized ';
    logger.debug(
      'AUTH>TRUE> authstr [%s] worker [%s] passwd [%s] ip [%s]',
      authString,
      workerName,
      password,
      functions.anonymizeIP(ip)
    );
    // Callback to Stratum Server
    callback({
      error: null,
      authorized: authorized,
      disconnect: false,
    });
  });
}

Options

{
  "address": "xxxxxx",
  "blockRefreshInterval": 400,
  "coin": {
    "algorithm": "kawpow",
    "name": "ravencoin",
    "reward": "POS",
    "symbol": "RVN"
  },
  "connectionTimeout": 600,
  "daemons": [
    {
      "host": "127.0.0.1",
      "port": 8766,
      "user": "user1",
      "password": "pass1"
    }
  ],
  "feePercent": 0,
  "initStats": {
    "updateInterval": 900,
    "historicalRetention": 43200,
    "hashrateWindow": 900
  },
  "jobRebroadcastTimeout": 25,
  "p2p": {
    "enabled": false,
    "host": "127.0.0.1",
    "port": 8767,
    "disableTransactions": true
  },
  "ports": {
    "10008": {
      "diff": 0.05,
      "varDiff": {
        "minDiff": 0.025,
        "maxDiff": 1024,
        "targetTime": 10,
        "retargetTime": 60,
        "variancePercent": 30,
        "maxJump": 25
      }
    },
    "10016": {
      "diff": 0.1,
      "varDiff": {
        "minDiff": 0.05,
        "maxDiff": 1024,
        "targetTime": 10,
        "retargetTime": 60,
        "variancePercent": 30,
        "maxJump": 25
      }
    },
    "10032": {
      "diff": 0.2,
      "varDiff": {
        "minDiff": 0.1,
        "maxDiff": 1024,
        "targetTime": 10,
        "retargetTime": 60,
        "variancePercent": 30,
        "maxJump": 50
      }
    },
    "10256": {
      "diff": 1024000000,
      "varDiff": {
        "minDiff": 1024000000,
        "maxDiff": 20480000000,
        "targetTime": 10,
        "retargetTime": 60,
        "variancePercent": 30,
        "maxJump": 25
      }
    }
  },
  "rewardRecipients": {
    "xxxxxx": 0.5
  },
  "tcpProxyProtocol": false,
  "testnet": true
}
Property Type
address string // pool address
api any (optional)
banning Banning (optional)
blockRefreshInterval number
coin Coin
connectionTimeout number
daemons Daemon[]
feePercent number
jobRebroadcastTimeout number
kawpow_validator string (optional)
kawpow_wrapper_host string (optional)
kawpow_wrapper_port number (optional)
p2p P2p
poolAddressScript any
ports Record<string, Port>
rewardRecipients Record<string, number> // address:percentage
tcpProxyProtocol boolean
testnet boolean (optional)

Port

Property Type
diff number
tls tls.TLSSocket
varDiff object

varDiff

Property Type
maxDiff number
maxJump number
minDiff number
retargetTime number
targetTime number
variancePercent number

Coin

Property Type Value
algorithm string // kawpow kawpow
name string // ravencoin ravencoin
peerMagic string (optional)
peerMagicTestnet string (optional)
reward string 'POS' 'POW'
symbol string RVN

P2p

Property Type
enabled boolean (optional)
host string
port number
disableTransactions boolean (optional)

Daemon

Property Type
host string
port number
user string
password string

License

Code released under the GPL-3.0 license.

ravencoin-stratum-server's People

Contributors

michaelmcshinsky 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.