Crate common_messages_sv2

Source
Expand description

§Stratum V2 Common Messages Crate.

This crate defines a set of shared messages used across all Stratum V2 subprotocols.

§Build Options

This crate can be built with the following features:

  • std: Enables support for standard library features.
  • quickcheck: Enables support for property-based testing using QuickCheck.

For further information about the messages, please refer to Stratum V2 documentation - Common Messages.

Structs§

CSetupConnection
C representation of SetupConnection
CSetupConnectionError
C representation of SetupConnectionError
ChannelEndpointChanged
Message used by an upstream role for announcing a mining channel endpoint change.
Reconnect
Message used by upstream to redirect downstream connection(s) to a new host.
SetupConnection
Used by downstream to initiate a Stratum V2 connection with an upstream role.
SetupConnectionError
Message used by an upstream role to reject a connection setup request from a downstream role.
SetupConnectionSuccess
Message used by an upstream role to accept a connection setup request from a downstream role.

Enums§

Protocol
This enum has a list of the different Stratum V2 subprotocols.

Constants§

CHANNEL_BIT_CHANNEL_ENDPOINT_CHANGED
CHANNEL_BIT_SETUP_CONNECTION
CHANNEL_BIT_SETUP_CONNECTION_ERROR
CHANNEL_BIT_SETUP_CONNECTION_SUCCESS
MESSAGE_TYPE_CHANNEL_ENDPOINT_CHANGED
MESSAGE_TYPE_RECONNECT
MESSAGE_TYPE_SETUP_CONNECTION
MESSAGE_TYPE_SETUP_CONNECTION_ERROR
MESSAGE_TYPE_SETUP_CONNECTION_SUCCESS
SV2_JOB_DECLARATION_PROTOCOL_DISCRIMINANT
SV2_MINING_PROTOCOL_DISCRIMINANT
SV2_TEMPLATE_DISTRIBUTION_PROTOCOL_DISCRIMINANT

Functions§

_c_export_channel_endpoint_changed
A C-compatible function that exports the ChannelEndpointChanged struct.
_c_export_setup_conn_succ
A C-compatible function that exports the SetupConnection struct.
has_requires_std_job
Helper function to check if REQUIRES_STANDARD_JOBS bit flag present.
has_version_rolling
Helper function to check if REQUIRES_VERSION_ROLLING bit flag present.
has_work_selection
Helper function to check if REQUIRES_WORK_SELECTION bit flag present.