Giter Club home page Giter Club logo

hstratum's Introduction

hstratum

A segwit-capable stratum server on top of hsd. This is a hsd plugin which will run a stratum server in the same process as a hsd fullnode.

Usage

hstratum can be used as a hsd plugin.

$ hsd --plugins hstratum \
  --stratum-host :: \
  --stratum-port 3008 \
  --stratum-public-host pool.example.com \
  --stratum-public-port 3008 \
  --stratum-max-inbound 1000 \
  --stratum-difficulty 8 \
  --stratum-dynamic \
  --stratum-password=admin-pass

Cutting out the middleman

While having a stratum+fullnode marriage violates separation of concerns, it provides a benefit to large competitive miners: because it sits in the same process, there is no overhead of hitting/longpolling a JSON-rpc api to submit or be notified of new blocks. It has direct in-memory access to all of the data it needs. No getwork or getblocktemplate required.

It can also broadcast submitted blocks before verifying and saving them to disk (since we created the block and know it's going to be valid ahead of time).

Single point of failure?

There's nothing to say you can't have multiple hsd-nodes/stratum-servers behind a reverse/failover proxy still. It's only a single point of failure if you treat it that way.

Payouts

Shares are currently tracked by username and will be dumped to ~/.hsd/stratum/shares/[height]-[hash].json when a block is found. A script can parse through these later and either add the user's balance to a webserver or pay directly to an address. Users are stored in a line-separated json file in ~/.hsd/stratum/users.json.

Administration

hstratum exposes some custom stratum calls: mining.authorize_admin('password') to auth as an admin and mining.add_user('username', 'password') to create a user during runtime.

Todo

  • Reverse/failover proxy for HASH(sid)->hsd-stratum-ip.

Contribution and License Agreement

If you contribute code to this project, you are implicitly allowing your code to be distributed under the MIT license. You are also implicitly verifying that all code is your original work. </legalese>

License

Copyright (c) 2017-2018, Christopher Jeffrey (MIT License). Copyright (c) 2019, Handshake Alliance (MIT License).

See LICENSE for more info.

hstratum's People

Contributors

alexsmith540 avatar kilpatty avatar pinheadmz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

pinheadmz

hstratum's Issues

Coinbase address not set error on startup

I get an error No addresses available for coinbase. if I follow the instructions in the readme if I do not set the flag --coinbase-address. I don't think that its immediately obvious for somebody new to the codebase that the --coinbase-address flag would fix it. Maybe that could be added to the readme?

It would also be ideal to generate a new coinbase address each for each successive block found, to prevent address reuse. That is definitely a nice to have.

Bug: Currently fails on bad input

If a bad input is sent in to the tcp socket, it crashes both the node and stratum server.

We should handle bad input by just throwing it away completely and ensuring that the server stays alive.

config: Warn user if password is not set

Currently if password is not set in the configuration, then there is no admin that is generated. We should ensure that this is a easy to see warning for the user, so that this does not cause problems later.

As a sidenote: This warning should be similar to the warning that we want in hstratum when there is no config. So a solution here also will be a solution for hstratum.

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.