{"id":13575792,"url":"https://github.com/btpd/btpd","last_synced_at":"2025-05-13T12:52:47.813Z","repository":{"id":1055345,"uuid":"791337","full_name":"btpd/btpd","owner":"btpd","description":"⚡ The BitTorrent Protocol Daemon","archived":false,"fork":false,"pushed_at":"2022-01-25T14:56:31.000Z","size":659,"stargazers_count":520,"open_issues_count":29,"forks_count":61,"subscribers_count":27,"default_branch":"master","last_synced_at":"2025-05-02T15:02:32.376Z","etag":null,"topics":["bittorrent","c","daemon","torrent"],"latest_commit_sha":null,"homepage":"https://github.com/btpd/btpd/wiki","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/btpd.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2010-07-22T16:25:04.000Z","updated_at":"2025-04-12T01:56:41.000Z","dependencies_parsed_at":"2022-07-20T17:18:37.395Z","dependency_job_id":null,"html_url":"https://github.com/btpd/btpd","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/btpd%2Fbtpd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/btpd%2Fbtpd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/btpd%2Fbtpd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/btpd%2Fbtpd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/btpd","download_url":"https://codeload.github.com/btpd/btpd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253947829,"owners_count":21988945,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bittorrent","c","daemon","torrent"],"created_at":"2024-08-01T15:01:04.225Z","updated_at":"2025-05-13T12:52:47.768Z","avatar_url":"https://github.com/btpd.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.com/btpd/btpd.svg?branch=master)](https://travis-ci.com/btpd/btpd)\n\n# BTPD\n\nBitTorrent Protocol Daemon\n\n## Index\n\n1. [Introduction](#introduction)\n\t* [What is btpd?](#what-is-btpd?)\n\t* [The programs](#the-programs)\n\t* [The btcli commands](#the-btcli-commands)\n2. [Using btpd](#using-btpd)\n\t* [First](#first)\n\t* [Starting btpd](#starting-btpd)\n\t* [Examples](#examples)\n\t* [Troubleshooting](#troubleshooting)\n3. [Building](#building)\n\t* [Requirements](#requirements)\n\t* [Standard build](#standard-build)\n4. [Additional notes](#additional-notes)\n\t* [Upgrade from old versions](#upgrade-from-old-versions)\n\t* [Pre exit mode](#pre-exit-mode)\n\t* [Using both IPv6 and IPv4](#using-both-ipv6-and-ipv4)\n5. [Contact](#contact)\n\n## Introduction\n\n### What is btpd?\n\n`btpd` is a utility for sharing files over the BitTorrent network protocol.\nIt runs in daemon mode, thus needing no controlling terminal or gui.\nInstead, the daemon is controlled by btcli, its command line utility,\nor other programs capable of sending commands and queries on the control\nsocket.\n\n### The programs\n\n`btpd` consists of the following programs:\n* `btpd`     - The bittorrent client.\n* `btcli`    - Command line interface to btpd.\n* `btinfo`   - Shows information from a torrent file.\n\nAll programs accept the `--help` option.\n\n### The btcli commands\n\nThe `btcli` utility has several different modes of operation. One of the following commands must be specified when running `btcli`:\n* `add`      - Add torrents to btpd.\n* `del`      - Remove torrents from btpd.\n* `kill`     - Shut down btpd.\n* `list`     - List torrents.\n* `rate`     - Set the global up and download rates in KB/s.\n* `start`    - Activate torrents.\n* `stat`     - Display stats for active torrents.\n* `stop`     - Deactivate torrents.\n\n## Using btpd\n\n### First\n\nTo start sharing a torrent with btpd, the torrent needs to be added to\nbtpd. This is done with `btcli add`. When you add a torrent btpd automatically (if you didn't specify otherwise) starts to share the torrent\nand download any missing data. The content directory you specify when\nadding a torrent doesn't need to exist; it will be created by btpd.\n\nYou can see which torrents have been added to btpd with `btcli list`.\nThe list command also displays a number for each added torrent. This number\ncan be used to specify the target torrent for the btcli commands, so you\ndon't have to keep the torrent file once you've added it.\n\nThe up- and download progress can be followed by using the `btcli stat`\ncommand. Both the list and stat commands use the following indicators to\ndisplay the state of a torrent:\n\n* `+`     - the torrent is starting. This may take time if btpd needs to test the content of this torrent or one started before it.\n* `-`     - the torrent is being stopped.\n* `I`     - the torrent is inactive.\n* `S`     - btpd is seeding the torrent.\n* `L`     - btpd is leeching the torrent.\n\nYou can stop an active torrent with `btcli stop` and, of course,\nstart an inactive torrent by using `btcli start`.\n\nThe `btcli del` command should only be used when you're totally finished\nwith sharing a torrent. The command will remove the torrent and its\nassociated data from btpd. It's an escpecially bad idea to remove a not\nfully downloaded torrent and then adding it again, since btpd has lost\ninformation on the not fully downloaded pieces and will need to download\nthe data again.\n\nTo shut down btpd use `btcli kill`. Don't forget to read the help for each\nof btcli's commands.\n\n### Starting btpd\n\nNOTE: You should only need one instance of btpd regardless of how many\ntorrents you want to share.\n\nTo start btpd with default settings you only need to run it. However,\nthere are many useful options you may want to use. To see a full list\nrun `btpd --help`. If you didn't specify otherwise,  btpd starts with\nthe same set of active torrents as it had the last time it was shut down.\n\nbtdp will store information and write its log in `$HOME/.btpd`. Therefore\nit needs to be able to write there during its execution. You can specify\nanother directory via the `-d` option or the `$BTPD_HOME` variable.\n\nI recommend specifiying the maximum number of uploads. Bittorrent employs a\ntit for tat algorithm, so uploading at good rates allows for downloading.\nTry to find a balance between uploads/outgoing bandwidth and the number of\nactive torrents.\n\n### Examples\n\nStart btpd with all options set to their default values.\n```\n# btpd\n```\n\nStart btpd and make it listen on port 12345, limit outgoing bandwidth to\n200kB/s, limit the number of peers to 40 and not start any torrents that\nwere active the last time btpd was shut down.\n```\n# btpd -p 12345 --bw-out 200 --max-peers 40 --empty-start\n```\n\nDisplay a list btpd's torrents and their number, size, status, etc.\n```\n# btcli list\n```\n\nSame as above, but only for torrent 12 and my.little.torrent.\n```\n# btcli list 12 my.little.torrent\n```\n\nSame as above but only for active torrents.\n```\n# btcli list -a\n```\n\nSame as above, but print using a custom format\n```\n# btcli list -a -f \"btcli list -f \"%n\\t%#\\t%p%s\\t%r\\n\"\n```\n\nAdd foo.torrent, with content dir foo.torrent.d, and start it.\n```\n# btcli add -d foo.torrent.d foo.torrent\n```\n\nSame as above without starting it.\n```\n# btcli add --no-start -d foo.torrent.d foo.torrent \n```\n\nStart bar.torrent and torrent number 7.\n```\n# btcli start bar.torrent 7\n```\n\nStop torrent number 7.\n```\n# btcli stop 7\n```\n\nStop all active torrents.\n```\n# btcli stop -a\n```\n\nRemove bar.torrent and it's associated information from btpd.\n```\n# btcli del bar.torrent\n```\n\nDisplay a summary of up/download stats for the active torrents.\n```\n# btcli stat\n```\n\nDisplay the summary once every five seconds.\n```\n# btcli stat -w 5\n```\n\nSame as above, but also display individual stats for each active torrent.\n```\n# btcli stat -w 5 -i\n```\n\nSet the global upload rate to 20KB/s and download rate to 1MB/s.\n```\n# btcli rate 20K 1M\n```\n\nShut down btpd.\n```\n# btcli kill\n```\n\n### Troubleshooting\n\nIf btpd has shut down for some unknown reason, check the logfile for\npossible clues.\n\n## Building\n\n### Requirements\n\nYou should have a BSD, Linux or sufficiently similar system.\n\nMake sure you have recent versions of the following software:\n* OpenSSL   - Get at http://www.openssl.org/\n\nYou also need a c99 compiler. A non antique GCC should do.\n\nTo be able to open the manual located in `doc` you need to have `man-pages` installed.\n\n### Standard build\n\n```\n# ./configure\n# make\n# make install\n```\n\nSee `./configure --help` for available build options if the above fails.\n\n## Additional notes\n\n### Upgrade from old version\n\nThe layout of the torrents directory in the btpd directory has changed\nsince btpd 0.11. Please remove the torrents directory before running\nlater versions.\n\n### Pre exit mode\n\nIf btpd needs to send stop messages to trackers before shutting down,\nit will enter the pre exit mode. A btpd process in this mode can safely\nbe ignored and will not interfere with any new btpd started in the same\ndirectory.\n\n### Using both IPv6 and IPv4\n\nUnfortunately enabling both IPv6 and IPv4 in btpd is less useful than it\nshould be. The problem is that some sites have trackers for both versions\nand it's likely that the IPv6 one, which probably has less peers, will be\nused in favour of the IPv4 one.\n\nIn order to fix this problem, the IP version options should be changed to\nbe per torrent, in some future version of btpd.\n\n## Contact\n\nIf you wish to get in touch to get help, contribute or just say hi, don't\nhesitate to come to our IRC channel [#btpd on freenode](irc://chat.freenode.net/%23btpd).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbtpd%2Fbtpd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbtpd%2Fbtpd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbtpd%2Fbtpd/lists"}