1 unstable release
| 0.1.0 | Feb 8, 2026 |
|---|
#27 in #dht
360KB
7.5K
SLoC
ferripfs-network
IPFS networking with libp2p - DHT, Bitswap, and peer-to-peer connectivity.
Note: This crate is part of ferripfs, a Rust port of Kubo (the Go IPFS implementation). The implementation follows Kubo's core/node/libp2p package and uses the same network protocols for full interoperability.
Features
- libp2p Integration: Full networking stack
- Transport: TCP, QUIC, WebSocket
- Security: Noise encryption, Yamux multiplexing
- Discovery: mDNS, DHT, Bootstrap peers
- NAT Traversal: AutoNAT, relay, hole punching
- Daemon: Background network service
Usage
use ferripfs_network::{Daemon, DaemonConfig};
// Configure daemon
let config = DaemonConfig {
repo_path: "/path/to/repo".into(),
api_addr: "/ip4/127.0.0.1/tcp/5001".parse()?,
gateway_addr: "/ip4/127.0.0.1/tcp/8080".parse()?,
};
// Start daemon
let daemon = Daemon::start(config).await?;
// Get peer info
let info = daemon.id().await?;
println!("Peer ID: {}", info.id);
println!("Addresses: {:?}", info.addresses);
// Connect to peer
daemon.connect("/ip4/1.2.3.4/tcp/4001/p2p/QmPeer...").await?;
// List connected peers
for peer in daemon.peers().await? {
println!("{}: {}", peer.peer, peer.addr);
}
// Shutdown
daemon.shutdown().await?;
Network Protocols
| Protocol | Description |
|---|---|
| Identify | Exchange peer information |
| Ping | Measure latency |
| Kademlia DHT | Peer and content routing |
| Bitswap | Block exchange |
| AutoNAT | NAT detection |
| Relay | Circuit relay for NAT traversal |
License
Dual-licensed under MIT and Apache-2.0.
Dependencies
~26–68MB
~1M SLoC