Skip to the content.

BlockChain Working Model

This was my first prototype created after getting to know how Blockchain network really works

Technologies/Tools Used

How to run??

Clone the repository run » ***node main.js <...><...><...>**

example: node main.js Alice Bob 10 Sender Reciever 20 OUTPUT:-

Block with  Alice  as its first transaction started...
Block with  Sender  as its last transaction mined successfully...
Mining Success
Miner's Bal:  0
Now Mining Miner's Block...
Block with  null  as its first transaction started... 
Block with  null  as its last transaction mined successfully...
Mining Success
Miner's Bal:  10
Now Mining Miner's Block...
Block with  null  as its first transaction started...
Block with  null  as its last transaction mined successfully...
Mining Success
Miner's Bal:  20
Note: Here null refers to miners address since he is mining his own block so from address is null there

Methods

main.js

Block.js

Transaction.js

BlockChain.js

Here comes the core part of this whole network which includes creating blocks from the pending transaction list and adding it to the chain once a proper hash value is found by the miner. And ya, it earns the miner a new crypto coin….

Still Much More to Go….

[ ] Planning to create a UI for the same and add more functionalities once i get to know the whole indepth working of the blockchain.