Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (bvc-eth) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
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.