]> git.rkrishnan.org Git - functorrent.git/blob - README.md
update REAME.
[functorrent.git] / README.md
1 # A bittorrent client.
2
3 [![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)
4
5 [![Build Status](https://travis-ci.org/vu3rdd/functorrent.svg?branch=master)](https://travis-ci.org/vu3rdd/functorrent)
6
7 ## Building
8
9 Functorrent can be build with [Stack](https://github.com/commercialhaskell/stack) or
10 [Nix](https://nixos.org/nix/).
11
12 ### Stack
13
14 Sandboxes give you per project independent containers, just like Python's
15 virtualenv.
16
17
18     $ git clone https://github.com/vu3rdd/functorrent && cd functorrent
19     $ cabal install stack # or install stack by other means
20     $ stack build # binaries in $(pwd)/.stack-work/install/x86..../lts-2.16/7.8.4/bin/functorrent
21
22 ### Building with Nix
23
24 ``$ nix-shell``` at the root of the source code repo should drop you into a
25 shell which has all the package dependencies installed.
26
27
28     $ nix-shell --pure
29     [...]
30     [nix-shell] $ cabal configure && cabal build
31
32 ### Usage
33
34 If you invoke functorrent without any options, it expects the contents of a torrent file
35 to be given in stdin. So
36
37 $ cat ubuntu-14.10-desktop-amd64.iso.torrent | functorrent
38 [....]
39
40 Or one can explicitly specify the torrent file as input.
41
42 $ functorrent ubuntu-14.10-desktop-amd64.iso.torrent
43 [...]
44
45 ## Goals
46
47 - [Optimized for Fun](http://www.slideshare.net/autang/ofun-optimizing-for-fun).
48   (should have called it "funtorrent")
49 - Become more profient with Haskell.
50 - Implement something non-trivial with Haskell (crypto, file operations, network
51   operations, concurrency, bit twiddling, DHT).
52 - Follow the spec ([official spec](http://bittorrent.org/beps/bep_0003.html), [unofficial spec](https://wiki.theory.org/BitTorrentSpecification))
53 - Easy for newbies like me to read and understand alongside the spec.
54 - doctest and quickcheck tests.
55 - Follow Haskell Style Guide - https://github.com/tibbe/haskell-style-guide/blob/master/haskell-style.md
56
57 ## Current Status
58
59 - can decode torrent files (bencoding)
60 - talk to the tracker and get the peer list
61 - the `main' program takes a torrent file (in the local file system) as input and
62   prints the {ip,port} for each peer, after talking to the tracker.
63 - can handshake with the peer.
64 - peer wire protocol (in progress)
65
66 ## TODO
67
68 *    Test suite.
69 *    Peer protocol (in progress).
70 *    Get the file download working in the simplest possible way.
71 *    Concurrency (threads per peer)
72 *    other advanced features of Bit Torrent (like DHT).