Expand description
§P2P Foundation
A next-generation peer-to-peer networking foundation built in Rust.
§Features
- QUIC-based transport for modern networking
- IPv6-first with comprehensive tunneling support
- Kademlia DHT for distributed routing
- Built-in MCP server for AI capabilities
- Minimal dependencies and small footprint
§Example
use p2p_foundation::{P2PNode, NodeConfig};
#[tokio::main]
async fn main() -> anyhow::Result<()> {
let node = P2PNode::builder()
.listen_on("/ip6/::/tcp/9000")
.with_mcp_server()
.build()
.await?;
node.run().await?;
Ok(())
}
Re-exports§
pub use network::P2PNode;
pub use network::NodeConfig;
pub use network::NodeBuilder;
pub use network::P2PEvent;
pub use dht::Key;
pub use dht::Record;
pub use mcp::MCPServer;
pub use mcp::Tool;
pub use mcp::MCPService;
pub use production::ProductionConfig;
pub use production::ResourceManager;
pub use production::ResourceMetrics;
pub use bootstrap::BootstrapManager;
pub use bootstrap::BootstrapCache;
pub use bootstrap::ContactEntry;
pub use bootstrap::CacheConfig;
pub use error::P2PError;
pub use error::Result;
Modules§
- bootstrap
- Bootstrap cache for decentralized peer discovery Bootstrap Cache System
- dht
- Distributed Hash Table implementation Distributed Hash Table (DHT) Implementation
- error
- Error types Error types module
- identity
- User identity and privacy system User Identity and Privacy System
- mcp
- Model Context Protocol server Model Context Protocol (MCP) Server Implementation
- network
- Network core functionality Network module
- production
- Production hardening features Production hardening features for the P2P Foundation
- security
- Security and cryptography Security module
- transport
- Transport layer (QUIC, TCP) Transport Layer
- tunneling
- IPv6/IPv4 tunneling protocols IPv6/IPv4 Tunneling Implementation
- utils
- Utility functions and types Utilities module placeholder
Constants§
- VERSION
- P2P Foundation version