MoritzGoeckel / Kademlia

Implementation of the distributed hashtable Kademlia

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Kademlia

This is an implementation of the distributed hash table Kademlia

Getting started

Node firstNode = new Node(3000, ADDRESS, 10);
Node secondNode = new Node(new RemoteNode("localhost", 3000, firstNode.getNodeId()), 3001, ADDRESS, 10);

firstNode.setValue("Hello", "world", 1);

Assert.assertThat("Should be able to retrieve the set value",
        secondNode.getValue("Hello", 1),
        is("world"));

Assert.assertThat("Should be able to retrieve the set value",
        firstNode.getValue("Hello", 1),
        is("world"));

API

/** Stores a key value pair in the network */
void setValue(String key, String value, int k);

/** Returns the value for a key */
String getValue(String key, int k);

/** Shuts the node down */
void shutdown();

boolean isShutdown();

Report

Download the report and documentation here: KademliaReport.pdf

About

Implementation of the distributed hashtable Kademlia


Languages

Language:Java 62.5%Language:TeX 33.2%Language:Python 4.1%Language:Shell 0.2%