A comprehensive decentralized networking and AI platform for the REChain Blockchain Node Network, implementing a microservices architecture with userver framework.
┌─────────────────────────────────────────────────────────────┐
│ Frontend Layer │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ Android (Kotlin) │ AuroraOS (Qt) │ HarmonyOS (C++) │ │
│ │ iOS (Swift) │ Web (Flutter) │ Desktop (Rust) │ │
│ └─────────────────────────────────────────────────────┘ │
├─────────────────────────────────────────────────────────────┤
│ Microservices Layer │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ Mesh Gateway │ AI Core │ Storage │ │
│ │ Device Discovery │ ML Inference │ Database/Cache │ │
│ │ Routing │ Quantum Comp. │ File Storage │ │
│ └─────────────────────────────────────────────────────┘ │
├─────────────────────────────────────────────────────────────┤
│ Infrastructure Layer │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ PostgreSQL │ Redis Cluster │ Monitoring │ │
│ │ Master-Slave │ Distributed │ Prometheus/Graf │ │
│ │ Replication │ Cache │ Security │ │
│ └─────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────┘
- Purpose: Device discovery, mesh network routing, message forwarding
- Features:
- Bluetooth LE Mesh discovery
- AODV routing protocol
- Real-time device status monitoring
- Message routing and forwarding
- Purpose: Machine learning inference, quantum computing, model management
- Features:
- Graph ML training and inference
- Quantum circuit simulation (32 qubits)
- Federated learning support
- Real-time AI processing
- Purpose: Distributed data persistence, caching, file storage
- Features:
- PostgreSQL database operations
- Redis distributed caching
- File object storage
- Data synchronization
- PostgreSQL Cluster: Master-slave replication with automated failover
- Connection Pooling: PgBouncer for efficient connection management
- High Availability: Automatic backup and recovery
- Redis Cluster: Distributed caching across mesh nodes
- State Synchronization: Real-time data sharing between services
- Session Management: User session and authentication caching
- Prometheus: Metrics collection from all services
- Grafana: Visualization dashboards for system monitoring
- Alerting: Automated alerts for system anomalies
- Custom Metrics: Mesh operations, AI performance, storage usage
- TLS Encryption: End-to-end encrypted service communication
- Role-Based Access Control: Fine-grained permission management
- Container Security: AppArmor, seccomp, and capability restrictions
- Cryptographic Key Management: Secure key storage and rotation
- Docker and Docker Compose
- At least 8GB RAM, 4 CPU cores recommended
- Linux/Windows/macOS with Docker support
-
Clone the repository
git clone https://github.com/your-org/Serverless-SDK_API.git cd Serverless-SDK_API -
Configure environment variables
cp .env.example .env # Edit .env with your secure passwords -
Start the platform
docker-compose up -d
-
Access services
- Grafana Dashboard: http://localhost:3000 (admin/admin)
- Prometheus: http://localhost:9090
- Mesh Gateway API: http://localhost:8080
- AI Core API: http://localhost:8081
- Storage API: http://localhost:8082
For production deployment with enhanced security:
docker-compose -f docker-compose.yml -f infra/security/docker-compose.security.yml up -d# Get mesh status
GET /mesh/status
# List devices
GET /devices
# Calculate route
POST /routes/calculate
# Send message
POST /messages/send# List available models
GET /models
# Load model
POST /models/load
# Run inference
POST /inference
# Quantum circuit execution
POST /quantum/execute# Store object
POST /objects
# Get object
GET /objects/{key}
# Database operations
POST /records
GET /records/{id}
# Cache operations
POST /cache
GET /cache/{key}# Mesh Gateway
cd services/mesh-gateway
mkdir build && cd build
cmake .. && make -j$(nproc)
# AI Core
cd services/ai-core
mkdir build && cd build
cmake .. && make -j$(nproc)
# Storage
cd services/storage
mkdir build && cd build
cmake .. && make -j$(nproc)# Run unit tests
cd services/{service-name}/build
ctest
# Integration tests
docker-compose -f docker-compose.test.yml up --abort-on-container-exitEach service uses YAML configuration files:
services/mesh-gateway/config.yamlservices/ai-core/config.yamlservices/storage/config.yaml
Key configuration areas:
- Server settings (ports, timeouts)
- Database connections
- Redis cluster configuration
- Security policies
- Monitoring endpoints
- Service Health: Uptime, response times, error rates
- Mesh Performance: Device count, route efficiency, message latency
- AI Performance: Inference latency, model accuracy, quantum execution time
- Storage Performance: Database connections, cache hit rates, storage usage
- Service downtime
- High latency (>95th percentile thresholds)
- Resource exhaustion (CPU, memory, disk)
- Security incidents
- Mutual TLS: Service-to-service authentication
- JWT Tokens: API authentication and authorization
- Container Hardening: Minimal privileges, read-only filesystems
- Network Segmentation: Isolated service networks
- Audit Logging: Comprehensive security event logging
- Mesh Message Delivery: <100ms local, <1s regional
- AI Inference: <50ms for real-time decisions
- Database Queries: <10ms average response time
- Cache Operations: <1ms average latency
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
This project is licensed under the Affero General Public License (AGPL) version 3.
- Documentation: See
docs/directory - Issues: GitHub Issues
- Discussions: GitHub Discussions
- Security: security@your-org.com
Built with ❤️ using userver framework, PostgreSQL, Redis, and modern C++.