Skip to content

Commit

Permalink
Merge #29: Make missing package readmes
Browse files Browse the repository at this point in the history
1801dfd docs: make missing package readmes (Cameron Garnham)

Pull request description:

  closes #28

ACKs for top commit:
  da2ce7:
    ACK 1801dfd

Tree-SHA512: 088beaf26347ede866869cad6ab7254faa94015cca0fc7925505cfa0b0b7a3c909f9224628438c7a836469a9b9aefa3fe2517700c4c32395a20df74c92ca5ed8
  • Loading branch information
da2ce7 committed Aug 1, 2023
2 parents 72cb2c4 + 1801dfd commit cc22e3e
Show file tree
Hide file tree
Showing 32 changed files with 147 additions and 22 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ homepage = "https://github.com/torrust/bittorrent-infrastructure-project"
keywords = ["bittorrent"]
license = "Apache-2.0"
publish = false # until we decide where to publish.
readme = "README.md"
repository = "https://github.com/torrust/bittorrent-infrastructure-project"
rust-version = "1.71"
version = "1.0.0-alpha.1"
Expand Down
11 changes: 7 additions & 4 deletions examples/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
To see help messages for the examples (and then run them):
`cd <example> && cargo run --release -- --help`
# Command Line Example Applications
These applications are for the demonstration of the bittorrent infrastructure project api:

### Simple Torrent
Primitive torrent client that can connect to a single peer and upload/download pieces from that peer.
### [Simple Torrent](./simple_torrent/)
A primitive torrent client that can connect to a single peer and upload/download pieces from that peer.

### [Get Metadata](./get_metadata/)
A simple application that downloads a torrent file form a given info-hash.
2 changes: 1 addition & 1 deletion examples/get_metadata/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[package]
name = "get_metadata"
description = "Examples For bip-rs"
readme = "README.md"

authors.workspace = true
categories.workspace = true
Expand All @@ -9,7 +10,6 @@ edition.workspace = true
homepage.workspace = true
license.workspace = true
publish.workspace = true
readme.workspace = true
repository.workspace = true
version.workspace = true

Expand Down
2 changes: 2 additions & 0 deletions examples/get_metadata/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
### Get Metadata
Download torrent file from info hash.
3 changes: 2 additions & 1 deletion examples/simple_torrent/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[package]
name = "simple_torrent"
description = "Examples For bip-rs"
readme = "README.md"

authors.workspace = true
categories.workspace = true
Expand All @@ -9,7 +10,7 @@ edition.workspace = true
homepage.workspace = true
license.workspace = true
publish.workspace = true
readme.workspace = true

repository.workspace = true
version.workspace = true

Expand Down
2 changes: 2 additions & 0 deletions examples/simple_torrent/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
### Simple Torrent
Primitive torrent client that can connect to a single peer and upload/download pieces from that peer.
41 changes: 41 additions & 0 deletions packages/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Packages
These packages together are the _BitTorrent Infrastructure Project_:

### [Bencode (bencode)](./bencode/)
A library for parsing and converting bencoded data.

### [Distributed Hash Table (dht)](./dht/)
A library implementing the Bittorrent Mainline Distributed Hash Table.

### [Disk (disk)](./disk/)
A library providing the ```FileSystem``` interface, for managing pieces of files.

### [Handshake (handshake)](./handshake/)
A library providing a trait for custom handshake implementations and it's implementation for the standard bittorrent handshake.

### [Http Tracker (htracker)](./htracker/) (not implemented)
A library assisting communication with bittorrent HTTP trackers.

### [Local Peer Discovery (lpd)](./lpd/) (not implemented)
A library providing a implementation of the bittorrent Local Peer/Service Discovery mechanism.

### [Magnet (magnet)](./magnet/)
A library for parsing and constructing magnet links.

### [Metainfo (metainfo)](./metainfo/)
A library for Parsing and building of bittorrent metainfo files.

### [Peer (peer)](./peer/)
A library assisting communication between with bittorrent peers via the peer wire protocol.

### [Select (select)](./select/)
A library providing the _Bittorrent Infrastructure Project_ piece selection module.

### [Utility (util)](./util/)
A library providing a set of utilities used by the _Bittorrent Infrastructure Project_.

### [uTorrent Transport Protocol (utp)](./utp/) (not implemented)
A library implementing the _uTorrent Transport Protocol_.

### [UDP Tracker (utracker)](./utracker/)
A library for parsing and writing UDP tracker messages.
3 changes: 2 additions & 1 deletion packages/bencode/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "bencode"
description = "Efficient decoding and encoding for bencode."
keywords = ["bencode"]
readme = "README.md"

authors.workspace = true
categories.workspace = true
Expand All @@ -10,7 +11,7 @@ edition.workspace = true
homepage.workspace = true
license.workspace = true
publish.workspace = true
readme.workspace = true

repository.workspace = true
version.workspace = true

Expand Down
4 changes: 4 additions & 0 deletions packages/bencode/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Bencode
This library allows for the creation and parsing of bencode encodings.

Bencode is the binary encoding used throughout bittorrent technologies from metainfo files to DHT messages. Bencode types include integers, byte arrays, lists, and dictionaries, of which the last two can hold any bencode type (they could be recursively constructed).
3 changes: 2 additions & 1 deletion packages/dht/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "dht"
description = "Implementation of the bittorrent mainline DHT"
keywords = ["dht", "distributed", "hash", "mainline", "bittorrent"]
readme = "README.md"

authors.workspace = true
categories.workspace = true
Expand All @@ -10,7 +11,7 @@ edition.workspace = true
homepage.workspace = true
license.workspace = true
publish.workspace = true
readme.workspace = true

repository.workspace = true
version.workspace = true

Expand Down
3 changes: 2 additions & 1 deletion packages/disk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "disk"
description = "Bittorrent Infrastructure Project Disk Module"
keywords = ["filesystem", "fs", "disk"]
readme = "README.md"

authors.workspace = true
categories.workspace = true
Expand All @@ -10,7 +11,7 @@ edition.workspace = true
homepage.workspace = true
license.workspace = true
publish.workspace = true
readme.workspace = true

repository.workspace = true
version.workspace = true

Expand Down
6 changes: 6 additions & 0 deletions packages/disk/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Disk
This disk management library is all about storing/loading pieces to/from any object implementing the ```FileSystem``` interface.

Allowing torrent storage could to be transparently sent to disk, stored in memory, pushed to a distributed file system, or even uploaded to the cloud as pieces come in.

In addition, notifications are sent when good or bad pieces are detected as soon as enough blocks are sent to the disk manager that make up a full piece.
4 changes: 2 additions & 2 deletions packages/handshake/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "handshake"

description = "Common handshaking interface as well as a default handshake implementation"
keywords = ["handshake", "bittorrent"]
readme = "README.md"

authors.workspace = true
categories.workspace = true
Expand All @@ -11,7 +11,7 @@ edition.workspace = true
homepage.workspace = true
license.workspace = true
publish.workspace = true
readme.workspace = true

repository.workspace = true
version.workspace = true

Expand Down
8 changes: 8 additions & 0 deletions packages/handshake/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Handshake
This library provides an implementation for handshaking between peers.

Handshaking is the process of connecting to a peer and exchanging information related to how a peer will be communicating with you and vice versa.

In our case, there are many bittorrent technologies that could generally be considered peer discovery mechanisms (local peer discovery, dht, trackers, peer exchange) where once a peer is discovered, a client may want to immediately attempt to establish a connection via a handshake.

This module provides a trait for custom handshake implementations, as well as the standard bittorrent handshake, so that clients can specify a handshaking mechanism for peer discovery services to forward contact information along to.
4 changes: 2 additions & 2 deletions packages/htracker/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "htracker"

description = "Communication with bittorrent HTTP trackers"
keywords = ["tracker", "bittorrent", "http"]
readme = "README.md"

authors.workspace = true
categories.workspace = true
Expand All @@ -11,6 +11,6 @@ edition.workspace = true
homepage.workspace = true
license.workspace = true
publish.workspace = true
readme.workspace = true

repository.workspace = true
version.workspace = true
2 changes: 2 additions & 0 deletions packages/htracker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Http Tracker (htracker)
Not Implemented. Please consider: [UDP Tracker (utracker)](../utracker/).
3 changes: 2 additions & 1 deletion packages/lpd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "lpd"
description = "Implementation of the bittorrent Local Peer/Service Discovery mechanism"
keywords = ["peer", "discovery", "local", "service"]
readme = "README.md"

authors.workspace = true
categories.workspace = true
Expand All @@ -10,6 +11,6 @@ edition.workspace = true
homepage.workspace = true
license.workspace = true
publish.workspace = true
readme.workspace = true

repository.workspace = true
version.workspace = true
2 changes: 2 additions & 0 deletions packages/lpd/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Local Peer Discovery (lpd)
Not Implemented.
3 changes: 2 additions & 1 deletion packages/magnet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "magnet"
description = "Magnet link parsing and construction"
keywords = ["magnet", "bittorrent"]
readme = "README.md"

authors.workspace = true
categories.workspace = true
Expand All @@ -10,7 +11,7 @@ edition.workspace = true
homepage.workspace = true
license.workspace = true
publish.workspace = true
readme.workspace = true

repository.workspace = true
version.workspace = true

Expand Down
2 changes: 2 additions & 0 deletions packages/magnet/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Magnet
This library provides functions to parse and construct magnet links.
3 changes: 2 additions & 1 deletion packages/metainfo/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "metainfo"
description = "Parsing and building of bittorrent metainfo files"
keywords = ["metainfo", "torrent", "file", "bittorrent"]
readme = "README.md"

authors.workspace = true
categories.workspace = true
Expand All @@ -10,7 +11,7 @@ edition.workspace = true
homepage.workspace = true
license.workspace = true
publish.workspace = true
readme.workspace = true

repository.workspace = true
version.workspace = true

Expand Down
9 changes: 9 additions & 0 deletions packages/metainfo/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Magnet
This library provides an api for parsing and building of bittorrent metainfo files.


Metainfo files serve the purpose of providing a list of checksums for clients interested in specific files, how long each hashed piece should be, and the directory structure for the files.

This allows clients to verify the integrity of received files, as well as the ability to recreate exactly the directory structure for the files.

Aside from that, there is a plethora of optional information that can be included in this file such as nodes to be contacted in the DHT, trackers to contact, as well as comments, date created, who created the metainfo file, etc.
3 changes: 2 additions & 1 deletion packages/peer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "peer"
description = "Communication with bittorrent peers via peer wire protocol"
keywords = ["peer", "wire", "protocol", "pwp", "bittorrent"]
readme = "README.md"

authors.workspace = true
categories.workspace = true
Expand All @@ -10,7 +11,7 @@ edition.workspace = true
homepage.workspace = true
license.workspace = true
publish.workspace = true
readme.workspace = true

repository.workspace = true
version.workspace = true

Expand Down
12 changes: 12 additions & 0 deletions packages/peer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Peer
This library assists communication between with bittorrent peers via the peer wire protocol.

Peer communication with bittorrent involves:
- Choking (telling someone we won't respond to them now).
- Expressing interest (telling someone, if we were unchoked, we would be interested in some data they hold).

As well as downloading and uploading the actual blocks to peers.

This package defines some common bittorrent messages, including those as part of the `ExtensionBits` in `bip_handshake`, as well as those included in the [extension protocol (BEP-10)](http://www.bittorrent.org/beps/bep_0010.html).

We also provide a `PeerManager` for heartbeating peers and multiplexing messages sent to/from peers so that clients have an easier time communicating asynchronously with many peers.
3 changes: 2 additions & 1 deletion packages/select/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "select"
description = "Bittorrent Infrastructure Project Piece Selection Module"
keywords = ["piece", "selection"]
readme = "README.md"

authors.workspace = true
categories.workspace = true
Expand All @@ -10,7 +11,7 @@ edition.workspace = true
homepage.workspace = true
license.workspace = true
publish.workspace = true
readme.workspace = true

repository.workspace = true
version.workspace = true

Expand Down
9 changes: 9 additions & 0 deletions packages/select/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Select
This library provides the _Bittorrent Infrastructure Project_ piece selection algorithm.

Selection is broken up in to three classes of algorithms:
1. __Piece Revelation__: Determining which pieces we should reveal (even if we don't have the piece...) and to whom.
2. __Piece Selection__: Determining what pieces we should download/upload next.
3. __Piece Queueing__: Calculating, given a piece we want to download, which peers should we send such a request to.

We can mix and match different algorithms to create a swarm that may have different characteristics than other swarms.
3 changes: 2 additions & 1 deletion packages/util/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "util"
description = "Utilities for the Bittorrent Infrastructure Project"
keywords = ["utility"]
readme = "README.md"

authors.workspace = true
categories.workspace = true
Expand All @@ -10,7 +11,7 @@ edition.workspace = true
homepage.workspace = true
license.workspace = true
publish.workspace = true
readme.workspace = true

repository.workspace = true
version.workspace = true

Expand Down
2 changes: 2 additions & 0 deletions packages/util/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Utility (util)
This library provides utilities used by the _Bittorrent Infrastructure Project_.
3 changes: 2 additions & 1 deletion packages/utp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
name = "utp"
description = "uTorrent Transport Protocol"
keywords = ["utp", "bittorrent", "transport"]
readme = "README.md"

authors.workspace = true
categories.workspace = true
Expand All @@ -10,6 +11,6 @@ edition.workspace = true
homepage.workspace = true
license.workspace = true
publish.workspace = true
readme.workspace = true

repository.workspace = true
version.workspace = true
2 changes: 2 additions & 0 deletions packages/utp/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# uTorrent Transport Protocol (utp)
Not Implemented. Please consider our [Peer](../peer/) package.
Loading

0 comments on commit cc22e3e

Please sign in to comment.