Coder Social home page Coder Social logo

beetee's Introduction

Go Report Card CircleCI

beetee

Bittorrent Client implemented in Go Work in Progress. I have a blog post outlining the protocol in dialog format here.

$ ./beetee -file=linux.torrent

beetee, commandline torrent application. Usage:
  -file string
        path to torrent file
  -peers int
        max peer connections (default 30)
  -seed
        keep running after download completes

Thanks @kracekumar, @alex-segura, and @nschuc, fellow Recursers, for all your help :)

====

Functionality:

  • allow multiple file-torrents
  • allow multiple dir-torrents
  • parse pieces
  • put into pieces struct
  • barse Have and BitField
  • begin Unit and Integration Tests
  • implement UDP and HTTP tracker
  • control peer flow/ask for more peers

Downloading

  • ask peer for index
  • only ask peer if they have it
  • write test for last piece download
  • ask for rarest blocks first

blocks

  • put that block into piece by index
  • concat blocks into data field

Write to disk

  • manage blocks
  • write to disk
  • write to disk gradually
  • read when incomplete and put into pieces

Uploading

  • run server
  • allow handshake
  • parse request
  • send blocks
  • construct bitfield from pieces

====

Package Organisation:

torrent

Torrent/meta/info structs and parse method. The torrent file provides the list of pieces.

tracker

Tracker struct and Response method. The tracker provides a list of peers.

message

Handshake, individual message decoder and message constructor.

peer

Peer struct, connect and Listen method. Also, the message decode switch for payloads is here. This file is mostly IO for the peer sockets.

server

Server struct and Listen method.

piece

Piece/Block struct and piece parser from torrent info. Also piece validator and helper functions for parsing the last piece/blocks in a download.

io

Writing and reading to disk.

For testing, here are the checksums for the torrent files provided in torrents/ Note: this Torrent file is for an older version of Arch; go to their website and get the newer torrent file/md5sum if you plan to use for installing onto your computer.:

17643c29e3c4609818f26becf76d29a3 > Ubuntu
47672450bcda8acf0c8512bd5b543cc0 > Arch

Untested Functionality:

  • UDP tracker

beetee's People

Contributors

fenimore avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

alaxsawe

beetee's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.