X-Git-Url: https://git.rkrishnan.org/?p=functorrent.git;a=blobdiff_plain;f=README.md;h=457a754818fb90e688900103a476fb2a219931f1;hp=06af0f49bf7ddc02c0f56b6c7a6ef3d066012302;hb=27fccae52521d6b0d0502708d737c3b6eb908941;hpb=de4c6fbd9b420c7832ad5df25d70527dfad139d8 diff --git a/README.md b/README.md index 06af0f4..457a754 100644 --- a/README.md +++ b/README.md @@ -1,60 +1,67 @@ -# A bittorrent client. +# A command line BitTorrent client. -[![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) +I started writing a BitTorrent 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. -[![Build Status](https://travis-ci.org/vu3rdd/functorrent.svg?branch=master)](https://travis-ci.org/vu3rdd/functorrent) - -## Building - -Functorrent can be build with [Cabal](https://www.haskell.org/cabal/) sandbox or -[Nix](https://nixos.org/nix/). - -### Cabal sandbox - -Sandboxes give you per project independent containers, just like Python's -virtualenv. +### Building +You need to install [Stack](https://github.com/commercialhaskell/stack), either via +the OS package manager or via `cabal` (`cabal install stack`). $ git clone https://github.com/vu3rdd/functorrent && cd functorrent - $ cabal sandbox init - $ cabal install --only-dependencies --enable-tests - $ cabal build # binaries in ./dist/built/functorrent/* + $ cabal install stack # or install stack by other means + $ stack build # binaries in $(pwd)/.stack-work/install/x86..../lts-2.16/7.8.4/bin/functorrent + +### Usage -### Building with Nix +If you invoke functorrent without any options, it expects the contents of a torrent file +to be given in stdin. So -``$ nix-shell``` at the root of the source code repo should drop you into a -shell which has all the package dependencies installed. + $ cat ubuntu-14.10-desktop-amd64.iso.torrent | functorrent + [....] +Or one can explicitly specify the torrent file as input. - $ nix-shell --pure + $ functorrent ubuntu-14.10-desktop-amd64.iso.torrent [...] - [nix-shell] $ cabal configure && cabal build -## Goals +### Goals - [Optimized for Fun](http://www.slideshare.net/autang/ofun-optimizing-for-fun). (should have called it "funtorrent") - Become more profient with Haskell. - Implement something non-trivial with Haskell (crypto, file operations, network operations, concurrency, bit twiddling, DHT). -- Follow the spec - https://wiki.theory.org/BitTorrentSpecification -- Easy for newbies like me to read and understand along side the spec. +- Follow the spec ([official spec](http://bittorrent.org/beps/bep_0003.html), [unofficial spec](https://wiki.theory.org/BitTorrentSpecification)) +- Easy for newbies like me to read and understand alongside the spec. - doctest and quickcheck tests. - Follow Haskell Style Guide - https://github.com/tibbe/haskell-style-guide/blob/master/haskell-style.md -## Current Status +### WARNING + +This client is not usable as your daily BitTorrent 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. + +### Current Status + +- most of the peer wire protocol works. +- talks only to one peer at the moment. +- can download files. But needs every piece to be served by the peer it connected to. +- can talk to http/udp trackers. + +### TODO -- can decode torrent files (bencoding) -- talk to the tracker and get the peer list -- the `main' program takes a torrent file (in the local file system) as input and - prints the {ip,port} for each peer, after talking to the tracker. -- can handshake with the peer. -- peer wire protocol (in progress) +- Test suite. +- Talk to multiple peers concurrently. +- Piece download algorithms. +- Multifile torrent support. +- Magnet link support. +- other advanced features of BitTorrent (like DHT). -## TODO +### Misc -* Test suite. -* Peer protocol (in progress). -* Get the file download working in the simplest possible way. -* Concurrency (threads per peer) -* other advanced features of Bit Torrent (like DHT). +The Bangalore Haskell group forked an early version of this code and started to develop it as a group. My code has diverged a lot from it. Both are calling it functorrent. Perhaps that needs to be fixed.