BitTorrent HowTo
The following was written in a pinch for NerdTV.
Setup
As of this writing, the latest version of BitTorrent is 4.2.1. I am assuming you are using this version. The application names are different in earlier versions.
The easiest way to get things going is for you to create an environment similar to the way we have things setup. Make a fresh directory where all the data is going to live. For this example, I'll call it "nerdtv". Inside this directory, make the following directories: log, state, torrents.
Place all the files and directories you want to serve inside the nerdtv/torrents directory. You can organize the data in there however you want.
Torrent Files
If you want to people to download a single file at a time, you will make a .torrent for each file. If you want people to download a collection of files at once, you will place those files in a directory and create a .torrent for the directory.
To make a .torrent file, run the following:
maketorrent-console --data_dir /.../nerdtv/state http://server.the.tracker.is.running.on.com:6969/announce filename_or_directory_to_publish
Replace the leading /... with the correct path to the nerdtv directory we made earlier.
If you are serving large files, say over a few hundred megabytes, you may end up with large .torrent files. To make smaller .torrent files you can say:
maketorrent-console --piece_size_pow2 19 --data_dir /.../nerdtv/state http://server.the.tracker.is.running.on.com:6969/announce filename_or_directory_to_publish
For even smaller .torrent files, you can say --piece_size_pow2 20. I don't recommend larger values.
Tracker
To start the tracker, run the following:
bittorrent-tracker --hupmonitor 1 --port 6969 --dfile /.../nerdtv/state/dstate --logfile /.../nerdtv/log/tracker.log --allowed_dir /.../nerdtv/torrents
Publisher
To start the publisher (seeding the files), run the following:
launchmany-curses --data_dir /.../nerdtv/state --torrent_dir /.../nerdtv/torrents
The publisher will find all the .torrent files in /.../nerdtv/torrents and start seeding them. If you want to cap the bandwidth the publisher uses to seed files use the following:
launchmany-curses --max_upload_rate KBS --data_dir /.../nerdtv/state --torrent_dir /.../nerdtv/torrents
Replace KBS with the number of kilobytes per second to upload at.
Fin
Place the .torrent files on your website so people can grab them and start downloading your content.