Skip to content

About

Blockchain-based ration distribution system designed to improve transparency, traceability, and accountability in public distribution.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

7 Commits

Folders and files

Repository files navigation

ration_blockchain

A simple program to add purchase of the customers in the blockchain.

This repository contains my code inspired from "Udemy's Blockchain A-Z™: Learn How To Build Your First Blockchain, by Kirill Eremenko and Hadelin de Ponteves".

OPERATIONS :

  1. Connect Nodes
  • Nodes are running on different port numbers
  1. Record transactions in blockchain
  • Each node will add user data : name, uid, address, and purchase
  1. Mining blocks
  • Perform proof of work and add transactions to the block
  1. Update and validate the copy of the blockchain
  • Check the longest copy of the blockchain

METHODS USED (for sending requests to Postman):

  1. connect_node : to connect to other nodes (Post request)
{
"nodes": ["http://127.0.0.1:5001",`
"http://127.0.0.1:5002",`
"http://127.0.0.1:5003"]`
}
  1. get_chain : to get the blockchain copy (Get Request)
  2. add_transaction : add user information (Post Request)
{
"name": "",
"uid": "",
"address": "",
"purchase": ""
}
  1. mine_block : perform proof of work, if successful mine the block (Get Request)
  2. replace_chain : to find the longest chain in the entire blockchain network (Get Request)
  3. is_valid : validate whether the blockchain is valid or not (Get Request)
  4. verify all the hash values

OTHER METHODS

  1. create_block : once proof of work is found block will be created
  2. get_previous_block : get the index of the previous block
  3. proof_of_work : compute the desired hash challenge
  4. hash : returns the hash value
  5. add_node : for connecting the nodes

VIDEO DEMONSTATION

Demonstration

About

Blockchain-based ration distribution system designed to improve transparency, traceability, and accountability in public distribution.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages