Overview
TAPLE Core provides a library for instantiating nodes of this DLT to create a functional network through a single structure containing all required logic. The architecture is designed around an event-driven model with multiple coordinating components.From the source code (lib.rs:2-4):
“TAPLE is a DLT focused on traceability characterized by its level of scalability, its flexibility to be employed in different devices and use cases and its reduced resource consumption, including power consumption.”
Core Components
TAPLE’s architecture consists of several key managers that coordinate through asynchronous message passing:Node Structure
The mainNode struct orchestrates all components and provides the entry point for the system:
Component Architecture
TAPLE is built on a modular architecture with the following key components:1. Event Manager
Manages the lifecycle of events from creation through completion. Coordinates with governance and ledger managers to process event requests.2. Ledger Manager
Responses for maintaining the distributed ledger, storing events, and managing subject state:3. Governance Manager
Handles governance contracts and policies that define network rules, schemas, and permissions.4. Protocol Manager
Manages the TAPLE protocol messages, routing incoming messages to appropriate handlers.5. Network Processor
Handles peer-to-peer networking using libp2p:6. Evaluator Manager (Optional Feature)
Executes smart contracts to evaluate state transitions:7. Validation Manager (Optional Feature)
Validates events according to governance rules and cryptographic verification. Source: node.rs:273-2828. Approval Manager (Optional Feature)
Manages the approval process for events that require explicit approval from designated approvers. Source: node.rs:246-2579. Distribution Manager
Handles event distribution across the network to relevant nodes. Source: node.rs:259-270Communication Pattern
All components communicate through asynchronous channels using theMpscChannel pattern:
This message-passing architecture ensures loose coupling between components and enables concurrent processing of operations.
Database Layer
TAPLE uses a generic database abstraction allowing different storage backends:Arc for shared access across components:
Lifecycle Management
The node lifecycle is managed through:- Initialization:
Node::build()creates and wires all components - Execution: Each component runs in its own tokio task
- Shutdown: Coordinated graceful shutdown via
CancellationToken
Notification System
Applications receive notifications about important events through a channel:Key Design Principles
- Modularity: Each component has a single, well-defined responsibility
- Asynchronous: All operations are non-blocking using Tokio async runtime
- Type Safety: Strong typing with generics for database and collection types
- Flexibility: Feature flags allow customization of included components
- Scalability: Message passing architecture enables horizontal scaling
Next Steps
Governance
Learn how governance controls network behavior
Subjects
Understand subjects and their lifecycle
Events
Explore the event-driven model
Cryptography
Dive into cryptographic schemes
