How shreyas-itb/verusstatisticsapi works
Project Type and Purpose
This is a RESTful API service designed to provide statistical and operational data about the VerusCoin blockchain, specifically focusing on the verus-ethereum bridge and transaction handling.
Main Components
A. Core API Layer:
• FastAPI Application Server (app.py)
• Endpoint Handlers (endpoints/index.py)
• Function Modules (functions/)
B. External Services:
• VerusCoin Node/RPC
• Ethereum Node/RPC
• CoinGecko API
• Yahoo Finance API
• Etherscan API
C. Data Processing Components:
• Transaction Processors
• Balance Calculators
• Volume Aggregators
• Price Fetchers
[External Clients] → [Load Balancer/Reverse Proxy]
[FastAPI Application Server]
• Main Routes
• Market Routes
• Utility Routes
[Core Functions]
• Blockchain Interaction
• Transaction Decoders
• Block Processors
• Balance Calculators
• Market Data
• Price Fetchers
• Volume Calculators
• Reserve Handlers
• Utility Functions
• Data Formatters
• Cache Handlers
[External Services]
• VerusCoin Network
• Ethereum Network
• Price APIs
• Block Explorers
Additional Elements
a) A Cache Layer:
[Cache]
• Transaction Cache
• Price Cache
b) Error Handling Flows:
[Error Handlers]
• API Errors
• Network Errors
• Data Validation
Implementation Details
[Client Applications] → [API Gateway]
• ↓
[FastAPI Application (app.py)]
• ↓
[Endpoint Handlers (endpoints/index.py)]
• ↓
[Function Modules]
• Transaction Processing
• decoderawtransaction.py
• extracttransfers.py
• processtxnstaking.py
• Market Data
• getcurrencyprices.py
• markettickers.py
• getvolinfo.py
• Blockchain Interface
• latestblock.py
• getimports.py
• reserves.py
• ↓
[External Services]
• VerusCoin RPC
• Ethereum RPC
• CoinGecko API
• Yahoo Finance API