DHT
A Ruby implementation of a Distributed Hash Table.
Basic usage
You can create instance of DHT::Hash
and use like normal Hash
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
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