]> git.rkrishnan.org Git - functorrent.git/blob - README.md
Now that functorrent is becoming useful, README should be more clear
[functorrent.git] / README.md
1 # A command line bit-torrent client.
2
3 I started writing a bit torrent client because it seemed like fun and I am learning Haskell and wanted to see if I can write something real with Haskell than just heat the room. It is turning out to be a lot of fun.
4
5 [![Join the chat at https://gitter.im/vu3rdd/functorrent](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/vu3rdd/functorrent?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
6
7 [![Build Status](https://travis-ci.org/vu3rdd/functorrent.svg?branch=master)](https://travis-ci.org/vu3rdd/functorrent)
8
9 ## Building
10
11 Functorrent can be build with [Stack](https://github.com/commercialhaskell/stack) or
12 [Nix](https://nixos.org/nix/).
13
14 ### Stack
15
16 Sandboxes give you per project independent containers, just like Python's
17 virtualenv.
18
19
20     $ git clone https://github.com/vu3rdd/functorrent && cd functorrent
21     $ cabal install stack # or install stack by other means
22     $ stack build # binaries in $(pwd)/.stack-work/install/x86..../lts-2.16/7.8.4/bin/functorrent
23
24 ### Building with Nix
25
26 ``$ nix-shell``` at the root of the source code repo should drop you into a
27 shell which has all the package dependencies installed.
28
29
30     $ nix-shell --pure
31     [...]
32     [nix-shell] $ cabal configure && cabal build
33
34 ### Usage
35
36 If you invoke functorrent without any options, it expects the contents of a torrent file
37 to be given in stdin. So
38
39 $ cat ubuntu-14.10-desktop-amd64.iso.torrent | functorrent
40 [....]
41
42 Or one can explicitly specify the torrent file as input.
43
44 $ functorrent ubuntu-14.10-desktop-amd64.iso.torrent
45 [...]
46
47 ## Goals
48
49 - [Optimized for Fun](http://www.slideshare.net/autang/ofun-optimizing-for-fun).
50   (should have called it "funtorrent")
51 - Become more profient with Haskell.
52 - Implement something non-trivial with Haskell (crypto, file operations, network
53   operations, concurrency, bit twiddling, DHT).
54 - Follow the spec ([official spec](http://bittorrent.org/beps/bep_0003.html), [unofficial spec](https://wiki.theory.org/BitTorrentSpecification))
55 - Easy for newbies like me to read and understand alongside the spec.
56 - doctest and quickcheck tests.
57 - Follow Haskell Style Guide - https://github.com/tibbe/haskell-style-guide/blob/master/haskell-style.md
58
59 ## Current Status
60
61 - most of the peer wire protocol works.
62 - talks only to one peer at the moment. Single threaded.
63 - can download files. But needs every piece to be served by the peer it connected to.
64
65 ## WARNING
66
67 - this client is not usable as your daily bit torrent client yet. You may get corrupted files and end up wasting a lot of bandwidth. So, until we achieve some robustness, consider this as a programmer-friendly project to learn about a bunch of stuff.
68
69 ## TODO
70
71 *    Test suite.
72 *    Talk to multiple peers.
73 *    Piece download algorithms.
74 *    Concurrency (threads per peer)
75 *    Multifile torrent support.
76 *    other advanced features of Bit Torrent (like DHT).