Skip to content

Implementation of the distributed hashtable Kademlia

Notifications You must be signed in to change notification settings

MoritzGoeckel/Kademlia

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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