A distributed cloud storage solution combining Hyperledger Fabric blockchain technology with MinIO object storage for enhanced data integrity verification and auditability.
This project demonstrates a decentralized storage architecture where:
- Files are uploaded via REST API
- SHA-256 cryptographic hashes are computed
- Files are stored in MinIO object storage
- Hashes and metadata are immutably recorded on Hyperledger Fabric blockchain
- File integrity can be verified at any time by comparing hashes
- π Data Integrity: Cryptographic hash verification ensures files haven't been tampered with
- π Immutable Audit Trail: All file operations recorded on blockchain
- ποΈ Decentralized Storage: Combines blockchain ledger with object storage
- π Tamper Detection: Automatic detection of unauthorized file modifications
- π Transparent History: Complete audit log of all file operations
- π RESTful API: Easy integration with existing applications
prototype/
βββ README.md # Project documentation
βββ LICENSE # MIT License
βββ .env.example # Environment configuration template
βββ fabric/ # Hyperledger Fabric setup
β βββ README-FABRIC.md
βββ chaincode/ # Smart contracts
β βββ hash-chaincode/
β βββ package.json
β βββ index.js
β βββ lib/chaincode.js
βββ backend/ # Node.js API server
β βββ package.json
β βββ .env
β βββ src/
β β βββ app.js # Express application
β β βββ fabricClient.js # Blockchain integration
β β βββ minioClient.js # Storage integration
β β βββ utils.js # Utilities
β βββ scripts/
β βββ benchmark.sh # Performance testing
β βββ enrollUser.js # User enrollment
βββ tests/ # Test suite
β βββ api-test.sh # API endpoint tests
β βββ tamper-test.sh # Integrity tests
β βββ sample-files/
βββ docs/ # Documentation
βββ evaluation-plan.md
- Docker & Docker Compose - Container runtime
- Node.js v18+ - JavaScript runtime
- Git - Version control
- cURL - HTTP client for testing
- Linux/macOS/Windows WSL - Development environment
- Clone the repository
git clone https://github.com/wardvisual/blockchain-cloud-storage-prototype.git
cd blockchain-cloud-storage-prototype- Set up Hyperledger Fabric
Follow instructions in fabric/README-FABRIC.md:
# Download Fabric samples and binaries
curl -sSL https://bit.ly/2ysbOFE | bash -s
# Start test network
cd fabric-samples/test-network
./network.sh up createChannel -c mychannel -ca
# Deploy chaincode
./network.sh deployCC -ccn hashcc -ccp ../../chaincode/hash-chaincode -ccl javascript- Start MinIO
docker run -d \
-p 9000:9000 \
-p 9001:9001 \
--name minio \
-e "MINIO_ROOT_USER=minioadmin" \
-e "MINIO_ROOT_PASSWORD=minioadmin" \
minio/minio server /data --console-address ":9001"- Configure and start backend
cd backend
cp ../.env.example .env
# Edit .env with your Fabric connection details
npm install
npm startServer will be available at http://localhost:3000
GET /healthPOST /upload
Content-Type: multipart/form-data
curl -X POST -F "file=@document.pdf" -F "uploader=user1" \
http://localhost:3000/uploadResponse:
{
"ok": true,
"fileID": "550e8400-e29b-41d4-a716-446655440000",
"objectName": "550e8400-e29b-41d4-a716-446655440000-document.pdf",
"sha256": "3a5c7...",
"uploader": "user1",
"metadata": {
"originalName": "document.pdf",
"mime": "application/pdf",
"size": 2048576
}
}GET /verify/:fileID
curl http://localhost:3000/verify/550e8400-e29b-41d4-a716-446655440000Response:
{
"ok": true,
"fileID": "550e8400-e29b-41d4-a716-446655440000",
"match": true,
"record": {
"sha256": "3a5c7...",
"timestamp": "2025-10-07T12:00:00.000Z"
},
"computed": "3a5c7...",
"message": "File integrity verified"
}GET /filesGET /file/:fileIDcd tests
chmod +x api-test.sh
./api-test.shchmod +x tamper-test.sh
./tamper-test.shcd backend/scripts
chmod +x benchmark.sh
./benchmark.sh 50 # Run 50 iterationsβββββββββββββββ
β Client β
ββββββββ¬βββββββ
β
βΌ
βββββββββββββββββββββββββββββββ
β REST API Server β
β (Express.js Backend) β
ββββββββ¬βββββββββββββββ¬ββββββββ
β β
βΌ βΌ
ββββββββββββββββ ββββββββββββββββ
β MinIO β β Hyperledger β
β Storage β β Fabric β
β β β Blockchain β
ββββββββββββββββ ββββββββββββββββ
(File Data) (Hash Records)
- Cryptographic Hashing: SHA-256 for file integrity
- Immutable Records: Blockchain prevents data tampering
- Audit Trail: Complete history of all operations
- Access Control: Fabric MSP for identity management
- Tamper Detection: Automatic verification of file integrity
- Upload Latency: ~500-2000ms (varies by file size)
- Verification Latency: ~200-500ms
- Throughput: ~100-500 transactions/second
- Storage Overhead: ~250-500 bytes per file (blockchain metadata only)
Edit .env file in backend/ directory:
# MinIO Configuration
MINIO_ENDPOINT=127.0.0.1
MINIO_PORT=9000
MINIO_ACCESS_KEY=minioadmin
MINIO_SECRET_KEY=minioadmin
MINIO_BUCKET=files
# Hyperledger Fabric Configuration
FABRIC_CONNECTION=./connection-org1.json
WALLET_PATH=./wallet
FABRIC_USER=appUser
CHANNEL_NAME=mychannel
CHAINCODE_NAME=hashcc
# Server Configuration
PORT=3000This is an initial setup and proof-of-concept demonstrating the integration of blockchain technology with cloud storage. The core functionality is implemented and working, but this is an early-stage project.
Contributions are welcome! Feel free to:
- Report bugs
- Suggest features
- Submit pull requests
- Improve documentation
- Web-based UI interface
- Multi-user authentication
- File encryption at rest
- Advanced access control policies
- Performance optimizations
- Multi-node Fabric network setup
- Comprehensive test coverage
- Blockchain: Hyperledger Fabric 2.5+
- Object Storage: MinIO
- Backend: Node.js, Express.js
- Smart Contracts: JavaScript (Fabric Contract API)
- SDKs: Fabric Node SDK, MinIO JavaScript SDK
- Hashing: SHA-256 (crypto module)
Connection profile not found
- Ensure Fabric network is running
- Copy
connection-org1.jsonto backend folder
Identity does not exist
- Run enrollment script:
node backend/scripts/enrollUser.js - Check wallet path in
.env
MinIO connection refused
- Verify container is running:
docker ps | grep minio - Check endpoint and credentials in
.env
Chaincode not deployed
- Check deployed chaincodes:
docker ps | grep dev-peer - Redeploy using test network scripts
This project is licensed under the MIT License - see the LICENSE file for details.
wardvisual - GitHub Profile
- Hyperledger Fabric community
- MinIO team
- Open source contributors
- Issues: GitHub Issues
- Documentation: Check
/docsfolder - Community: Hyperledger Discord/Slack
Note: This is an early-stage project demonstrating blockchain-based storage concepts. It's suitable for development, testing, and learning purposes. Production deployment would require additional security hardening, monitoring, and optimization.
β Star this repo if you find it interesting!