Coder Social home page Coder Social logo

safestack's Introduction

ChainDB ChainDB

ChainDB is a database that saves data in files and memory. It is based on blockchain technology, so the data is immutable and any change in the data causes chain disturbances and data corruption. ChainDB provides only the SDK that we can implement in our project.

Setup

Clone this repo to your desktop and run npm install to install all the dependencies.

Example

    import ChainDB from 'chaindb'

    const db = new ChainDB('db', 4)
    db.initialize()

    const blocks = db.find();
    console.log(blocks);

ToDo

  • [] Setup ESLint / Prettier
  • [] Prepare CI for Yarn Workspaces (Monorep)
  • [] Make better docs / JSDocs
  • [] P2P Network
  • [] Implement Consensus algorithm
  • [] Make Unit Tests for all packages

API Reference

ChainDB(dbName: string, difficult: number): ChainDB

Constructor for ChainDB class.

initialize(): void

Initializes connection to database.

find(): Array<Block>

Returns all blocks from chain

findOne(index: number): Block

Return one block by specified index from chain

insert(data: object): Block

Saves the new block and returns it.

validate(): boolean

Check validates of chain.

License

ChainDB is licensed under the MIT - see the LICENSE file for details.

safestack's People

Contributors

sxbrsky avatar

Watchers

 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.