## 2. Core Object Implement: struct Node - internal runtime - command channel - event broadcast channel - state tracking Public API: - new() -\> Node - start(config: NodeConfig) - stop() - restart(config: NodeConfig) - get_status() -\> NodeStatus - send(destination, data, options) -\> SendReceipt - broadcast(data, options) -\> SendReceipt - set_log_level(level) - subscribe_events() -\> EventSubscription ## 3. Event System NodeEvent union: - StatusChanged - PeerChanged - PacketReceived - PacketSent - Log - Error EventSubscription: - next(timeout_ms) -\> NodeEvent? - close() Ensure: - Thread safe - No panics across FFI boundary - Structured error types ## 4. Error Types NodeError enum: - InvalidConfig - IoError - NetworkError - ReticulumError - AlreadyRunning - NotRunning - Timeout - InternalError
2. Core Object
Implement:
struct Node - internal runtime - command channel - event broadcast
channel - state tracking
Public API:
3. Event System
NodeEvent union:
EventSubscription:
Ensure: - Thread safe - No panics across FFI boundary - Structured error
types
4. Error Types
NodeError enum: