A blockchain implementation with C++ core and JavaScript API layer. This project provides a distributed ledger system with REST API endpoints for client interactions.
- Decentralized peer-to-peer network
- Transaction processing and validation
- Account balance management
- Digital signature verification
- RESTful API interface
- Node.js (v14 or higher)
- C++ compiler (supporting C++11 or higher)
- npm or yarn package manager
- Clone the repository:
git clone https://github.com/Aradhya2708blockshare.git
cd blockshare- Install Node.js dependencies:
npm install- Compile C++ components:
# Compile main blockchain implementation
g++ blockchain.cpp -o blockchain -lws2_32
# Compile hash nonce utility
g++ hashNonce.cpp -o hashNonce-
Create .env with IP and PORT
-
Start the Node.js server:
npm run dev- Execute the blockchain core:
./blockchain- Add peer information in localdb/peers.json
curl -X POST http://localhost:3000/contribute \
-H "Content-Type: application/json" \
-d '{
"provided_port": 8080,
}'curl -X POST http://localhost:3000/submit-txn \
-H "Content-Type: application/json" \
-d '{
"sender": "sender_address",
"recipient": "recipient_address",
"amt": 100,
"nonce": 12345,
"sign": "transaction_signature"
}'curl http://localhost:3000/balancecurl http://localhost:3000/balance/0x123...abc{
"account": "0x123...abc",
"balance": 1000
}- Fork the repository
- Create a feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request