Giter Club home page Giter Club logo

rust-stratum-v2's Introduction

workflow

Rust Stratum V2

A WIP library implementation of the Stratum V2 Protocol.

The detailed spec can be found here.

Building

The library can be built and tested using cargo:

git clone [email protected]:ccdle12/rust-stratum-v2.git
cd rust-stratum-v2
cargo build

Tests

You can run tests with:

cargo test

Please refer to the cargo documentation for more detailed instructions.

See fuzz tests for instructions on how to run fuzzing.

Documentation

Documentation can be built locally using cargo:

cargo doc --no-deps --open

Examples

Examples can be found here and the README contains instructions on how to run the examples.

rust-stratum-v2's People

Contributors

ccdle12 avatar chpatton013 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

rust-stratum-v2's Issues

job_negotiation module is missing messages

The following message struct and implementations are missing from the job_negotiation sub-protocol module:

  1. AllocateMiningJobToken(Client->Server)
  2. AllocateMiningJobToken.Success(Server -> Client)
  3. CommitMiningJob (Client -> Server)
  4. CommitMiningJob.Success (Server->Client)
  5. CommitMiningJob.Error (Server->Client)
  6. IdentifyTransactions (Server->Client)
  7. IdentifyTransactions.Success (Client->Server)
  8. ProvideMissingTransactions (Server->Client)
  9. ProvideMissingTransactions.Success (Client->Server)

template_distribution module is missing

A template_distribution module should exist to cover the Template Distribution Sub-Protocol with the following messages:

  1. CoinbaseOutputDataSize (Client -> Server)
  2. NewTemplate (Server -> Client)
  3. SetNewPrevHash (Server -> Client)
  4. RequestTransactionData (Client -> Server)
  5. RequestTransactionData.Success (Server->Client)
  6. RequestTransactionData.Error (Server->Client)
  7. SubmitSolution (Client -> Server)

Note that this protocol does not have any mention of available protocol flags, but should probably be implemented as an empty variant for the sake of consistency.

Create a STR_255 type

Create a STR_255 type that is an array of bytes limited to 255. Implement traits From and Into to do conversion to String representation.

STR_255 should be a [u8, 255].

  • When converting From a String with a byte length greater than 255, convert up to 255 and drop the rest of the bytes.

  • Create a types.rs file in messages module.

  • Obviously unit test

Redesign STR0_255 types

Create a STR0_255 type and apply the From trait for str and String.

Return an error if the String is greater then 255 bytes.

Move/refactor or implement tests for all the Messages in stratumv2-lib

  • There should be test coverage for all the stratumv2 messages, including initialization, serialization, deserialization, framing and unframing.
  • SetupConnection
  • SetupConnectionError
  • SetupConnectionSuccess
  • OpenExtendedChannel
  • OpenExtendedChannelError
  • OpenExtendedMiningChannelSuccess
  • OpenStandardMiningChannel
  • OpenStandardMiningChannelError
  • OpenStandardMiningChannelSuccess

Refactor and add restrictions to SetupConnection message

Clients that are not configured to provide telemetry data to the upstream node SHOULD 
set device_id to 0-length strings. However, they MUST always set vendor to a string 
describing the manufacturer/developer and firmware version and SHOULD always set 
hardware_version to a string describing, at least, the particular hardware/software package in use.

Words such as SHOULD and MUST defined in rfc2119

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.