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.
-
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.
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:
- Node is directly on the public internet with a public IP, no NAT or Firewall blocking public access.
- Node is behind a NAT/Firewall but port forwarding is set up so that the node's port is publicly accessible.
- 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
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.
- Download the repository:
git clone https://github.com/xorro-p2p/xorro.git
cd
into thexorro
directory and runbundle install
.
- Change your username and password in
config.yml
- Upon first launch, Xorro will create the
xorro_homes
folder at the location specified inconfig.yml
. The default is ~/Desktop/xorro_homes. Feel free to change this.
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
.
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.
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
To shut down your Xorro node -- run bin/kill_nodes.sh
.
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:
PORT
: http port that Sinatra Web UI will run on.SUPERIP
: IPV4 address or fully qualified domain name of supernode to be contacted at boot.SUPERPORT
: TCP Port used to contact supernode at boot.SUPER
: true or false -- is the node a supernode?NAT
: true or false -- is this node behind NAT firewall?FQDN
: Fully Qualified Domain Name or public IP at which the node is reachable.LEECH
: true or false -- this disables the broadcast of location info about any hosted files.