Giter VIP home page Giter VIP logo

bftdb's Introduction

BFT-SQLITE

Tendermint + Sqlite3 = BFT Database Replication.

Inspired by rqlite and some others, this is an example of using a blockchain to replicate a SQL database. All SQL statements are recorded on the blockchain and inserted into the local sqlite3 database. Every node has a local copy of the db replicated by the transactions on the blockchain. If a node goes offline, it will automatically re-sync with the network.

This example uses an in-memory sql db. So it's very difficult for anyone to locally change/alter the db - and DROP statements are rejected. You can only submit SQL statements through the blockchain, you can not directly interact with the database. However, our simple REST service allows arbitrary queries against the db.

The command line includes 2 options:

  • Start a node (with the embedded database)
  • And and interactive console to send SQL statements to the blockchain (and db)
  1. In one terminal, fire up the blockchain bftdb start
  2. In another terminal, fire up the interactive console bftdb console

For demo purposes, the blockchain creates a table called sample with a single field name which is a string (TEXT).

Example use of the console:

> insert into sample(name) values('dave')
response Status : 200 OK
response Body   : {"check_tx":{"fee":{}},"deliver_tx":{"fee":{}},"hash":"01B60399F645DD59C5CA257C9346D5E96502B1AF","height":39}

> select * from sample
response Status : 200 OK
response Body   : {"columns":["id","name"],"values":[[1,"dave"]]}

bftdb's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

bftdb's Issues

Documentation

@davebryson Liked this good work ! Is there a more detailed documentation or article somewhere ?
Thanks.

Any idea to upgrade bftdb into "safesnap DAO DB"?

I have seen 80000 people to vote a ENS(ethereum name service) proposal on snapshot.org(ipfs) and then it has been written onto a blockchain after 24 hours cooldown period(by safesnap / reality.eth oracle).

Is there any way to modify bftDB to realize the following function?
Enable 80000 people(for example programmers in a table of the bftDB) to vote about a SQL statement, after they reached the quorum, that SQL statement will be executed automatically in bftDB?

Hi

How to deploy multiple nodes?

Upgrade TM

Need to upgrade the TM version and improve the hashing approach used for Txs

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.