Coder Social home page Coder Social logo

stratum-proxy's Introduction

Stratum proxy

  • Support for different mining algorithms through one port.
  • Support for mining by several workers for 1 account.
  • Counters of shares for each worker, user, pool and algorithm.
  • Hash rate of each worker.
  • Automatic detection of the mining algorithm for the correct calculation of the hashrate.
  • Registration in a proxy through the API.
  • Metrics in standard Prometheus format.

Supported pools

The mining algorithm is automatically determined based on the pair <pool_host>:<pool_port>, so the proxy only supports connecting to a specific set of pools stored in the database. An API to expand the list of algorithms and pools is not yet available.

Management REST API

The REST API is available at the proxy address http://<web.addr>/api/v1 and now the API has only 1 command for registering credentials for connecting to the pool.

POST /users

{
    "pool": "<host>:<port>",
    "user": "<username>",
    "password": "<password>"
}

Correct answer:

{
    "name": "<name>",
    "error": ""
}

The parameter name is used for identifing the connection and connects to the right pool with the right account. The proxy connection string will look like this:

-o stratum+tcp://<proxy_host>:<proxy_stratum_port> -u <name> -p <any, ignored>

Accounts are not deleted (in the future it is planned to do an automatic deletion after a period of inactivity).

Available metrics

Metrics are available at http://<web.addr>/metrics and include a set of standard Prometheus metrics and custom metrics for monitoring the work of workers.

List of custom metrics

  • proxy_worker_up{"proxy"="<proxy_host>:<proxy_port>", "worker"="<worker_host>:<worker_port>", "user"="<name>"} - the status of the worker. Appears when the worker is connected to the proxy.
  • proxy_pool_up{"proxy"="<proxy_host>:<proxy_port>", "hash"="<hash>", "pool"="<pool_host>:<pool_port>"} - the status of the pool. Appears when a proxy is connected to a pool.
  • proxy_pool_divider{"proxy"="<proxy_host>:<proxy_port>", "hash"="<hash>", "pool"="<pool_host>:<pool_port>"} - the divider of the algorithm of the pool. Appears when a proxy is connected to a pool.
  • proxy_worker_sended{"proxy"="<proxy_host>:<proxy_port>", "worker"="<worker_host>:<worker_port>", "user"="<name>", "hash"="<hash>", "pool"="<pool_host>:<pool_port>"} - counter of the shares sent by the miner.
  • proxy_worker_one_sended{"proxy"="<proxy_host>:<proxy_port>", "worker"="<worker_host>:<worker_port>", "user"="<name>", "hash"="<hash>", "pool"="<pool_host>:<pool_port>"} - counter of the 1-difficulty shares sent by the worker.
  • proxy_worker_accepted{"proxy"="<proxy_host>:<proxy_port>", "worker"="<worker_host>:<worker_port>", "user"="<name>", "hash"="<hash>", "pool"="<pool_host>:<pool_port>"} - counter of the shares received by the pool.
  • proxy_worker_one_accepted{"proxy"="<proxy_host>:<proxy_port>", "worker"="<worker_host>:<worker_port>", "user"="<name>", "hash"="<hash>", "pool"="<pool_host>:<pool_port>"} - counter of the 1-difficulty shares received by the pool.
  • proxy_worker_speed{"proxy"="<proxy_host>:<proxy_port>", "worker"="<worker_host>:<worker_port>", "user"="<name>", "hash"="<hash>", "pool"="<pool_host>:<pool_port>"} - worker speed in hashes per second. Hashrate measurement window - 5 minutes, measurement interval - 1 minute.
  • proxy_worker_difficulty{"proxy"="<proxy_host>:<proxy_port>", "worker"="<worker_host>:<worker_port>", "user"="<name>", "hash"="<hash>", "pool"="<pool_host>:<pool_port>"} - the difficulty set by the pool for the worker.

Changelog.

  • [FIX] Change pool on restore worker connection with other user name.
  • [FIX] Error in restore worker. Session don't remember on worker unexpectable disconnection.
  • [FIX] No disconnect pool before worker death. It's speed up reconnection on miner connection failure.
  • [FIX] Send last work to restored worker.
  • [FIX] Send last difficulty to restored worker.
  • [FIX] Caching last work from pool.
  • [FIX] Delete pprof package including.
  • [FIX] Default Extranonce2Size up to 8.

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.