Torrust is a simple BitTorrent client implemented in Rust as the final project of the networking course at Grenoble INP - ENSIMAG.
- libssl-dev: necessary for the
reqwest
crate
All development dependencies are expected to be installed and in your path.
- aria2c: aria2 is a command-line download utility that can be used both as a peer or a seeder for .torrent files.
- opentracker: opentracker is a BitTorrent tracker.
To build the project, run:
cargo build --release
To execute Torrust, run:
cargo run --release -- your_torrent.torrent your_working_directory [--info|--debug]
If the working directory already contains the file to be downloaded, Torrust will seed the file. If the working directory does not contain or partially contains the file to be downloaded, Torrust will attempt to download the missing pieces while seeding the pieces it already has.
There are two log levels, info and debug. The default is no logs. If you want readable logs, run with --info. If you want specific logs, run with --debug.
If you need more details, a --help is available:
cargo run --release -- --help
A very humble Torrent client made with all our effort
Usage: torrust [OPTIONS] <TORRENT_FILE> <WORKING_DIRECTORY>
Arguments:
<TORRENT_FILE> The .torrent file path
<WORKING_DIRECTORY> The download path to store/upload the file described in .torrent
Options:
-i, --info Gives network peers information (bittorrent application, address IP, port, download/upload piece state)
-d, --debug Print minimal debug info
-m, --mock Communicate directly with three local peers using ports 2001, 2002 and 2003
-h, --help Print help information
Test Torrust as leecher with one client
- Launch the script
one-seeder.sh
.
The script will launch aria as seeder with the respective torrent file
and the working directory
where is stored the file to upload.
As an option, the listening port could be forced if desired.
./scripts/one-seeder.sh <TORRENT_FILE> <WORKING_DIRECTORY> [LISTEN_PORT]
- Launch Torrust with:
cargo run --release -- <TORRENT_FILE> <WORKING_DIRECTORY> [--info|--debug]
Test Torrust as seeder
- Launch the script
tracker.sh
./scripts/tracker.sh
- Launch Torrust with
cargo run --release -- <TORRENT_FILE> <WORKING_DIRECTORY> [--info|--debug]
-
Launch Vuze and open the torrent file
-
At this moment Vuze will begin to download the file.
Test Torrust as leecher with multiple aria2c clients
On this test, each aria2c will have a percentage of the file that the client will download from them. There is no tracker involved on this test, the ports of each aria client are hardcoded on the script and on Torrust.
-
Go to the
./scripts/multi-client
directory -
Launch
./partial.sh
to configure the different file parts each aria will have -
Launch the script named
multi-seeders-iceberg.sh
saved on the./scripts
folder with the following parameters
./scripts/multi-seeders-iceberg.sh <TORRENT_FILE> <WORKING_DIRECTORY> <WORKING_DIR_ARIAS>
Arguments:
<TORRENT_FILE> The .torrent file path
<WORKING_DIRECTORY> The download path to store/upload the file described in .torrent
<WORKING_DIR_ARIAS> The folder where are contained the aria subfolders, normally, it will be the /multi-client folder.
There is no tracker involved on this test, the ports of each aria client are hardcoded on the script.
Also, the hardcoded ports of each aria client are used on Torrust when we indicate the flag --mock