bvc-eth
v1.2.8
Published
Blockchain Version Control - Decentralized version control system powered by blockchain and IPFS
Maintainers
Readme
🔗 Blockchain Version Control (BVC)
A decentralized version control system inspired by Git, but powered by blockchain and IPFS. Features cost-optimized local commits with efficient blockchain checkpoints.
📦 NPM Package Users: After installing via npm, BVC works out-of-the-box with Sepolia testnet! Just run
bvc config --setupto get started. No local blockchain deployment needed.
✨ Features
- 🚀 Decentralized: No central server required
- ⛓️ Blockchain-powered: Immutable commit history on Ethereum
- 🌐 IPFS storage: Decentralized file storage
- 💰 Cost Optimized: Local commits (free) + blockchain checkpoints (efficient)
- 🔐 Cryptographically secure: SHA256 file hashing
- 💻 Git-like CLI: Familiar commands and workflows
- 🌍 Multi-network: Supports Sepolia testnet, local dev, and mainnet
- ↩️ Version Revert: Revert to any previous commit state
📦 Installation
Global Installation (Recommended)
npm install -g bvc-eth
bvc config --setup # Quick setup wizardLocal Installation
npm install bvc-eth
npx bvc config --setup # Quick setup wizardFor Development
git clone https://github.com/Lviffy/BVC.git
cd BVC
npm install
npm link # or use: node bin/bvc.js🚀 Quick Start
1. Configure BVC
# Global installation
bvc config --setup
# Local installation
npx bvc config --setupWhat you'll need:
- Ethereum wallet private key (create a new one for testing!)
- Network choice (Sepolia testnet recommended for beginners)
- Test ETH from Sepolia Faucet (free!)
2. Create a Repository
bvc init my-project
cd my-project3. Add Files and Commit
bvc add README.md
bvc commit -m "Initial commit"4. Push to Blockchain
bvc push5. Version Control (Optional)
bvc log # View commit history
bvc revert <commit-hash> # Revert to any previous version💰 Cost Optimization
BVC is designed for cost efficiency:
Local Commits (Free)
bvc add file.js
bvc commit -m "Add feature" # No gas fees!Blockchain Checkpoints (Efficient)
bvc checkpoint --message "Batch multiple commits" # Single transactionBenefits:
- ✅ Unlimited local commits (0 gas fees)
- ✅ Batch commits into single blockchain transaction
- ✅ 50-90% gas savings vs individual commits
- ✅ Full Git-like workflow
📋 Complete Command Reference
Repository Management
bvc init [name] - Create repository (blockchain required)
bvc init my-project # Create blockchain repository
bvc init --local-only my-repo # Create local repository only
bvc init --interactive # Interactive setup
bvc init --upgrade-blockchain # Upgrade local repo to blockchainbvc config - Configuration management
bvc config --setup # Interactive setup
bvc config --private-key <key> # Set wallet private key
bvc config --rpc-url <url> # Set blockchain RPC
bvc config --ipfs-endpoint <url> # Set IPFS endpoint
bvc config --show # Show current configbvc clone <repo-id> - Clone repository
bvc clone 12345abc... # Clone by repository IDbvc status - Show repository status
bvc status # Show staged/untracked filesFile Operations
bvc add <files> - Stage files
bvc add file.js # Add single file
bvc add . # Add all files
bvc add *.js # Add with glob patternsbvc commit -m "message" - Create commit
bvc commit -m "Add feature" # Local commit (free)
bvc commit --blockchain -m "msg" # Direct blockchain commitbvc revert <commit-hash> - Revert to specific commit
bvc revert 436b0deb # Revert to specific commit
bvc revert abc123 --force # Force revert (overwrite changes)
bvc revert def456 --no-backup # Skip backup creationSynchronization
bvc push - Push commits to blockchain
bvc push # Push individual commitsbvc checkpoint - Batch commits efficiently
bvc checkpoint --message "Batch" # Batch multiple commits
bvc checkpoint --dry-run # Preview cost savingsbvc pull - Pull latest changes
bvc pull # Fetch from blockchain/IPFSbvc log - View commit history
bvc log # Show commit history
bvc log --checkpoints # Show checkpoint historyAdvanced Features
bvc list - List repositories
bvc list # Show all repositories🔧 Configuration
BVC requires blockchain and IPFS configuration:
Required Settings
- Private Key: Your Ethereum wallet private key
- RPC URL: Blockchain network endpoint (Sepolia/Mainnet)
- IPFS Endpoint: IPFS node for file storage
Setup Process
bvc config --setupThis will prompt for:
- Wallet private key (keep secure!)
- Blockchain RPC URL
- IPFS endpoint URL
💡 Usage Examples
Basic Workflow
# Setup
bvc config --setup
# Create repository
bvc init my-app
cd my-app
# Development (free local commits)
echo "console.log('Hello');" > app.js
bvc add app.js
bvc commit -m "Add basic app"
echo "console.log('Hello World');" > app.js
bvc add app.js
bvc commit -m "Improve greeting"
# Efficient blockchain sync
bvc checkpoint --message "Initial app development"Cost Comparison
# Traditional approach (expensive)
bvc commit --blockchain -m "commit 1" # Gas fee #1
bvc commit --blockchain -m "commit 2" # Gas fee #2
bvc commit --blockchain -m "commit 3" # Gas fee #3
# BVC approach (efficient)
bvc commit -m "commit 1" # Free
bvc commit -m "commit 2" # Free
bvc commit -m "commit 3" # Free
bvc checkpoint --message "All commits" # Gas fee #1 onlyVersion Control with Revert
# View commit history
bvc log
# Revert to previous version
bvc revert 436b0deb # Revert to specific commit
bvc status # Check restored files
# Continue development
bvc add . && bvc commit -m "Fix after revert"🏗️ Architecture
Repository Structure
my-project/
├── .bvc/
│ ├── config.json # Repository configuration
│ ├── commits.json # Local commit history
│ ├── staging.json # Staged files
│ └── user-config.json # User blockchain config
├── .bvcignore # Ignore patterns
└── README.md # Project filesData Flow
- Local Commits: Files hashed and stored locally
- IPFS Upload: File contents uploaded to IPFS on checkpoint
- Blockchain Anchor: Commit metadata anchored on Ethereum
- Merkle Proofs: Cryptographic integrity verification
🔧 Troubleshooting
Common Issues
"Blockchain configuration required"
# Solution: Configure blockchain first
bvc config --setup"IPFS node not available"
# Install IPFS
# Option 1: Use public gateway
bvc config --ipfs-endpoint https://ipfs.infura.io:5001
# Option 2: Run local IPFS node
ipfs daemon"Repository does not exist"
- Ensure repository was created with
bvc init - Check repository ID with
bvc status
Network Requirements
- Sepolia Testnet: For testing (recommended)
- Ethereum Mainnet: For production use
- IPFS: For decentralized file storage
🤝 Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
📄 License
MIT License - see LICENSE file for details.
� Documentation
🚀 Getting Started
- Quick Start Guide - 5-minute setup and basic usage
- Usage Examples - Real-world scenarios and workflows
💰 Cost Optimization
- Cost Optimization Guide - Save 50-90% on gas fees
- Key Features:
- ✅ Local commits (free)
- ✅ Blockchain checkpoints (efficient batching)
- ✅ IPFS integration
📋 Commands & Reference
- Command Reference - Complete command documentation
- Technical Architecture - System design and internals
🔧 Setup & Configuration
- RPC Guide - Blockchain network configuration
- Sepolia Deployment - Testnet deployment guide
🔗 Links
echo "console.log('Hello BVC!');" > index.js
bvc-eth add index.js
bvc-eth commit -m "Initial commit"4. Push to Blockchain
bvc-eth push5. View History
bvc-eth log6. Collaborate
# Share your repository ID with others
bvc-eth list --mine
# Others can clone your repository
bvc-eth clone <your-repo-id>
# Pull latest changes
bvc-eth pull📋 Commands
| Command | Description | Status |
|---------|-------------|---------|
| bvc-eth init [name] | Create new repository | ✅ Working |
| bvc-eth config | Configure wallet/blockchain | ✅ Working |
| bvc-eth add <files> | Stage files for commit | ✅ Working |
| bvc-eth commit -m "msg" | Create commit with IPFS upload | ✅ Working |
| bvc-eth status | Show repository status | ✅ Working |
| bvc-eth log | View commit history | ✅ Working |
| bvc-eth push | Push commits to blockchain | ✅ Working |
| bvc-eth pull | Pull commits from blockchain | ✅ Working |
| bvc-eth clone <id> | Clone repository from blockchain | ✅ Working |
| bvc-eth checkpoint | Create commit batches | ✅ Working |
| bvc-eth list | List all repositories | ✅ Working |
⚙️ Configuration
BVC requires configuration for blockchain and IPFS integration:
bvc config --setupRequired settings:
- Private Key: Your wallet private key
- RPC URL: Blockchain RPC endpoint (Sepolia, Mainnet, etc.)
- IPFS Endpoint: IPFS node URL
🏗️ Architecture
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ BVC CLI │───▶│ Smart Contract │───▶│ Blockchain │
│ (Commander) │ │ (Solidity) │ │ (Ethereum) │
└─────────────────┘ └──────────────────┘ └─────────────────┘
│ │ │
▼ ▼ ▼
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Local Storage │ │ File Hashing │ │ IPFS │
│ (.bvc/) │ │ (SHA256) │ │ (Distributed) │
└─────────────────┘ └──────────────────┘ └─────────────────┘🧪 Testing
npm test📜 License
MIT © Lviffy
🤝 Contributing
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
📞 Support
- 📧 Issues: GitHub Issues
- 📖 Documentation: Command Guide
- 🌐 Website: GitHub Repository
⚠️ Note: This is an early-stage project. Use at your own risk and test thoroughly before production use.
