This project implements a basic blockchain network using JavaScript. It follows blockchain principles like immutability, data integrity, and linking blocks with hashes. The project includes a user-friendly website to interact with the blockchain.
-
Blockchain Network: The core of the project uses blocks linked with hashes, ensuring data integrity and immutability.
-
OOP Design: Built using Object-Oriented Programming (OOP), with classes for
Chain
,Block
, and other components. -
Immutability: Once data is added to a block, it cannot be changed. Each block’s hash links to the previous one, preventing tampering.
-
SHA256 Hashing: Blocks are linked using SHA256 hashing to ensure data integrity.
-
API-Driven Backend: The blockchain network is powered by APIs for:
- Adding blocks.
- Viewing the blockchain.
- Fetching the latest block.
-
React.js Frontend: Provides a user-friendly interface to interact with the blockchain via the API.
- JavaScript: Used for the entire blockchain network with OOP principles.
- SHA256: For hashing blocks and ensuring data integrity.
- Express.js: For building the backend API.
- React.js: For the frontend interface.
Visit the website to interact with the blockchain network: MyBlockchain Website
- Add a Block: Submit data to create a new block in the blockchain.
- View the Blockchain: View the entire blockchain and its details.
- Get the Latest Block: Fetch details of the most recently added block.
-
POST /addBlock
Adds a new block.- Request:
{ "data": "Your data here" }
- Response:
200 OK
with the new block.
- Request:
-
GET /getChain
Retrieves the full blockchain.- Response: JSON array of all blocks.
-
GET /getLatestBlock
Retrieves the latest block.- Response: JSON object of the latest block.
The project is hosted online, so there's no need for users to install dependencies or run local servers. Just visit the website to start using the blockchain network.