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 three main modules:
network_helpers- High-level networking utilities (fromnetwork_helpers_sv2)config_helpers- Configuration management helpers (fromconfig_helpers_sv2)rpc- RPC utilities with custom serializable types (fromrpc_sv2) - feature-gated
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.
Quick Start
Add to your Cargo.toml:
[]
= { = "0.1.0", = ["pool"] }
Basic usage:
use ;
// For RPC functionality (when rpc feature is enabled)
use ;
Features
Core Features
network- Networking utilities (enabled by default)config- Configuration helpers (enabled by default)rpc- RPC utilities with custom serializable types (optional)- Provides
Hash,BlockHash,Amounttypes with proper JSON serialization MiniRpcClientfor Bitcoin RPC communication
- Provides
Protocol Features
sv1- Enable SV1 protocol support (includes translation utilities)with_buffer_pool- Enable buffer pooling for better performance
Role-Specific Bundles
pool- Everything needed for pool applicationsjd_client- Everything needed for JD client applicationsjd_server- Everything needed for JD server applications (includes RPC)translator- Everything needed for translator applications (includes SV1 + translation)mining_device- Everything needed for mining device applications
Usage Examples
Pool Application
[]
= { = "1.0", = ["pool"] }
use ;
// Use networking
let connection = new.await?;
// Use configuration
let config: PoolConfig = parse_config?;
JD Server Application
[]
= { = "1.0", = ["jd_server"] }
use ;
// RPC functionality with custom types
use ;
// All networking and configuration utilities available
// Plus RPC server utilities with proper serialization