How tronscan/tronscan-api works
Main Components
a. External Interfaces:
• TRON Blockchain Network (Full Nodes/Solidity Nodes)
• Client Applications (Frontend)
• PostgreSQL Database
• Redis Cache
b. Core System Components:
• API Layer
• GRPC Services
• Blockchain Importers
• Network Scanner
• WebSocket Engine
• Transaction Builder
[Client Layer]
• ↑↓
[API Gateway Layer]
• ↑↓
[Service Layer]
• ↑↓
[Data Access Layer]
• ↑↓
[External Services Layer]
Component Details
API Gateway Layer (app/org/tronscan/api/):
• Swagger UI integration
• WebSocket connections for real-time updates
Service Layer:
• GRPC Services (app/org/tronscan/grpc/)
• Load balancer
• Full node client
• Solidity client
• Importers (app/org/tronscan/importer/)
• Block importer
• Account importer
• Database importer
• Network Scanner (app/org/tronscan/network/)
• Transaction Builder (app/org/tronscan/service/)
Data Access Layer:
• PostgreSQL Database (using Slick)
• Redis Cache
• Repository pattern implementation
External Services:
• TRON Network Nodes
• GeoIP Service
• Slack Integration
Key Interactions to Highlight
• Synchronous API calls
• Asynchronous streams
• Database operations
• Cache interactions
• Blockchain network communication
Technical Stack Indicators
Technology badges/labels for:
• Scala
• Play Framework
• Akka Streams
• GRPC
• PostgreSQL
• Redis
• Socket.io
Additional Elements
• Monitoring/logging flows
• Scale-out possibilities
• Failure handling paths
• Critical paths for high availability
• The reactive nature of the system
• The separation between blockchain interaction and API serving
• The caching strategy for performance
• The modular architecture allowing for easy scaling
• The security boundaries for transaction signing
Remember to use consistent styling and maintain a clear visual hierarchy to make the complex system easily understandable.