Git Product home page Git Product logo

chordial's Introduction

Chordial Build Status

Overview

This project is intended to become a robust Scala implementation of Chord, a protocol and algorithm for a peer-to-peer distributed hash table.

Modules

This repo currently contains two modules - core and demo.

Core

The core module is being developed as a reusable Chord library, responsible for maintaining a node's location within a Chord overlay network. This approach, which is based on the architecture described in the Chord paper, allows the Chord network overlay layer to function independently of application-layer concerns such as replication.

Demo

The demo module is a single server demo application that can be used to experiment with Chord's network overlay concepts. It provides an RESTful interface for creating nodes, and a browser-based frontend for visualising a Chord ring.

Running the Demo

To start the demo server using SBT:

sbt "demo/runMain com.tristanpenman.chordial.demo.Demo"

Once the server has started, the browser-based interface should be accessible via http://127.0.0.1:4567/eventstream/websocket.html. This page opens a WebSocket connection to the server, and will be updated with nodes and lines representing their successor relationships as they are added to the network.

Nodes can be created via POST requests to the http://127.0.0.1:4567/nodes endpoint. A new node could be created using cURL:

curl -XPOST -w"\n" http://127.0.0.1:4567/nodes

This would create a new node (and a new Chord network). The response will contain a JSON representation of the new node:

{"nodeId":6,"successorId":6,"active":true}

Although this demo allows you to create multiple independent Chord networks, you will generally want to create nodes that join an existing network. To create a node that is connected to an existing network, you can specify an existing node as a seed ID. For example:

curl -XPOST -w"\n" http://127.0.0.1:4567/nodes?seed_id=6

This would return a JSON representation of the new node, such as:

{"nodeId":6,"successorId":59,"active":true}

The list of all existing nodes can be retrieved via a GET request:

curl -XGET -w"\n" http://127.0.0.1:4567/nodes

This will return a JSON array, where each element represents a node:

[{"nodeId":6,"successorId":59,"active":true}, {"nodeId":59,"successorId":6,"active":true}]

Test Suite

Chordial includes a basic test suite (growing all the time!), which can be run via SBT:

sbt test

License

This project is licensed under the Simplified BSD License. See the LICENSE file for more information.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.