Skip to content

read-docs/rtrnt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

rtrnt

A terminal-based BitTorrent client written in Rust.

Overview

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.

Features

  • πŸš€ 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

Dependencies

  • 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

Project Structure

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)

How It Works

  1. Torrent Parsing - Reads and parses .torrent files, extracting metadata and calculating info hash
  2. Tracker Announce - Contacts trackers to discover peers in the swarm
  3. Peer Handshake - Establishes connections with peers using the BitTorrent protocol
  4. Piece Download - Downloads file pieces in 16KB blocks from multiple peers concurrently
  5. Verification - Validates each piece against its SHA-1 hash before assembly

About

Rust bittorrent client in terminal

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages