-
Notifications
You must be signed in to change notification settings - Fork 6
05. Request Flow and Operations
This section offers a comprehensive understanding of how requests are processed within PROXNUT, detailing the steps from initiation to response delivery. It also touches on advanced operations and monitoring capabilities that enhance the system's efficiency and user experience.
Understanding the lifecycle of a request in PROXNUT is crucial for both users and developers. Here's a step-by-step breakdown:
-
Initiation: A user sends a request to access a protected resource. This request includes a token from their Cashu ecash wallet.
-
Token Extraction: PROXNUT extracts the token from the request header, specifically from the
X-Cashu
header. -
Token Verification: The backend server communicates with the Cashu ecash mint to verify the token's validity and sufficiency.
-
Resource Routing: If the token is valid, PROXNUT routes the request to the appropriate resource based on the host and route mapping configuration.
-
Response Generation: The protected resource processes the request and generates a response.
-
Response Delivery: PROXNUT delivers the resource's response back to the user.
Valid Requests:
-
If the token is valid and has sufficient balance, the user is granted access to the requested resource.
-
The amount corresponding to the resource's token price is deducted from the user's Cashu wallet.
Invalid Requests:
-
If the token is invalid or there's an insufficient balance, PROXNUT returns an (402) error message to the user.
-
Common error messages include "Invalid Token", "Insufficient Balance", or "Resource Not Found".
PROXNUT provides tools and interfaces for monitoring:
-
Configuration: Detailed logs of all incoming requests, including timestamps, IP addresses, requested resources, and token details.
-
Analytics Dashboard: A visual interface showing metrics like total requests, successful requests, failed requests, and resource popularity.
ProxNut Wiki | SINCE BBH707007
ProxNut | For support and inquiries, visit PROXNUT.com, write us on Telegram or open an issue on our repo.