Skip to content

About

BitTorrent protocol implementation

Topics

Resources

Stars

19 stars

Watchers

0 watching

Forks

Repository files navigation

TorrentDam BitTorrent Client

A BitTorrent client library and command-line tool for downloading and managing torrents.

What It Does

  • Download torrents from the BitTorrent network using .torrent files or magnet links
  • Discover peers without trackers via the Distributed Hash Table (DHT) network
  • Fetch metadata to download .torrent files from peers using just an info-hash
  • Verify downloads against piece checksums to ensure data integrity
  • Run as a DHT node to participate in the decentralized peer discovery network

Installation

Docker

docker pull ghcr.io/torrentdam/cmd:latest
docker run --rm ghcr.io/torrentdam/cmd:latest --help

A native (Scala Native) image built from the CI-produced binary on Ubuntu is also published:

docker pull ghcr.io/torrentdam/cmd-native:latest
docker run --rm ghcr.io/torrentdam/cmd-native:latest --help

Quick Start

Download a torrent:

torrentdam torrent download --info-hash <hash> --save /downloads

Fetch a .torrent file from the DHT:

torrentdam torrent fetch-file --info-hash <hash> --save file.torrent

Verify a download:

torrentdam torrent verify --torrent file.torrent --target /downloads

Usage

Run torrentdam --help for complete command reference.

Development

Enter a development environment with JDK 21, Mill, and transmission via Nix:

nix develop

End-to-End Tests

TransmissionIntegrationSuite is a true end-to-end test: it generates a random payload (16 MB), seeds it with a real transmission daemon, and verifies that the torrentdam CLI downloads it over the peer-to-peer wire protocol using only the --peer flag (no DHT discovery). The test is fully self-contained and needs no internet access.

The test needs transmission-daemon, transmission-create, and transmission-remote on the PATH (all provided by nix develop). It builds the CLI assembly jar via mill cmd.assembly if TORRENT_TEST_CMD_JAR is not set.

nix develop
mill cmd.assembly
export TORRENT_TEST_CMD_JAR="$PWD/out/cmd/assembly.dest/out.jar"
mill e2e.jvm.test

License

Unlicense - Public Domain

About

BitTorrent protocol implementation

Topics

Resources

Stars

19 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages