Giter Site home page Giter Site logo

dbs's Introduction

DBS

DBS as Distributed Broadcast System.

How to set up

Install requirements

pip3 install -r requirements.txt

Setup Central node

Central used to help nodes found each other. When any common node start, it needs to register to central and retrieve others node's information from central node, therefore you need to start a central node first.

Use config template provided in repo and set IS_CENTRAL_NODE = True to start a central node.

python3 app.py

Setup common node

After central node started, then you can start common node.

Change CENTRAL_NODE_ADDRESS in config to central node's address and set IS_CENTRAL_NODE to False, then run:

python3 app.py

to start a common node.

Auto recover

Please using any auto recover mechanism to run node to ensure node can be recovered after it has been killed. After it restarted and sync with central node, it will automatically recover all data and start to work.

API

Get all data from a node

curl --location --request GET 'http://xxx.com/data/'

Post a new data

curl --location --request PUT 'http://xxx.com/data/'
--header 'Content-Type: application/json'
--data-raw '{ "id": "115", "raw": "test", "signature": "aaa" }'

How it works

start and election

post a data and all success

post a data, then prepare fail but rollback success

post a data, then prepare fail and rollback fail as well

post a data and prepare success, then submit fail

dbs's People

Contributors

macuilxochitl avatar

Watchers

James Cloos avatar  avatar

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.