A clone of btpd with my configuration changes.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. The BitTorrent Protocol Daemon
  2. README
  3. Contents
  4. 1 Introduction
  5. 1.a What is btpd?
  6. 1.b The programs
  7. 1.c The btcli commands
  8. 2 Using btpd
  9. 2.a Introduction
  10. 2.b Starting btpd
  11. 2.c Examples
  12. 2.d Troubleshooting
  13. 3 Building
  14. 3.a Requirements
  15. 3.b Standard build
  16. 4 Upgrade notes
  17. 4.a btpd 0.12
  18. 1. Introduction
  19. 1.a What is btpd?
  20. btpd is a bittorrent client consisting of a daemon and client commands,
  21. which can be used to read and/or manipulate the daemon state. The daemon
  22. is capable of running several torrents simultaneously and only uses one
  23. tcp port. It's fairly low on resource usage and should be perfect for
  24. file distribution sites. Efficient downloads and ease of use makes this
  25. client a good choice for the casual user as well.
  26. 1.b The programs
  27. btpd consists of the following programs:
  28. * btpd - The bittorrent client.
  29. * btcli - Command line interface to btpd.
  30. * btinfo - Shows information from a torrent file.
  31. All programs accept the "--help" option.
  32. 1.c The btcli commands
  33. The btcli utility has several different modes of operation. One of the
  34. following commands must be specified when running btcli:
  35. * add - Add torrents to btpd.
  36. * del - Remove torrents from btpd.
  37. * kill - Shut down btpd.
  38. * list - List torrents.
  39. * start - Activate torrents.
  40. * stat - Display stats for active torrents.
  41. * stop - Deactivate torrents.
  42. 2. Using btpd
  43. 2.a Introduction
  44. To start sharing a torrent with btpd, the torrent needs to be added to
  45. btpd. This is done with 'btcli add'. When you add a torrent btpd auto-
  46. matically (if you didn't specify otherwise) starts to share the torrent
  47. and download any missing data. The content directory you specify when
  48. adding a torrent doesn't need to exist; it will be created by btpd.
  49. You can see which torrents have been added to btpd with 'btcli list'.
  50. The list command also displays a number for each added torrent. This number
  51. can be used to specify the target torrent for the btcli commands, so you
  52. don't have to keep the torrent file once you've added it.
  53. The up- and download progress can be followed by using the 'btcli stat'
  54. command. Both the list and stat commands use the following indicators to
  55. display the state of a torrent:
  56. + the torrent is starting. This may take time if btpd needs to test
  57. the content of this torrent or one started before it.
  58. - the torrent is being stopped. May take time if the tracker is
  59. unresponsive.
  60. I the torrent is inactive.
  61. S btpd is seeding the torrent.
  62. L btpd is leeching the torrent.
  63. You can stop an active torrent with 'btcli stop' and, of course,
  64. start an inactive torrent by using 'btcli start'.
  65. The 'btcli del' command should only be used when you're totally finished
  66. with sharing a torrent. The command will remove the torrent and its
  67. associated data from btpd. It's an escpecially bad idea to remove a not
  68. fully downloaded torrent and then adding it again, since btpd has lost
  69. information on the not fully downloaded pieces and will need to download
  70. the data again.
  71. To shut down btpd use 'btcli kill'. Don't forget to read the help for each
  72. of btcli's commands.
  73. 2.b Starting btpd
  74. NOTE: You should only need one instance of btpd regardless of how many
  75. torrents you want to share.
  76. To start btpd with default settings you only need to run it. However,
  77. there are many useful options you may want to use. To see a full list
  78. run 'btpd --help'. If you didn't specify otherwise, btpd starts with
  79. the same set of active torrents as it had the last time it was shut down.
  80. btdp will store information and write its log in $HOME/.btpd. Therefore
  81. it needs to be able to write there during its execution. You can specify
  82. another directory via the '-d' option or the $BTPD_HOME variable.
  83. I recommend specifiying the maximum number of uploads. Bittorrent employs a
  84. tit for tat algorithm, so uploading at good rates allows for downloading.
  85. Try to find a balance between uploads/outgoing bandwidth and the number of
  86. active torrents.
  87. 2.c Examples
  88. Start btpd with all options set to their default values.
  89. # btpd
  90. Start btpd and make it listen on port 12345, limit outgoing bandwidth to
  91. 200kB/s, limit the number of peers to 40 and not start any torrents that
  92. were active the last time btpd was shut down.
  93. # btpd -p 12345 --bw-out 200 --max-peers 40 --empty-start
  94. Display a list btpd's torrents and their number, size, status, etc.
  95. # btcli list
  96. Same as above, but only for torrent 12 and my.little.torrent.
  97. # btcli list 12 my.little.torrent
  98. Same as above but only for active torrents.
  99. # btcli list -a
  100. Add foo.torrent, with content dir foo.torrent.d, and start it.
  101. # btcli add -d foo.torrent.d foo.torrent
  102. Same as above without starting it.
  103. # btcli add --no-start -d foo.torrent.d foo.torrent
  104. Start bar.torrent and torrent number 7.
  105. # btcli start bar.torrent 7
  106. Stop torrent number 7.
  107. # btcli stop 7
  108. Stop all active torrents.
  109. # btcli stop -a
  110. Remove bar.torrent and it's associated information from btpd.
  111. # btcli del bar.torrent
  112. Display a summary of up/download stats for the active torrents.
  113. # btcli stat
  114. Display the summary once every five seconds.
  115. # btcli stat -w 5
  116. Same as above, but also display individual stats for each active torrent.
  117. # btcli stat -w 5 -i
  118. Shut down btpd.
  119. # btcli kill
  120. 2.d Troubleshooting
  121. If btpd has shut down for some unknown reason, check the logfile for
  122. possible clues.
  123. 3. Building
  124. 3.a Requirements
  125. You should have a *BSD, Linux or sufficiently similar system with pthread
  126. support.
  127. Make sure you have recent versions of the following software:
  128. * curl - Get at <URL:http://curl.haxx.se/>
  129. * openssl - Get at <URL:http://www.openssl.org/>
  130. * libevent - Get at <URL:http://www.monkey.org/~provos/libevent/>
  131. You also need a c99 compiler. A non antique GCC should do.
  132. 3.b Standard build
  133. # ./configure
  134. # make
  135. # make install
  136. See './configure --help' for available build options if the above fails.
  137. 4. Upgrade notes
  138. 4.a btpd 0.12
  139. The layout of the torrents directory in the btpd directory has changed
  140. since previous versions. Please remove the torrents directory before
  141. running 0.12 or later.