Module content_router

Module content_router 

Source
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§

ContentRouter
Content router for intelligent content discovery.
PeerContentLocation
Represents a content location (peer hosting content).
RoutingStats
Content routing statistics.

Enums§

RoutingStrategy
Routing strategy for content discovery.