]> git.rkrishnan.org Git - functorrent.git/blob - README.md
Merge branch 'piece-manager'
[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 [Cabal](https://www.haskell.org/cabal/) sandbox or
10 [Nix](https://nixos.org/nix/).
11
12 ### Cabal sandbox
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 sandbox init
20     $ cabal install --only-dependencies --enable-tests
21     $ cabal build # binaries in ./dist/built/functorrent/*
22
23 ### Building with Nix
24
25 ``$ nix-shell``` at the root of the source code repo should drop you into a
26 shell which has all the package dependencies installed.
27
28
29     $ nix-shell --pure
30     [...]
31     [nix-shell] $ cabal configure && cabal build
32
33 ## Goals
34
35 - [Optimized for Fun](http://www.slideshare.net/autang/ofun-optimizing-for-fun).
36   (should have called it "funtorrent")
37 - Become more profient with Haskell.
38 - Implement something non-trivial with Haskell (crypto, file operations, network
39   operations, concurrency, bit twiddling, DHT).
40 - Follow the spec ([official spec](http://bittorrent.org/beps/bep_0003.html), [unofficial spec](https://wiki.theory.org/BitTorrentSpecification))
41 - Easy for newbies like me to read and understand along side the spec.
42 - doctest and quickcheck tests.
43 - Follow Haskell Style Guide - https://github.com/tibbe/haskell-style-guide/blob/master/haskell-style.md
44
45 ## Current Status
46
47 - can decode torrent files (bencoding)
48 - talk to the tracker and get the peer list
49 - the `main' program takes a torrent file (in the local file system) as input and
50   prints the {ip,port} for each peer, after talking to the tracker.
51 - can handshake with the peer.
52 - peer wire protocol (in progress)
53
54 ## TODO
55
56 *    Test suite.
57 *    Peer protocol (in progress).
58 *    Get the file download working in the simplest possible way.
59 *    Concurrency (threads per peer)
60 *    other advanced features of Bit Torrent (like DHT).