A clone of btpd with my configuration changes.
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

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