Bunkercoin is architected as a modular system where each Rust module encapsulates specific functionality. This design enables independent development, testing, and potential replacement of components without affecting the overall system stability.
Command-line interface, application coordination, and peer synchronization logic. Handles all user interactions and orchestrates the various subsystems.
Transaction Events: All modules → web.rs broadcast
Error Reporting: Distributed logging via web.rs
Architectural Principles
Separation of Concerns
Each module has a clearly defined responsibility. Cryptographic operations are isolated in wallet.rs and transaction.rs, network communication is handled by web.rs and network.rs, and core logic resides in blockchain.rs.
Minimal Dependencies
Cross-module dependencies are kept to the absolute minimum. The lib.rs file shows the complete module structure, and most modules only depend on shared data structures rather than complex functionality.
Radio-Optimized Design
All modules are designed with radio communication constraints in mind. Data structures are compact, operations are deterministic, and timing is predictable to enable reliable HF radio propagation.
Thread Safety
Shared state is protected by Arc wrappers, enabling safe concurrent access across async tasks. This allows the HTTP server, mining loop, and peer synchronization to operate simultaneously.