9 releases (stable)
new 2.0.0 | Mar 28, 2025 |
---|---|
1.2.3 | Jan 8, 2025 |
1.2.1 | Aug 13, 2024 |
1.1.0 | May 24, 2024 |
0.1.1 | Feb 15, 2024 |
#4 in #stratum
4,609 downloads per month
Used in 6 crates
645KB
10K
SLoC
roles_logic_sv2
roles_logic_sv2
provides the core logic and utilities for implementing roles in the Stratum V2 (Sv2) protocol, such as miners, pools, and proxies. It abstracts message handling, channel management, job creation, and routing logic, enabling efficient and secure communication across upstream and downstream connections.
Main Components
- Channel Logic: Manages the lifecycle and settings of communication channels (standard, extended, and group ones) between roles.
- Handlers: Provides traits for handling logic of Sv2 protocol messages.
- Job Management: Facilitates the creation, validation, and dispatching of mining jobs.
- Parsers: Handles serialization and deserialization of Sv2 messages via
binary_sv2
. - Routing Logic: Implements message routing and downstream/upstream selector utilities. Useful for advanced proxy implementations with multiplexing of Standard Channels across different upstreams.
- Utilities: Provides helpers for safe mutex locking, mining-specific calculations, and more.
Usage
To include this crate in your project, run:
cargo add roles_logic_sv2
This crate can be built with the following feature flags:
prop_test
: Enables property-based testing features for template distribution logic, leveraging dependencies' testing capabilities such astemplate_distribution_sv2
crate.disable_nopanic
: Disables the nopanic logic in scenarios where code coverage tools might conflict with it.
Dependencies
~11MB
~152K SLoC