A clone of btpd with my configuration changes.
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

readme.md 7.1 KiB

hace 4 años
hace 4 años
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. # BTPD
  2. BitTorrent Protocol Daemon
  3. ## Index
  4. 1. [Introduction](#introduction)
  5. * [What is btpd?](#what-is-btpd?)
  6. * [The programs](#the-programs)
  7. * [The btcli commands](#the-btcli-commands)
  8. 2. [Using btpd](#using-btpd)
  9. * [First](#first)
  10. * [Starting btpd](#starting-btpd)
  11. * [Examples](#examples)
  12. * [Troubleshooting](#troubleshooting)
  13. 3. [Building](#building)
  14. * [Requirements](#requirements)
  15. * [Standard build](#standard-build)
  16. 4. [Additional notes](#additional-notes)
  17. * [Upgrade from old versions](#upgrade-from-old-versions)
  18. * [Pre exit mode](#pre-exit-mode)
  19. * [Using both IPv6 and IPv4](#using-both-ipv6-and-ipv4)
  20. ## Introduction
  21. ### What is btpd?
  22. `btpd` is a utility for sharing files over the BitTorrent network protocol.
  23. It runs in daemon mode, thus needing no controlling terminal or gui.
  24. Instead, the daemon is controlled by btcli, its command line utility,
  25. or other programs capable of sending commands and queries on the control
  26. socket.
  27. ### The programs
  28. `btpd` consists of the following programs:
  29. * `btpd` - The bittorrent client.
  30. * `btcli` - Command line interface to btpd.
  31. * `btinfo` - Shows information from a torrent file.
  32. All programs accept the `--help` option.
  33. ### The btcli commands
  34. The `btcli` utility has several different modes of operation. One of the 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. * `rate` - Set the global up and download rates in KB/s.
  40. * `start` - Activate torrents.
  41. * `stat` - Display stats for active torrents.
  42. * `stop` - Deactivate torrents.
  43. ## Using btpd
  44. ### First
  45. To start sharing a torrent with btpd, the torrent needs to be added to
  46. btpd. This is done with `btcli add`. When you add a torrent btpd automatically (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. ```
  57. + the torrent is starting. This may take time if btpd needs to test
  58. the content of this torrent or one started before it.
  59. - the torrent is being stopped.
  60. I the torrent is inactive.
  61. S btpd is seeding the torrent.
  62. L btpd is leeching the torrent.
  63. ```
  64. You can stop an active torrent with `btcli stop` and, of course,
  65. start an inactive torrent by using `btcli start`.
  66. The `btcli del` command should only be used when you're totally finished
  67. with sharing a torrent. The command will remove the torrent and its
  68. associated data from btpd. It's an escpecially bad idea to remove a not
  69. fully downloaded torrent and then adding it again, since btpd has lost
  70. information on the not fully downloaded pieces and will need to download
  71. the data again.
  72. To shut down btpd use `btcli kill`. Don't forget to read the help for each
  73. of btcli's commands.
  74. ### Starting btpd
  75. NOTE: You should only need one instance of btpd regardless of how many
  76. torrents you want to share.
  77. To start btpd with default settings you only need to run it. However,
  78. there are many useful options you may want to use. To see a full list
  79. run `btpd --help`. If you didn't specify otherwise, btpd starts with
  80. the same set of active torrents as it had the last time it was shut down.
  81. btdp will store information and write its log in `$HOME/.btpd`. Therefore
  82. it needs to be able to write there during its execution. You can specify
  83. another directory via the `-d` option or the `$BTPD_HOME` variable.
  84. I recommend specifiying the maximum number of uploads. Bittorrent employs a
  85. tit for tat algorithm, so uploading at good rates allows for downloading.
  86. Try to find a balance between uploads/outgoing bandwidth and the number of
  87. active torrents.
  88. ### Examples
  89. Start btpd with all options set to their default values.
  90. ```
  91. # btpd
  92. ```
  93. Start btpd and make it listen on port 12345, limit outgoing bandwidth to
  94. 200kB/s, limit the number of peers to 40 and not start any torrents that
  95. were active the last time btpd was shut down.
  96. ```
  97. # btpd -p 12345 --bw-out 200 --max-peers 40 --empty-start
  98. ```
  99. Display a list btpd's torrents and their number, size, status, etc.
  100. ```
  101. # btcli list
  102. ```
  103. Same as above, but only for torrent 12 and my.little.torrent.
  104. ```
  105. # btcli list 12 my.little.torrent
  106. ```
  107. Same as above but only for active torrents.
  108. ```
  109. # btcli list -a
  110. ```
  111. Same as above, but print using a custom format
  112. ```
  113. # btcli list -a -f "btcli list -f "%n\t%#\t%p%s\t%r\n"
  114. ```
  115. Add foo.torrent, with content dir foo.torrent.d, and start it.
  116. ```
  117. # btcli add -d foo.torrent.d foo.torrent
  118. ```
  119. Same as above without starting it.
  120. ```
  121. # btcli add --no-start -d foo.torrent.d foo.torrent
  122. ```
  123. Start bar.torrent and torrent number 7.
  124. ```
  125. # btcli start bar.torrent 7
  126. ```
  127. Stop torrent number 7.
  128. ```
  129. # btcli stop 7
  130. ```
  131. Stop all active torrents.
  132. ```
  133. # btcli stop -a
  134. ```
  135. Remove bar.torrent and it's associated information from btpd.
  136. ```
  137. # btcli del bar.torrent
  138. ```
  139. Display a summary of up/download stats for the active torrents.
  140. ```
  141. # btcli stat
  142. ```
  143. Display the summary once every five seconds.
  144. ```
  145. # btcli stat -w 5
  146. ```
  147. Same as above, but also display individual stats for each active torrent.
  148. ```
  149. # btcli stat -w 5 -i
  150. ```
  151. Set the global upload rate to 20KB/s and download rate to 1MB/s.
  152. ```
  153. # btcli rate 20K 1M
  154. ```
  155. Shut down btpd.
  156. ```
  157. # btcli kill
  158. ```
  159. ### Troubleshooting
  160. If btpd has shut down for some unknown reason, check the logfile for
  161. possible clues.
  162. ## Building
  163. ### Requirements
  164. You should have a *BSD, Linux or sufficiently similar system.
  165. Make sure you have recent versions of the following software:
  166. * OpenSSL - Get at http://www.openssl.org/
  167. You also need a c99 compiler. A non antique GCC should do.
  168. To be able to open the manual located in `doc` you need to have `man-pages` installed.
  169. ### Standard build
  170. ```
  171. # ./configure
  172. # make
  173. # make install
  174. ```
  175. See `./configure --help` for available build options if the above fails.
  176. ## Additional notes
  177. ### Upgrade from old version
  178. The layout of the torrents directory in the btpd directory has changed
  179. since btpd 0.11. Please remove the torrents directory before running
  180. later versions.
  181. ### Pre exit mode
  182. If btpd needs to send stop messages to trackers before shutting down,
  183. it will enter the pre exit mode. A btpd process in this mode can safely
  184. be ignored and will not interfere with any new btpd started in the same
  185. directory.
  186. ### Using both IPv6 and IPv4
  187. Unfortunately enabling both IPv6 and IPv4 in btpd is less useful than it
  188. should be. The problem is that some sites have trackers for both versions
  189. and it's likely that the IPv6 one, which probably has less peers, will be
  190. used in favour of the IPv4 one.
  191. In order to fix this problem, the IP version options should be changed to
  192. be per torrent, in some future version of btpd.