A Web3 platform for peer-to-peer renewable energy trading built on the Stellar blockchain with Soroban smart contracts.
VoltXchange enables direct energy trading between producers and consumers using blockchain technology, smart contracts, and IoT integration. Energy producers can tokenize their renewable energy output as tradable "sparks" tokens, while consumers can purchase energy directly from the grid.
- EnergyToken: ERC-20 compatible token representing energy credits
- TradeEngine: P2P escrow system for energy trades
- MeterOracle: IoT data validation and token minting
- Live Grid Map visualization
- Usage Dashboard with real-time analytics
- Trading Interface for P2P energy exchange
- Wallet integration with Stellar
- IoT Bridge: MQTT/CoAP gateway for meter data
- Price Aggregator: Real-time energy price feeds
- Node.js 18+
- Rust 1.70+
- Soroban CLI
- Docker (for IPFS)
- Clone the repository
git clone <repository-url>
cd VoltXchange- Install frontend dependencies
cd frontend
npm install- Install backend dependencies
cd ../backend
npm install- Build smart contracts
cd ../contracts
cargo build --target wasm32-unknown-unknown --releaseCreate .env files in each service directory:
Frontend (.env)
REACT_APP_STELLAR_NETWORK=testnet
REACT_APP_CONTRACT_ADDRESS=<contract-address>
Backend (.env)
STELLAR_NETWORK=testnet
ORACLE_CONTRACT_ID=<oracle-contract>
ENERGY_TOKEN_CONTRACT_ID=<token-contract>
ORACLE_SECRET_KEY=<oracle-secret>
MQTT_BROKER_URL=mqtt://localhost:1883
- Start IPFS node
ipfs daemon- Deploy smart contracts
cd contracts
soroban contract deploy EnergyToken.wasm --network testnet
soroban contract deploy TradeEngine.wasm --network testnet
soroban contract deploy MeterOracle.wasm --network testnet- Start backend services
cd backend
npm run iot-bridge
npm run price-aggregator- Start frontend
cd frontend
npm start- Purpose: Tokenize renewable energy production
- Features: Mint/burn, oracle authorization, metadata
- Symbol: SPARK
- Purpose: Facilitate P2P energy trades
- Features: Escrow, fee handling, trade lifecycle
- Fee: 0.5% per trade
- Purpose: Validate IoT meter data
- Features: Reading submission, confirmation, frequency optimization
- Key Wave Task: Optimizes oracle call frequency based on network conditions
- Real-time visualization of energy producers/consumers
- Interactive grid with location-based trading
- Supply/demand indicators
- Energy production/consumption analytics
- Token balance tracking
- Trading history
- Market view with current prices
- Trade creation and management
- Order book visualization
- MQTT Support: Standard IoT protocol
- CoAP Support: Low-power device protocol
- Stellar Integration: On-chain data submission
- Multiple Sources: EIA, ENTSO-E, market data
- Real-time Updates: 5-minute intervals
- Forecasting: 24-hour price predictions
GET /health- Service health checkGET /api/meters- Get recent readingsPOST /api/meters/:meterId/reading- Submit reading
GET /api/prices/current- Current pricesGET /api/prices/history- Historical dataGET /api/prices/forecast- Price predictions
# Frontend tests
cd frontend && npm test
# Backend tests
cd backend && npm test
# Contract tests
cd contracts && cargo test# Linting
npm run lint
# Formatting
cargo fmt# Deploy to testnet
soroban contract deploy --network testnet --source <account>
# Deploy to mainnet
soroban contract deploy --network public --source <account># Build for production
npm run build
# Deploy to Vercel/Netlify
vercel --prod# Build TypeScript
npm run build
# Deploy with Docker
docker build -t voltxchange-backend .
docker run -p 3001:3001 voltxchange-backend- Oracle keys stored securely
- Multi-signature for critical operations
- Rate limiting on APIs
- Input validation and sanitization
- Health endpoints on all services
- Prometheus metrics integration
- Structured logging with Winston
- Error tracking and alerting
- Fork the repository
- Create feature branch
- Implement changes with tests
- Submit pull request
MIT License - see LICENSE file for details.
- Documentation: docs/
- Issues: GitHub Issues
- Discord: VoltXchange Community
- Mobile app development
- Advanced AI price prediction
- Cross-chain compatibility
- Grid integration partnerships
- Carbon credit integration