How radicle-dev/heartwood works
Main system components
• Command-Line Interface: Represented by the radicle-cli crate. This is the user-facing component allowing for interactions with the Radicle network.
• Network Daemon: The radicle-node component that handles the decentralized networking, data storage, and node-specific functionalities.
• HTTP Daemon: The radicle-httpd that provides an HTTP API layer (and potentially additional UI elements) which leverages an underlying framework (Axum, indicated by files like axum_extra.rs).
• Supporting Libraries/Services: Several “radicle-” prefixed crates each serve a different purpose:
• radicle-cob for collaboration objects and change management.
• radicle-crdt for conflict-free replicated data types ensuring eventual consistency.
• radicle-crypto for cryptographic operations, particularly related to SSH.
• radicle-dag, radicle-fetch, and radicle-remote-helper for handling data fetching, git operations, and remote interactions.
• radicle-ssh for secure shell interactions.
• radicle-term for terminal UI and formatting output.
• radicle-tools to provide extra utility commands.
• Build & Deployment Tools: There are Dockerfiles, systemd service definitions, and various build scripts which indicate containerization and service management aspects.
• External Dependencies & Environment: The repository includes configurations for Docker, systemd, and potentially a seed node from which binaries are installed or synchronized.
Relationships and interactions
• The CLI (radicle-cli) acts as a front-end interface that interacts with radicle-node and other services by issuing commands which then trigger operations in the supporting crates.
• External services such as Docker deployments and systemd-managed services should be included to represent the production environment and operational glue.
Architectural patterns and design principles
• Modular Design: The project is divided into separate crates, clearly defining boundaries between the CLI, node, HTTP layer, and utility libraries. Represent each crate as a distinct module.
• Layered Architecture: There is a clear separation between the user interface (CLI/HTTP) and core network/data processing (radicle-node, radicle-cob, etc.). Mark this separation clearly.
• Distributed/Peer-to-Peer Communication: Emphasize the decentralized aspect by illustrating peer-to-peer links (gossip protocols) and data replication between nodes.
• Build & Deployment Automation: Indicate that the system is built using Rust’s Cargo, with additional deployment configurations using Docker, systemd, and scripts for CI/CD.