Skip to content

ayush1120/CRDT-DisCS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A CRDT Based Distributed Consensus System

To Learn more visit this link.

Installation Instruction

Please Make Sure mongoDB is installed and working correctly.

Cloning Repository

Clone the Github Repository.

Installing Requirements

Install Virtualenv

$ pip3 install virtualenv

Find your Python3 Path

import sys
print(sys.executable)

Example Output

/usr/bin/python3

Run setup.sh with first argument as path to repository and second argument as python3 path Example Command:

$ ./setup.sh  /home/user/CRDT-DisCS  /usr/bin/python3 

The setup.sh script will create envCRDT-DisCS environment inside Project Directory and install all the requirements. ( For UNIX based systems only )

Running Project

Activate the virtual environment by command

$ source <path to repo>/envCRDT-DisCS/bin/activate

Change Directory to /scarf

$ cd <path to repo>/scarf

Initialize Database & Update Migrations

$ python initialize_database.py

This Initilizes databases with random data, all databases have different data, can be viewed using website interface

To Run CRDT Server Nodes

$ cd python <path to repo>/scarf/crdt/server/run_crdt_servers.py

This step clears the databases and after the flasks servers are started now the consensus will be achieved for the updates, called with functions from /scarf/discs/updateDatabases.py

Note: Currently CRDT_UPDATE is marked as true, make it false to stop using CRDTs for consensus. RAFT_UPDATE variable will we used in future to achive consensus using RAFT, paxos based protocol

To Run the terminal interface to interact with a single node:

Note: CRDT Server Nodes should be started & running in a separate terminal beforehand.

$ cd python <path to repo>/scarf/terminal/interface.py

To test the raft based consensus

Currently under development, you can see proof of work by running the following files as :

$ python <path to repo>/Vesper/run_multiple_servers.py

Then in separate terminal -

$ python <path to repo>/Vesper/raft2DB.py 

To Run the Web Interface

Start the django server in development mode via command

$ python <path to repo>/scarf/manage.py runserver

Visit http://localhost:8000/ in your browser to see the web interface.

Deactivate the virtual environment by command

$ deactivate

About

A CRDT Based Distributed Consensus System

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published