A Python-based blockchain implementation with Proof of Stake consensus, smart contracts, P2P networking, and a comprehensive CLI interface.
- ✅ Proof of Stake Consensus - Energy-efficient validation mechanism
- 🤖 Smart Contract Support - Custom VM with gas accounting
- 🌐 P2P Networking - Peer discovery and blockchain synchronization
- 💻 Interactive CLI - User-friendly node management interface
- 📊 REST API - Programmatic access to blockchain functions
- 🔒 Cryptographic Security - ECDSA signatures for blocks and transactions
- 📦 SQLite Database - Persistent storage for blockchain data
- PoS Consensus: Validator selection based on stake weight
- Smart Contracts: Custom VM with gas accounting
- Mempool Management: Transaction pooling with expiration
- State Management: Persistent storage for accounts and contracts
- Peer discovery and connection management
- Blockchain synchronization
- Transaction and block broadcasting
- CLI: Interactive node management
- REST API: HTTP endpoints for integration
- Service Monitoring: Health checks and diagnostics
- Python 3.9+
- SQLite 3.x
- Required packages:
pip install -r requirements.txt
git clone https://github.com/RaitonRed/vex-chain.git
cd vex-chain
pip install -r requirements.txt# Start node with interactive CLI
python main.py
# Start in headless mode
python main.py --no-menu
# Start with custom ports
python main.py --host 0.0.0.0 --p2p-port 6000 --api-port 5000The interactive CLI provides full node management capabilities:
==================== Blockchain Node CLI ====================
1. 📊 Node Status
2. ⛓ Blockchain Info
3. 📝 Mempool Transactions
4. 🌐 Network Peers
5. 🛡️ Validator Status
10. 💸 Send Transaction
20. 💰 Stake Coins
30. 🛠️ Deploy Contract
40. 🔄 Sync Network
99. 🚪 Exit
Select option: | Endpoint | Method | Description |
|---|---|---|
/ |
GET | Node status |
/blocks |
GET | List blocks (paginated) |
/blocks/{index} |
GET | Get block details |
/transactions |
POST | Submit new transaction |
/mine |
POST | Mine a new block |
/health |
GET | Node health status |
blockchain-node/
├── src/
│ ├── blockchain/ # Core blockchain implementation
│ │ ├── consensus/ # Proof of Stake consensus
│ │ ├── contracts/ # Smart contract system
│ │ ├── db/ # Database repositories
│ │ └── ... # Core components
│ ├── cli/ # Command line interface
│ ├── p2p/ # P2P networking
│ ├── api/ # REST API server
│ └── utils/ # Utility modules
├── tests/ # Unit and integration tests
├── data/ # Database storage
├── requirements.txt # Python dependencies
└── main.py # Entry pointContributions are welcome! Please follow these steps:
-
Fork the repository
-
Create a new branch (
git checkout -b feature/your-feature) -
Commit your changes (
git commit -am 'Add some feature') -
Push to the branch (
git push origin feature/your-feature) -
Create a new Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Implement cross-shard transactions
Add privacy features (zk-SNARKs)
Develop browser-based wallet
Create testnet deployment scripts
Add Docker support for easy deployment
Note: This is a simplified implementation for educational purposes. Not recommended for production use without extensive security audits.