https://github.com/farbodahm/codecrafters-bittorrent-go
My solution to "Build Your Own Bittorent" Challenge.
https://github.com/farbodahm/codecrafters-bittorrent-go
Last synced: 4 months ago
JSON representation
My solution to "Build Your Own Bittorent" Challenge.
- Host: GitHub
- URL: https://github.com/farbodahm/codecrafters-bittorrent-go
- Owner: farbodahm
- Created: 2025-02-25T20:49:20.000Z (4 months ago)
- Default Branch: master
- Last Pushed: 2025-03-03T21:21:43.000Z (4 months ago)
- Last Synced: 2025-03-03T22:26:03.818Z (4 months ago)
- Language: Go
- Size: 31.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://app.codecrafters.io/users/codecrafters-bot?r=2qF)
My approach to the ['Build Your Own BitTorrent'](https://app.codecrafters.io/courses/bittorrent/overview) challenge.
## Features
- **Encode/Decode Bencode Encoding**:
- `Strings`
- `Int`
- `Nested List`
- `Nested Dictionary`
- **Parsing Torrent File**
- **Discovering Peers & Handshake**
- **Download Pieces from Peers concurrently**## RUN
- **Build**:
- `go build -o bittorrent cmd/bittorrent/main.go`
- **Download full torrent**:
- `./bittorrent download -o test.txt sample.torrent`
- **Download specific piece**:
- `./bittorrent download_piece -o ./file-piece11 sample.torrent 11`
- **Discover Peers**:
- `./bittorrent peers sample.torrent`
- **Handshake Peer**:
- `./bittorrent handshake sample.torrent PEER_IP:PEER_PORT`
- **Parse Torrent**:
- `./bittorrent info sample.torrent`
- **Decode Beencode**:
- `./bittorrent decode d10:inner_dictd4:key16:value14:key2i42e8:list_keyl5:item15:item2i3eeee`