| Crates.io | crdtosphere |
| lib.rs | crdtosphere |
| version | 0.1.0 |
| created_at | 2025-06-05 18:35:33.963786+00 |
| updated_at | 2025-06-05 18:35:33.963786+00 |
| description | Universal embedded CRDTs for distributed coordination across automotive, robotics, IoT, and industrial applications |
| homepage | https://github.com/vertexclique/crdtosphere |
| repository | https://github.com/vertexclique/crdtosphere |
| max_upload_size | |
| id | 1702094 |
| size | 998,544 |

CRDTosphere is a comprehensive no_std Rust library implementing Conflict-free Replicated Data Types (CRDTs) optimized for embedded systems. It provides ultra-efficient, configurable CRDT implementations for automotive, robotics, IoT, and industrial applications across multiple platforms.
This library is intended for NON-SAFETY-CRITICAL applications only. While CRDTosphere includes safety-oriented features and compliance support frameworks, it should NOT be used for safety-critical functions such as:
Recommended Use Cases:
The automotive examples in this library are for educational and demonstration purposes only. Any production automotive use should be limited to non-safety-critical domains such as infotainment, user preferences, and diagnostic data collection.
Add CRDTosphere to your Cargo.toml:
[dependencies]
crdtosphere = { version = "0.1", default-features = false }
# Enable platform-specific optimizations
[features]
stm32 = ["crdtosphere/stm32"]
# OR
aurix = ["crdtosphere/aurix"]
Configure memory for your platform:
#![no_std]
use crdtosphere::prelude::*;
// Define memory configuration for your platform
define_memory_config! {
name: MyPlatformConfig,
total_memory: 32 * 1024, // 32KB budget
max_registers: 100,
max_counters: 50,
max_sets: 20,
max_maps: 10,
max_nodes: 32,
}
// Use configurable CRDTs
let mut sensor_reading = LWWRegister::<i16, MyPlatformConfig>::new();
sensor_reading.set(42, clock.now());
// Automatic conflict resolution
sensor_reading.merge(&other_node_reading)?;
| Platform | Architecture | Memory | Use Cases |
|---|---|---|---|
| AURIX TC3xx/TC4xx | TriCore/ARM Cortex-R52 | 240KB-1MB | Automotive ECUs, safety systems |
| STM32 Series | ARM Cortex-M0/M3/M4/M7 | 4KB-2MB | General embedded, IoT, robotics |
| ARM Cortex-M | M0/M0+/M3/M4/M7 | 2KB-1MB+ | IoT devices, sensor networks |
| RISC-V | RV32I/M/A/C | 32KB-8MB+ | Edge computing, custom applications |
// Multi-ECU sensor fusion with ISO 26262 compliance
let mut temp_fusion = AutomotiveSensorFusion::<i16, AutomotiveConfig>::new();
temp_fusion.add_reading(85, ecu_1_clock, SENSOR_RELIABILITY_HIGH);
temp_fusion.add_reading(87, ecu_2_clock, SENSOR_RELIABILITY_MEDIUM);
let consensus_temp = temp_fusion.consensus_value();
// Multi-robot task allocation
let mut task_allocation = RobotTaskAllocation::<RoboticsConfig>::new();
task_allocation.assign_task(task_id, robot_id, clock.now());
// Device mesh coordination
let mut device_mesh = DeviceMesh::<IoTConfig>::new();
device_mesh.add_device(device_id, capabilities, clock.now());
// Equipment health monitoring
let mut equipment_health = EquipmentHealth::<IndustrialConfig>::new();
equipment_health.record_vibration(machine_id, level, clock.now());
Pre-configured setups for common platforms:
// High-performance automotive ECU
use crdtosphere::configs::AutomotiveECUConfig; // 128KB budget
// General embedded device
use crdtosphere::configs::STM32F4Config; // 32KB budget
// Constrained IoT sensor
use crdtosphere::configs::IoTSensorConfig; // 4KB budget
// Industrial controller
use crdtosphere::configs::IndustrialConfig; // 256KB budget
| Type | Description | Memory | Use Case |
|---|---|---|---|
| LWWRegister | Last-writer-wins register | 5-16 bytes | Sensor readings, configuration |
| GCounter | Grow-only counter | 8-32 bytes | Event counting, telemetry |
| ORSet | Observed-remove set | 6-64 bytes | Feature flags, device lists |
| LWWMap | Last-writer-wins map | Variable | Key-value configuration |
We welcome contributions! Please see our Contributing Guide for details.
Licensed under either of
at your option.