Skip to content

nirmit1509/Perks-cryptocurrency-on-blockchain

Repository files navigation

Perks-cryptocurrency-on-blockchain

This cryptocurrency is implemented on BlockChain in python. Flask framework is used for building web applications. Postman used to make requests.

Features:

  1. You can make transactions between nodes.
  2. Consensus Protocol is achieved.
  3. Mine a new block and get rewarded with some Perks.
  4. Get full blockchain transactions till date.

PROJECT FLOW

  1. First of all start 3 different nodes on different ports i.e. 5001, 5002 and 5003.

  2. Initialize all nodes with a genesis block using GET request on function "get_chain()".

image

  1. Repeat the same process for all the other 2 nodes.

  2. Connect all the nodes together using POST request with specified json format on function "connect_node()".

image

  1. After all nodes are connected, we start mining the blocks using function "mine_node()". You will receive an award of 10 perks once block is successfully mined.

image

  1. Now fetch the latest chain with new mined block using GET request on function "get_chain()".

image

  1. In this step, replace the chain with latest chain on port 5002. We achieve this using "replace_chain()" method.

image

  1. Repeat the same step on port 5003 in order to achieve the consensus on all the 3 different nodes.

  2. Now we will transfer 100 perks from node 5001 to 5002 by adding a transaction using POST method on "add_transaction()". Add the sender details, receiver details and amount to transfer using json format.

image

  1. Again mine this transaction in order to add this in the chain.

image

  1. Now fetch this updated chain on node 5001 using "get_chain()" method.

image

  1. Now if we call "replace_chain()" again it will result in the same output as we have the most updated chain.

image

About

This cryptocurrency is implemented on BlockChain in python.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages