This document outlines the steps to run a blockchain project using Python and Django. It describes setting up the development environment with Python 3.7 and installing Django using pip. The project contains 4 modules: a Peer module to add peer details, a Block module to add peers to blocks, a Transaction module for peers to transfer coins, and a Chain module that validates transactions and adds them to the chain if the hash is validated. It provides instructions on using the web interface to add peers, view peers and blocks, perform transactions between peers, and view the full transaction chain. The blockchain code uses functions to validate all transactions by comparing old and new hash codes.
Digitised and Decentralized Block Chain Technology Python Project
1. To run projectinstall python3.7thenusingpipcommandinstall djangousingbelow command
Pipinstall django
Put BlockchainfolderinyoursystemCdirectoryandrun below commandtostart webserverthen
openbrowserandenterbelowURL toget below screen
http://127.0.0.1:8000/index.html andpressentertoget below screen
Thisprojectconsistof 4 modules
PeerModule:usingthismodule we will addpeerdetailstoapplication
Block Module:usingthis module we canaddpeerto block
TransactionModule:one peercan transfercointo otherpeer
Chainmodule:if transactioncompletesandhashcode validatedthentransactionwill be addedto
chainmodule
Firstscreen
In above screenclickon‘AddPeers’linktoaddnew peerdetails
2. In above screenIam addingnewpeeras ‘raju@gmail.com’ andthe entrywillbe available here till it
addedto blockand afteraddingtoblockentrywill be deletedfrompeerscreen.Now clickon‘Add
Peer’buttontoget below screen
In above screenwe can see newlyaddedpeerdetailsshowinginabove screentable.Now clickon
‘AddPeersToBlocks’linkto addthispeerto blockchain.
3. In above screenall addedpeerstoblockchainwill be displayedhere withtheiroldand new hash
code as proof of work.We can see inabove screenNew Hashof firstrow ismatch withprevious
hash of secondrowand goeson till transactionexecutedsuccessfullywithhashvalidation.Scroll
above screentoviewcreateddate also.
Nowwe can selectnewpeername fromdropdownbox and clickon ‘Addto Block’buttonto add
newpeerto newblock
4. In above screennewpeeralsoaddedtoblockandonce itaddedthenthat peerwill be removed
fromdrop downbox.Nowclickon ‘Transactions’linktoperformtransactionbetweenblockchain
users.
In above screenfrompeerandchoose desire topeerfromdropdownbox and thenenteramount
and clickon ‘SubmitTransaction’buttontotransferfund
5. In above screenIam sending100 coinsandafter transactioncomplete will getbelow screen
Nowclickon ‘ViewChain’linktoviewall transactionsdetails