stratum_apps/lib.rs
1//! # Stratum Apps - SV2 Application Utilities
2//!
3//! This crate consolidates the essential utilities needed for building Stratum V2 applications.
4//! It combines the functionality from the original separate utility crates into a single,
5//! well-organized library with feature-based compilation.
6//!
7//! ## Features
8//!
9//! ### Core Features
10//! - `network` - High-level networking utilities (enabled by default)
11//! - `config` - Configuration management helpers (enabled by default)
12//! - `rpc` - RPC utilities with custom types for JSON-RPC communication (optional)
13//!
14//! ### Role-Specific Feature Bundles
15//! - `pool` - Everything needed for pool applications
16//! - `jd_client` - Everything needed for JD client applications
17//! - `jd_server` - Everything needed for JD server applications (includes RPC)
18//! - `translator` - Everything needed for translator applications (includes SV1)
19//! - `mining_device` - Everything needed for mining device applications
20//!
21//! ## Modules
22//!
23//! - [`network_helpers`] - High-level networking utilities for SV2 connections
24//! - [`config_helpers`] - Configuration management and parsing utilities
25//! - [`rpc`] - RPC utilities with custom serializable types (`Hash`, `BlockHash`, `Amount`)
26
27/// Re-export all the modules from `stratum_core`
28#[cfg(feature = "core")]
29pub use stratum_core;
30
31/// High-level networking utilities for SV2 connections
32///
33/// Provides connection management, encrypted streams, and protocol handling.
34/// Originally from the `network_helpers_sv2` crate.
35#[cfg(feature = "network")]
36pub mod network_helpers;
37
38/// Configuration management helpers
39///
40/// Utilities for parsing configuration files, handling coinbase outputs,
41/// and setting up logging. Originally from the `config_helpers_sv2` crate.
42#[cfg(feature = "config")]
43pub mod config_helpers;
44
45/// Custom Mutex
46///
47/// A wrapper around std::sync::Mutex
48pub mod custom_mutex;
49/// RPC utilities for Job Declaration Server
50///
51/// HTTP-based RPC server implementation for JD Server functionality.
52/// Originally from the `rpc_sv2` crate.
53#[cfg(feature = "rpc")]
54pub mod rpc;
55
56/// Key utilities for cryptographic operations
57///
58/// Provides Secp256k1 key management, serialization/deserialization, and signature services.
59/// Supports both standard and no_std environments.
60pub mod key_utils;
61
62/// Utility methods used in apps.
63pub mod utils;
64
65// Task orchestrator used in SRI apps.
66pub mod task_manager;
67/// Template provider type
68///
69/// Provides the type of template provider that will be used.
70pub mod tp_type;