Stratum Apps
Complete Stratum V2 application development kit - all utilities in one crate.
Overview
stratum-apps is a unified crate that provides all the utilities needed for building Stratum V2 applications.
Architecture
This crate is organized into several main modules:
network_helpers- High-level networking utilities (fromnetwork_helpers_sv2)config_helpers- Configuration management helpers (fromconfig_helpers_sv2)payout- Shared payout-mode parsing and coinbase-output distribution helpersfallback_coordinator- Runtime fallback cancellation and acknowledgement helpers
The crate also re-exports stratum-core, the central hub for the Stratum V2 ecosystem that provides a cohesive API for all low-level protocol functionality.
With the bitcoin-core-sv2 feature enabled, it also re-exports bitcoin_core_sv2 runtime APIs.
Quick Start
Add to your Cargo.toml:
[]
= { = "0.4.0", = ["pool"] }
Basic usage:
use ;
Features
Core Features
network- Networking utilities (enabled by default)fallback-coordinator- Runtime fallback coordination helpers (enabled by default)config- Configuration helpers (enabled by default)payout- Shared payout-mode parsing and coinbase-output distribution helpers (optional)monitoring- HTTP and Prometheus monitoring helpers (optional)- Uses vendored Swagger UI assets to support offline/sandboxed documentation builds
std- Standard-library support for key and random utilities (enabled by default)core- Re-export and enablestratum-corebitcoin-core-sv2- Re-export and enablebitcoin_core_sv2
Protocol Features
sv1- Enable SV1 protocol support (includes translation utilities)with_buffer_pool- Enable buffer pooling for better performance
Role-Specific Bundles
pool- Pool application helpers, including networking, config, buffer pooling, core protocol types, payout helpers, and Bitcoin Core IPC runtime APIsjd_client- Job Declaration Client helpers, including networking, fallback coordination, config, buffer pooling, core protocol types, and Bitcoin Core IPC runtime APIsjd_server- Job Declaration Server config helpers and Bitcoin Core IPC runtime APIstranslator- Translator Proxy helpers, including networking, fallback coordination, config, SV1 translation, buffer pooling, and payout helpersmining_device- Mining device config helpers
Third-party applications that only need payout parsing or verification can use the smaller feature set:
[]
= { = "0.4.0", = false, = ["payout"] }
Usage Examples
Pool Application
[]
= { = "0.4.0", = ["pool"] }
use ;
// Use networking
let connection = new.await?;
// Use configuration
let config: PoolConfig = parse_config?;