10000 GitHub - Macuilxochitl/DBS
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Macuilxochitl/DBS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0