A terminal-based BitTorrent client written in Rust.
rtrnt is a lightweight BitTorrent client implementation built with Rust, designed to download files from torrent networks through the terminal. It supports both HTTP and UDP tracker protocols and implements the core BitTorrent peer protocol for efficient file downloads.
- π Async/Await Architecture - Built with Tokio for high-performance concurrent downloads
- π Multi-Protocol Support - Compatible with both UDP and HTTP trackers
- π Peer Protocol Implementation - Full BitTorrent peer wire protocol support
- β‘ Parallel Downloads - Concurrent piece downloading from multiple peers
- π Data Integrity - SHA-1 hash verification for downloaded pieces
- π¦ Bencode Support - Native torrent file parsing
- tokio - Async runtime
- serde & serde_bencode - Torrent file parsing
- sha1 - Piece hash verification
- reqwest - HTTP tracker communication
- clap - Command-line interface
- indicatif - Progress tracking
- anyhow - Error handling
src/
βββ main.rs # Entry point
βββ download.rs # Download coordination and piece management
βββ peer.rs # Peer connection and message handling
βββ torrent.rs # Torrent file parsing
βββ tracker.rs # Tracker communication (UDP/HTTP)
- Torrent Parsing - Reads and parses .torrent files, extracting metadata and calculating info hash
- Tracker Announce - Contacts trackers to discover peers in the swarm
- Peer Handshake - Establishes connections with peers using the BitTorrent protocol
- Piece Download - Downloads file pieces in 16KB blocks from multiple peers concurrently
- Verification - Validates each piece against its SHA-1 hash before assembly