forked from CodeMonkeySteve/dht
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
37 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,46 @@ | ||
= DHT | ||
DHT | ||
=== | ||
|
||
[![Build Status](https://secure.travis-ci.org/LTe/dht.png)](http://travis-ci.org/LTe/dht) | ||
[![Dependency Status](https://gemnasium.com/LTe/dht.png)](https://gemnasium.com/LTe/dht) | ||
[![Code Climate](https://codeclimate.com/github/LTe/dht.png)](https://codeclimate.com/github/LTe/dht) | ||
[![Coverage Status](https://coveralls.io/repos/LTe/dht/badge.png?branch=master)](https://coveralls.io/r/LTe/dht?branch=master) | ||
[![Gem Version](https://badge.fury.io/rb/dht.png)](http://badge.fury.io/rb/dht) | ||
|
||
A Ruby implementation of a Kademlia-style Distributed Hash Table. | ||
A Ruby implementation of a Distributed Hash Table. | ||
|
||
Basic usage | ||
=========== | ||
|
||
You can create instance of `DHT::Hash` and use like normal `Hash` | ||
|
||
```ruby | ||
require 'dht/hash' | ||
|
||
hash = DHT::Hash.new | ||
hash[:key] = :value # => :value | ||
hash[:key] # => :value | ||
``` | ||
|
||
Advanced usage | ||
============== | ||
|
||
You can create instance of `DHT::Hash` with few options | ||
|
||
* **host** - your IP address or domain | ||
* **port** - your open port where DHT::Hash will be listen | ||
* **name** - name of your node | ||
* **node** - bootstrap node | ||
|
||
```ruby | ||
require 'dht/hash' | ||
|
||
hash = DHT::Hash.new :host => "mydomain.com" # default 127.0.0.1 | ||
:port => 8080 # default 3000 | ||
:name => "my_name" # default "node" | ||
:node => { :id => "bootstrap", :addr => 'tcp://domain.com:2042' } # boostrap node | ||
:explorer => true # enable explorer | ||
``` | ||
|
||
|
||
== Work-in-progress | ||
|
||
Author:: Steve Sloan (mailto:steve@finagle.org) | ||
Website:: http://github.com/CodeMonkeySteve/dht | ||
Copyright:: Copyright (c) 2009 Steve Sloan | ||
License:: MIT |