BitTorrent Tracker
A tracker (or tracking server) monitors and coordinates the BitTorrent clients. Similar to a traffic cop, the tracker helps direct the client to get the necessary data for a complete file. When you open a torrent, your Bit Torrent Client contacts the tracker and asks for the peers and Seeds who make up the swarm downloading the file you are interested in. Your Bit Torrent Client periodically goes back to the tracker, updating it with vital information about your download. The tracker uses this information to direct you to other peers and Seeds, and to direct other peers and Seeds to your machine.
A tracker is central to your ability to find new peers and Seeds who are downloading a particular file. If a tracker goes down, you will be able to continue downloading any data from your current swarm, but you will be unable to download new data from another swarm, or add people to your swarm.
Read More Bittorrent FAQs
How do I run a tracker?
These are the most common ways to run your own bittorrent tracker:
Run the Python tracker.
- Install Python on your system. Windows users should download the Python 2.2.3 installer from python.org. Linux BSD, and OS X users should consult your distribution's package management system.
- Get the Python source code of BitTorrent. Note: A lot of changes have been made to the source since 3.2.1 was released, so it is highly recommended that you get the latest sources from CVS if you want to run the tracker. To check out the source from CVS, issue the following command, assuming that you have a CVS client installed:
cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/bittorrent co BitTorrent
This will create a BitTorrent directory under the current working directory. Note: Sourceforge's CVS server has been very flaky recently, presumably due to overload. If you find that you cannot get the above command to work, i.e. you get "Connection reset by peer" or some sort of timeout error, you can try this alternative server:
cvs -d:pserver:anonymous@cvs-pserver.sourceforge.net:80/cvsroot/bittorrent co BitTorrent
If you need help installing a CVS client on your system, consult the Sourceforge documentation for Windows users here as well as the general CVS documentation here. Note that you can also access the sources through WebCVS.
- Page through the README.txt file for general instructions on how the tracker works. Essentially, you change to the directory that contains the bttrack.py file and issue a command such as:
python bttrack.py --port 6969 --dfile dstate --logfile tracker.log
Note: if this command is successful you won't see anything on the screen at all -- the tracker will remain open until you kill it, so you may want to put the command in a batch file for easy startup. To check your tracker's operation, connect to the machine running the tracker, i.e. by loading "http://machine-name:6969/" into your browser. If successfull you should see a status page in your browser.
Your tracker's announce URL will be "http://machine-name:6969/announce". This is what should be entered in the appropriate field when creating a .torrent for your tracker.
- You should review the command line parameters and make any changes as appropriate. Note that the "--logfile" parameter is new in CVS and not present in 3.2.1. If you must use the 3.2.1 sources, you will want to redirect the log messages on stdout to a file, e.g. by appending ">> tracker.log" to your command line. You can also run "python bttrack.py to get a list of command line parameters. Some parameters that might be of interest are:
--nat_check n
If 1 (default), don't allow users behind NAT gateways use the tracker. You probably want to set this to 0 for a general-access site.
--allowed_dir dir
Use this to restrict the files which your tracker will track. This parameter specifies a directory name, and it will only track torrents that exist in this directory. If this parameter is present you must somehow place the .torrent file in the specified directory before the tracker will accept it.
--show_names n
If set to 1, the tracker will show filenames of torrents that it knows about in its allowed_dir, instead of just showing info_hash's on its status page.
See the command line section of the FAQ for a complete list of command line parameters.
- As an alternative to the Python tracker, you can try BNBT which is a tracker written in C++. It is slightly easier to install since it comes with precompiled binaries for Windows, and is relatively easy to build with g++ under Linux/OS X. BNBT has more advanced stats-pages, but its configuration is very similar to the Python tracker. Refer to the home page for downloads and manuals.
- You can also try the TrackPack, which combined BNBT with an easy to use installer for Windows. With this combination you can have a tracker up and running very quickly. You can read more about the TrackPak and how to use it at Trinity's site and the forums at Filesoup.com.
- If you have a web server capable of PHP and MySQL, there are a couple of free (GPL) tracker implementations. One is PHPBTTracker, another is bytemonsoon.com. Both of these solutions run integrate the tracker with the web server, and offer quite extensive stats. Refer to the PHP source for installation details.
|