Skip to content

LTe/dht

 
 

Repository files navigation

DHT

Build Status Dependency Status Code Climate Coverage Status Gem Version

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

About

A Ruby implementation of a Distributed Hash Table

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%