Expand description
§Stratum V2 Mining Protocol Messages Crate
mining_sv2
is a Rust crate that implements a set of messages defined in the Mining protocol
of Stratum V2.
The Mining protocol enables the distribution of work to mining devices and the submission of proof-of-work results.
For further information about the messages, please refer to Stratum V2 documentation - Mining.
§Build Options
This crate can be built with the following features:
§Usage
To include this crate in your project, run:
$ cargo add mining_sv2
For further information about the mining protocol, please refer to Stratum V2 documentation - Mining Protocol.
Structs§
- Close
Channel - Message used by a downstream to close a mining channel.
- Extended
Extranonce - Downstream and upstream are relative to user P. In simple terms, upstream is the part of the protocol that a user P sees when looking above, and downstream is what they see when looking below.
- Extranonce
- Extranonce bytes which need to be added to the coinbase to form a fully valid submission.
- NewExtended
Mining Job - Message used by an upstream to provide an updated mining job to the downstream through Extended or Group Channel only.
- NewMining
Job - Message used by an upstream to provide an updated mining job to downstream.
- Open
Extended Mining Channel - Message used by a downstream to request opening an Extended Channel with an upstream role.
- Open
Extended Mining Channel Success - Message used by upstream to accept [
OpenExtendedMiningChannel
request from downstream. - Open
Mining Channel Error - Message used by upstream to reject
OpenExtendedMiningChannel
or [OpenStandardMiningchannel
] request from downstream. - Open
Standard Mining Channel - Message used by a downstream to request opening a Standard Channel.
- Open
Standard Mining Channel Success - Message used by upstream to accept
OpenStandardMiningChannel
request from downstream. - SetCustom
Mining Job - Message used by downstream role to set a custom job to an upstream (Pool).
- SetCustom
Mining JobError - Message used by upstream to reject
SetCustomMiningJob
request. - SetCustom
Mining JobSuccess - Message used by upstream to accept
SetCustomMiningJob
request. - SetExtranonce
Prefix - Message used by upstream to change downstream node’s extranonce prefix.
- SetGroup
Channel - Message used by upstream to associate a set of Standard Channel(s) to a Group Channel.
- SetNew
Prev Hash - Message used by upstream to share or distribute the latest block hash.
- SetTarget
- Message used by upstream to control the downstream submission rate by adjusting the difficulty target on a specified channel.
- Submit
Shares Error - Message used by upstream to reject
SubmitSharesStandard
orSubmitSharesExtended
. - Submit
Shares Extended - Message used by downstream to send result of its hashing work to an upstream.
- Submit
Shares Standard - Message used by downstream to send result of its hashing work to an upstream.
- Submit
Shares Success - Message used by upstream to accept
SubmitSharesStandard
orSubmitSharesExtended
. - Target
- Target is a 256-bit unsigned integer in little-endian
- Update
Channel - Message used by downstream to notify an upstream about changes on a specified channel.
- Update
Channel Error - Message used by upstream to notify downstream about an error in the
UpdateChannel
message.
Enums§
- Extended
Extranonce Error - Error type for ExtendedExtranonce operations
Constants§
- CHANNEL_
BIT_ CLOSE_ CHANNEL - CHANNEL_
BIT_ MINING_ SET_ NEW_ PREV_ HASH - CHANNEL_
BIT_ NEW_ EXTENDED_ MINING_ JOB - CHANNEL_
BIT_ NEW_ MINING_ JOB - CHANNEL_
BIT_ OPEN_ EXTENDED_ MINING_ CHANNEL - CHANNEL_
BIT_ OPEN_ EXTENDED_ MINING_ CHANNEL_ SUCCESS - CHANNEL_
BIT_ OPEN_ MINING_ CHANNEL_ ERROR - CHANNEL_
BIT_ OPEN_ STANDARD_ MINING_ CHANNEL - CHANNEL_
BIT_ OPEN_ STANDARD_ MINING_ CHANNEL_ SUCCESS - CHANNEL_
BIT_ RECONNECT - CHANNEL_
BIT_ SET_ CUSTOM_ MINING_ JOB - CHANNEL_
BIT_ SET_ CUSTOM_ MINING_ JOB_ ERROR - CHANNEL_
BIT_ SET_ CUSTOM_ MINING_ JOB_ SUCCESS - CHANNEL_
BIT_ SET_ EXTRANONCE_ PREFIX - CHANNEL_
BIT_ SET_ GROUP_ CHANNEL - CHANNEL_
BIT_ SET_ TARGET - CHANNEL_
BIT_ SUBMIT_ SHARES_ ERROR - CHANNEL_
BIT_ SUBMIT_ SHARES_ EXTENDED - CHANNEL_
BIT_ SUBMIT_ SHARES_ STANDARD - CHANNEL_
BIT_ SUBMIT_ SHARES_ SUCCESS - CHANNEL_
BIT_ UPDATE_ CHANNEL - CHANNEL_
BIT_ UPDATE_ CHANNEL_ ERROR - MAX_
EXTRANONCE_ LEN - MESSAGE_
TYPE_ CLOSE_ CHANNEL - MESSAGE_
TYPE_ MINING_ SET_ NEW_ PREV_ HASH - MESSAGE_
TYPE_ NEW_ EXTENDED_ MINING_ JOB - MESSAGE_
TYPE_ NEW_ MINING_ JOB - MESSAGE_
TYPE_ OPEN_ EXTENDED_ MINING_ CHANNEL - MESSAGE_
TYPE_ OPEN_ EXTENDED_ MINING_ CHANNEL_ SUCCESS - MESSAGE_
TYPE_ OPEN_ MINING_ CHANNEL_ ERROR - MESSAGE_
TYPE_ OPEN_ STANDARD_ MINING_ CHANNEL - MESSAGE_
TYPE_ OPEN_ STANDARD_ MINING_ CHANNEL_ SUCCESS - MESSAGE_
TYPE_ SET_ CUSTOM_ MINING_ JOB - MESSAGE_
TYPE_ SET_ CUSTOM_ MINING_ JOB_ ERROR - MESSAGE_
TYPE_ SET_ CUSTOM_ MINING_ JOB_ SUCCESS - MESSAGE_
TYPE_ SET_ EXTRANONCE_ PREFIX - MESSAGE_
TYPE_ SET_ GROUP_ CHANNEL - MESSAGE_
TYPE_ SET_ TARGET - MESSAGE_
TYPE_ SUBMIT_ SHARES_ ERROR - MESSAGE_
TYPE_ SUBMIT_ SHARES_ EXTENDED - MESSAGE_
TYPE_ SUBMIT_ SHARES_ STANDARD - MESSAGE_
TYPE_ SUBMIT_ SHARES_ SUCCESS - MESSAGE_
TYPE_ UPDATE_ CHANNEL - MESSAGE_
TYPE_ UPDATE_ CHANNEL_ ERROR