Skip to content

rohit20001221/ripple

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

17 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

⚑ Minimal BitTorrent Client (Go)

A minimal BitTorrent client written in Go πŸš€ that demonstrates core peer-to-peer file sharing concepts like handshake, piece exchange, and integrity verification.


πŸ“¦ Features

  • 🀝 Peer handshake & connection
  • πŸ“‘ BitTorrent wire protocol support
  • 🧩 Piece-based downloading (16KB blocks)
  • πŸ” SHA-1 integrity verification
  • βš™οΈ Concurrent workers (multi-peer support)
  • πŸ’Ύ Random-access file writing
  • πŸ“Š Download progress tracking
  • πŸ§ͺ CLI flags for flexible usage

πŸ‘¨β€πŸ’» Usage

go run cmd/main.go tmp/sample.torrent tmp/out.md

πŸ—οΈ Architecture

flowchart TD

    A[Torrent File] --> B[Metadata Parser]
    B --> C[Task Generator]

    C -->|piece tasks| D[Task Queue]

    subgraph Peer Workers
        E1[Peer 1]
        E2[Peer 2]
        E3[Peer N]
    end

    D --> E1
    D --> E2
    D --> E3

    subgraph Download Flow
        F1[Handshake]
        F2[Bitfield Exchange]
        F3[Interested]
        F4[Request Blocks]
        F5[Receive Blocks]
        F6[Assemble Piece]
        F7[Verify SHA-1]
    end

    E1 --> F1 --> F2 --> F3 --> F4 --> F5 --> F6 --> F7
    E2 --> F1
    E3 --> F1

    F7 -->|valid| G[Piece Results]
    F7 -->|invalid| D

    G --> H[File Writer]
    H --> I[Output File]
Loading

About

Minimal BitTorrent client written in Go βš‘πŸ“¦

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages