How kosasih/eulers-shield works
Project Type and Purpose
• Euler’s Shield is a decentralized, AI-powered financial system to stabilize Pi Coin at a target price.
• It combines blockchain nodes, smart contracts, AI/ML agents, cybersecurity modules, and a full-stack application (React frontend + Node.js/Flask APIs).
• Key capabilities: data collection & analytics, ML-based market‐making, decentralized governance, on-chain consensus, and security monitoring.
High-Level System Components
a. User Interface
• React single‐page app (frontend/src)
• Consumes REST/WebSocket APIs
b. API & Business Logic
• Node.js backend (backend/src) – user & transaction controllers, auth middleware
• Python Flask/FastAPI service (api/app.py) – price oracle, on-chain integration
• “src/main.py” orchestration script for monolithic services
c. AI/ML Engines
• ai-market-maker (automated market maker, LSTM model)
• ai_agents (decentralized governance, oracle aggregator, upgrade agent, compliance, etc.)
• ai_security (anomaly detection, intrusion & facial recognition)
d. Blockchain Layer
• Self-hosted pi-coin-blockchain node (PoW/PoS modules)
• Smart contracts (smart-contracts/, contracts/mainnet & testnet) deployed to Pi network
• Blockchain integration adapters (immutable_storage, blockchain_integration.py)
e. Data Layer
• Market data CSVs & generators (ai-market-maker/data)
• Model artifacts in ml modules
• Persistent storage (implied: database for users & transactions)
f. External Services
• Global financial system API (global-financial-system-integration/api)
• Key management (HSM, distributed key management)
• External oracles & exchanges
g. Infrastructure & DevOps
• Docker & CI (CircleCI configs)
• Environment config per stage (config/.env.*)
• Deployment on cloud/Kubernetes (referenced by badges: AWS, GCP, Azure)
Relationships & Interactions
• Frontend ↔ API Gateway: user actions → HTTP/WS requests
• API Gateway → Business Logic: routes to Node.js services or Python Flask endpoints
• Business Logic → AI/ML Engines: RPC or message queue calls to Python agent microservices
• AI/ML Engines ↔ Data Layer: read historical & real-time market data, write recommendations
• Business Logic → Blockchain Integration: send transactions to the pi-coin-blockchain node, invoke smart contracts
• Blockchain Node ↔ Smart Contracts: consensus & state updates
• AI Security → Monitors logs & network traffic; alerts governance agents
• Decentralized Governance Agents → submit proposals on-chain via smart contracts
• External Financial Systems ↔ Global Integration API
Architectural Patterns & Principles
• Microservices: each AI component, governance agent, security detector is a standalone Python service
• Three‐Tier MVC: React UI, API/Controllers, Data/Blockchain
• Event‐Driven: use message queues (or webhook callbacks) for market data updates, ML alerts, governance proposals
• Hexagonal Ports & Adapters: clear separation between core logic (src/) and infrastructure adapters (blockchain_integration, immutable_storage)
• Security by Design: zero-trust communications, homomorphic encryption, differential privacy modules
Essential Elements
• Component containers labeled by directory/service name
• Environment/Deployment hints (CI/CD pipeline, config environments)