Project TestChain can provide a basic understanding of BlockChain.
testChain is a basic demo of Blockchain. This project is developed to get a basic idea of the workings of Blockchain
testChain is developed with Java
, SHA256
Cryptographic algorithm and Mining of Blocks
concept.
There are mainly 2 options to showcase the basic functions of a blockchain :
Display the Blockchain
Insert a block into testChain ( Mine new Block )
- Display the Blockchain✨
The display function will display all blocks in testChain with securely stored data, its hash and mining run (iteration counter of mine block to get specific hash ).
Before displaying testChain, all blocks must undergo 3 authentication checks (i.e. isChainValid function) :
a. registered hash and calculated hash must matched
b. previous hash and registered previous hash must matched
c. check if hash is solved or mining is completed
- Insert a block into testChain ( Mine new Block )✨
For mining of new block or insertion of block in testChain, data is taken from user. For Calculating Hash value SHA-256 Algorithm is applied on String containing previousHash, timeStamp i.e. minning start time in millisecond, data and miner. Block was mined by setting difficulty level 5 (It can be changed).
- Project testChain
- Options
- Displaing Empty testChain
- Adding 1st Block
- Displaying testChain
- Adding next Block
- Adding next Block
- Displaying testChain
- Exit
Java version 8 or higher
-
Press the Fork button (top right the page) to save copy of this project on your account.
-
Download the repository files (project) from the download section or clone this project by typing in the bash the following command:
https://github.com/malivinayak/testChain.git
-
Imported it in Intellij IDEA or any other Java IDE.
-
You can compile directly in command line or terminal too.
-
Run the application :D
-
Alternativly download .class files and directly run in Command Prompt or Terminal.
If you want to contribute to this project and make it better with new ideas, your pull request is very welcomed. If you find any issue just put it in the repository issue section, thank you.
Please ⭐️ this repo Let me know if you have any suggestions