Giter Site home page Giter Site logo

blockchain-assignment-1's Introduction

BITS F452 - Blockchain Technology

Implementation of Delegated Proof of Stake(DPoS) consensus algorithm

Team Members (Group 26)

  1. Deep Chordia (2020A7PS2073H)
  2. Neeraj Gunda (2020A7PS0169H)
  3. Sravika Linga (2020A7PS1310H)

Objective

This assignment focuses on implementing blockchain for maintaining land records. The consensus algorithm used is Delegated Proof of Stake(DPoS).

Implementation

  • All the methods are defined in blockchain.py and the API routes in app.py
  • The DPoS consensus algorithm is defined in blockchain.py file.
  • The merkle.py consists all the functions required to produce merkle root (https://github.com/Tierion/pymerkletools)

Methods

  • We can add nodes to the network using the /add/user API endpoint, while adding user it is required to specify the unique property's name
  • For the voting mechanism, we are using randint function for each node and the vote(their stake) is assigned to the index generated
  • The result function sorts and gives us the 3 eligible miners

API endpoints

localhost:5000 acts as primary node which is responisble for adding new users and election process

  1. /add/users/
  2. This POST route allows us to add new users(nodes) to our blockchain network
  3. /add/transaction/
  4. This POST route allows us to add new transactions(smallest element of a block) to our blockchain network
  5. /history/
  6. This POST route shows us the entire transaction history related to a specific property
  7. /chain/
  8. This GET route allows us to view the blockchain(all the blocks added to blockchain)
  9. /voting/
  10. This GET route initiates the voting process, it sorts the users accoring to the votes they received(stake included) and displays the votes received. Only primary node is eligible to host election
  11. /witnesses/
  12. This GET route displays the the top 3 nodes who received the maximum amount of votes, only these nodes are allowed to mine the block
  13. /mine/
  14. This GET route used for mining the block, a minimum of 2 transactions are required for witnesses(delegates) to mine a block.

Tech

  • This project was built using Python-Flask framework
  • Postman was used to test and interact with the endpoint

blockchain-assignment-1's People

Contributors

deepc004 avatar sravika26 avatar ken2ky 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.