Expand description
Content routing optimizer for efficient content discovery and retrieval.
This module provides intelligent routing algorithms to find and retrieve content from the optimal peers in the network. It combines peer selection, network topology, content availability, and caching strategies.
§Example
use chie_core::{ContentRouter, RoutingStrategy, PeerContentLocation};
let mut router = ContentRouter::new();
// Register content locations
router.register_location("QmContent123", PeerContentLocation {
peer_id: "peer1".to_string(),
cid: "QmContent123".to_string(),
availability_score: 0.95,
last_verified: std::time::SystemTime::now(),
chunk_count: 100,
complete: true,
});
// Find optimal peers for content
let peers = router.find_peers("QmContent123", 3);
println!("Found {} peers with content", peers.len());Structs§
- Content
Router - Content router for intelligent content discovery.
- Peer
Content Location - Represents a content location (peer hosting content).
- Routing
Stats - Content routing statistics.
Enums§
- Routing
Strategy - Routing strategy for content discovery.