How drpcorg/dshackle works
Main Components Overview
The system architecture should be divided into these key layers:
a) External Interface Layer
• gRPC Server (port 2449)
• HTTP/WebSocket Proxy Server (port 8545)
• TLS Security Layer
b) Core Processing Layer
• Request Router
• Load Balancer
• Upstream Manager
• Caching System
• Authentication/Authorization
c) Upstream Connections Layer
• Blockchain Connectors
• Protocol Adapters
• Health Monitors
Detailed Component Breakdown
a) Client Interface Components:
• GrpcServer (handles gRPC connections)
• ProxyServer (handles HTTP/WS)
• HttpHandler
• WebsocketHandler
• AuthInterceptor (authentication)
b) Core Processing Components:
• Multistream (manages multiple upstream connections)
• UpstreamAvailability (monitors upstream health)
• CallMethods (manages RPC method routing)
• Caches (handles caching layer)
• BlocksCache
• TxCache
• ReceiptCache
c) Blockchain Specific Components:
• EthereumUpstream
• BitcoinUpstream
• SolanaUpstream
• Other Chain Specific Implementations
Data Flow Representation
Client Request → Authentication → Router → Load Balancer → Upstream Selection →
Protocol Translation → Blockchain Node → Response Processing → Caching →
Client Response
Integration Points
Integration with:
• Redis (optional caching)
• Multiple blockchain nodes
• Monitoring systems
• TLS termination
Key Features to Highlight
Architectural features:
• Fault tolerance mechanisms
• Load balancing strategies
• Caching layers
• Security boundaries
• Protocol translation points
Deployment Context
A separate view showing:
• Container boundaries
• Network segments
• Security zones
• High availability pairs
Monitoring & Management
Connections to:
• Health check endpoints
• Metrics collection
• Logging infrastructure
• Management APIs
Cross-cutting concerns (security, monitoring, caching)
• Hierarchical layouts
• Connector routing
• Export to various formats
• Version control friendly formats
This will create a comprehensive yet understandable representation of Dshackle's architecture that can be easily maintained and updated as the system evolves.