Giter Site home page Giter Site logo

kuan-li / xorro Goto Github PK

View Code? Open in Web Editor NEW

This project forked from xorro-p2p/xorro

0.0 1.0 0.0 434 KB

A Bit-Torrent-Like P2P File Transfer System using Ruby

Home Page: http://xorro-p2p.github.io

Ruby 85.93% Shell 5.38% CSS 2.74% JavaScript 0.85% HTML 5.11%

xorro's Introduction

Xorro P2P

Xorro P2P is a Ruby implementation of a Bit-Torrent-Like Peer to Peer file transfer system. Xorro is experimental, proof of concept software, and not intended as a replacement for existing P2P solutions.

Features

  • A Full implementation of a Kademlia Distributed Hash Table.

  • File sharing by drag/drop into browser - shards and manifest are autogenerated and broadcasted onto network.

  • Files are retreived by requesting the file ID -- manifest file is automatically downloaded, shards are retreived and reassembled.

  • Contents of local routing table and DHT segment can be inspected via web UI.

Getting Started

Dependencies

Ruby 2.3.1
Networking

While anyone can download Xorro, launch a node, and retreive files from the Xorro network, contributing to the network (hosting files available to others) requires one of the following:

  1. Node is directly on the public internet with a public IP, no NAT or Firewall blocking public access.
  2. Node is behind a NAT/Firewall but port forwarding is set up so that the node's port is publicly accessible.
  3. Node is behind a NAT/Firewall with no port forwarding, but a 3rd party tunneling tool is installed.

Ngrok is a tool that allows you to expose a local webserver behind a NAT firewall to the internet via secure tunnel. Xorro supports Ngrok to enable NAT translated communications.

Download Ngrok, unzip the executable, and copy it to somewhere in your $PATH ie: /usr/local/bin/ngrok

Get ngrok here.

Once ngrok is installed, you can optionally create a free account at ngrok.com and install your authtoken. The free account raises Ngrok's request/minute limit, allowing you to contribute to the network.

Installation

  1. Download the repository: git clone https://github.com/xorro-p2p/xorro.git
  2. cd into the xorro directory and run bundle install.

Configuration

  1. Change your username and password in config.yml
  2. Upon first launch, Xorro will create the xorro_homes folder at the location specified in config.yml. The default is ~/Desktop/xorro_homes. Feel free to change this.

Usage

Launching the Application

Xorro ships with a number of launch/kill scripts located in bin.

To launch a Xorro Node from behind a NAT/Firewall and retreive files from the global P2P network, run:

bin/launch_leech.sh

To launch a public Xorro Node on a host directly on the internet, or behind a firewall with port forwarding run:

bin/launch_pf_public.sh 9999   ### or other tcp port number

To launch a Xorro Node on a host behind a firewall, using Ngrok for tunneling:

bin/launch_nat_public.sh 9999   ### or other tcp port number

Your admin control panel is now accessible at http://localhost/9999. Authenticate with the credentials you set in config.yml.

Adding a file

Add a file to the network by navigating to 'Upload File' in the sidebar, then drag an image, pdf, or mp3 into the browser window. Your file will be sharded in the background, after which the shards and manifest will be broadcast to peer nodes. Your file is visible on the 'My Files' page, and the shards/manifests are visible on the Debug/Data page.

Retreiving a file

To retreive a file from the network, navigate to the 'Get File' page and enter the ID of the file you would like.

Don't know the ID of any files on the Xorro network? Try this one: 1376592690108572977913416942036588071274772272329

After successful retreival, the file will appear on the 'My Files' page and can be viewed or downloaded

Shutting Down

To shut down your Xorro node -- run bin/kill_nodes.sh.

Other scripts and environment variables

Development of Xorro required the flexibility to rapidly launch fleets of nodes in a local environment, each with specific environment variables set at launch. The rest of the scripts beneath /bin are written to standardize and streamline this process.

Some relevant environment variables for node launch:

  1. PORT: http port that Sinatra Web UI will run on.
  2. SUPERIP: IPV4 address or fully qualified domain name of supernode to be contacted at boot.
  3. SUPERPORT: TCP Port used to contact supernode at boot.
  4. SUPER: true or false -- is the node a supernode?
  5. NAT: true or false -- is this node behind NAT firewall?
  6. FQDN: Fully Qualified Domain Name or public IP at which the node is reachable.
  7. LEECH: true or false -- this disables the broadcast of location info about any hosted files.

xorro's People

Contributors

davidkurutz avatar dmono avatar newfishg avatar knwang avatar

Watchers

James Cloos avatar

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.