Giter VIP home page Giter VIP logo

praetor-backend's Introduction

Praetor-Backend

Welcome to praetor-backend, the core REST API logic for the Praetor application, built using FastAPI. This project is designed to handle all the main operational logic and serves as the backbone for managing and processing data efficiently.

Prerequisites

Before you begin, ensure you have the following installed:

  • Python (3.10 or later)
  • pip (latest version)

Installation

Clone the repository and set up a virtual environment:

git clone https://github.com/yourusername/praetor-backend.git
cd praetor-backend
python -m venv venv
source venv/bin/activate  # On Windows use `venv\Scripts\activate`
pip install -r requirements.txt

Configuration

The application relies on various environment variables to control its behavior and integrate with different services. Set these variables in your environment or a .env file. Below is a description of each:

# General Application Config
APP_NAME - The name of the application for internal use.
LOG_LEVEL - The verbosity level of logs (e.g., DEBUG, INFO, WARNING, ERROR).
RUN_HIDE - Flag to run some operations in a hidden or stealth mode.
PROVIDER_SYNC_INTERVAL - Interval in seconds for synchronizing provider data.
CACHED_PROVIDER_LIST_NAME - Key name for caching provider list in storage.
CACHED_PROVIDER_TESTNET_LIST_NAME - Key name for caching testnet provider list.
REMOVE_SESSION_INTERVAL - Interval in seconds to check and remove expired sessions.
PRAETOR_FRONTEND_URL - URL of the Praetor frontend application.
EXCLUDED_HOSTNAMES - Comma-separated hostnames to exclude from certain operations.
EXCLUDED_OWNERS - Comma-separated blockchain addresses to exclude from processing.

# MongoDB Config
MONGO_DB_CONNECTION_STRING - MongoDB connection URI.
MONGO_DB_NAME - The database name to use with MongoDB.

# Redis Config
REDIS_URI - URI for connecting to the Redis server.
REDIS_PASSWORD - Password for Redis authentication, if required.
REDIS_PORT - Port number on which the Redis server is running.

# SSH Server Config
PRAETOR_DIR - Directory path where Praetor-related files are stored.
RSA_FILENAME - File name for RSA key.
WALLET_PHRASE_FILENAME - File name for wallet phrases.
WALLET_PASSWORD_FILENAME - File name for wallet passwords.
PROVIDER_CONFIG_FILENAME - Configuration file name for providers.
PRICE_SCRIPT_FILENAME - Script file name for managing provider pricing.

# Akash Server Config
AKASH_HOME - Home directory for Akash configurations.
AKASH_NODE - URL of the main Akash network node.
AKASH_NODE_TESTNET - URL of the Akash testnet node.
AKASH_NODE_STATUS_CHECK - URL to check the status of the main Akash node.
AKASH_NODE_STATUS_CHECK_TESTNET - URL to check the status of the testnet Akash node.
CHAIN_ID - Chain ID of the main Akash network.
CHAIN_ID_TESTNET - Chain ID of the Akash testnet.
KEYRING_BACKEND - Backend for managing cryptographic keys in Akash.
UPLOAD_DIR - Directory to store uploaded files.
KUBE_DIR - Directory to store Kubernetes configurations.
APP_SESSION_ID - Session ID for the app mainnet operations.
APP_SESSION_ID_TESTNET - Session ID for the app testnet operations.
AKASH_VERSION - Version of the Akash software.
AKASH_VERSION_TESTNET - Version of the Akash software for testnet.
ALLOWED_WALLET_ADDRESSES - List of wallet addresses allowed for certain operations.
PROVIDER_SERVICES_VERSION - Version identifier for provider services.
PROVIDER_SERVICES_VERSION_TESTNET - Version identifier for provider services on testnet.
PROVIDER_PRICE_SCRIPT_URL - URL for the provider pricing script.

# Authentication
PUBLIC_KEY - Public key used for authentication procedures.
HOST_NAME - The hostname of the server where the application is running.
SECURITY_HOST - Hostname of the security service.

# Kubernetes
GVISOR_BASE_URL - Base URL for GVisor integration.

# Cloudmos api Config
CLOUDMOS_API_URL - API URL for Cloudmos services.
AVG_BLOCK_PER_MONTH - Average number of blocks per month, used for calculations.

Running the Application

To run the application in development mode, use:

uvicorn asgi:app --proxy-headers --host 0.0.0.0 --port 80 --reload

praetor-backend's People

Contributors

devalpatel67 avatar

Watchers

Greg Osuri avatar Drinkwater avatar

praetor-backend's Issues

Integrate and Rebrand PraetorApp with Akash Network Console

Develop a cohesive product experience that integrates PraetorApp with Akash Network Console UI, rebranding it as a complimentary Akash Provider Console.
This will involve UI/UX enhancements, backend integrations, and alignment with open-source practices.

Open Source Praetor Backend

  • Move praetor provider backend service from PraetorOne's github repo to akash-network's repo.
  • Make necessary adjustments to deploy the project automatically using the github ci/cd pipeline with new repo.
  • Make sure no secret configurations are exposed while open sourcing the service.

Revamp Documentation and Training Resources

Undertake a major enhancement of the PraetorApp documentation to better support new and existing providers. This will include high-quality video tutorials that guide users through initial setup processes, detailed write-ups on SSH configurations, port forwarding, and DNS troubleshooting. Additionally, this issue will address the creation of step-by-step guides for common use cases and troubleshooting scenarios to reduce support requests and empower users to self-serve potential issues more effectively. This comprehensive resource pool will aim to improve user experience and operational efficiency.

Enhance Storage Setup and Configuration Features

Develop advanced storage management features in PraetorApp to ensure data redundancy and enhance provider reliability. Implement a user-friendly setup process for RAID1 configuration in ephemeral (rootfs) storage to mitigate risks associated with disk failures. This will prevent data loss by replicating data across multiple disks, allowing for seamless redeployment to another node if necessary. Additionally, extend the current storage capabilities to support the addition of persistent storage post initial setup. This feature will allow providers who initially did not opt for or require persistent storage to add it as their needs evolve, enhancing the flexibility and scalability of storage management within PraetorApp.

Develop and Provide Open APIs for Enhanced Integration

Develop and release a suite of open APIs within PraetorApp to facilitate seamless integration with deployment clients and partners across the Akash Network ecosystem. These APIs will provide access to essential provider data such as real-time status updates, health metrics, and configuration details. The development will include comprehensive documentation, security features such as authentication and encryption, and scalability to handle increasing data demands. This effort will support broader ecosystem connectivity and enable faster growth and innovation across the network.

Enhance Telemetry and Monitoring Capabilities for Providers

Implement first-class telemetry features including logging, monitoring, error reporting, and provider config stats. Integrate automated testing with continuous small deployment probes and develop a Grafana dashboard to visualize this data.

Enhance RPC Node Reliability with Immediate and Long-Term Solutions

Develop comprehensive features in PraetorApp to facilitate the easy setup and ongoing maintenance of RPC nodes, enhancing communication reliability with tenants. Concurrently, as a temporary measure while these features are under development, establish public RPC nodes in multiple regions. Assign these nodes based on the geographical location of the provider to improve service responsiveness and stability. This dual approach ensures immediate improvements in reliability and paves the way for more robust and permanent solutions in the future.

Streamline Provider Update Processes

Create mechanisms in PraetorApp for providers to easily check and update their Helm Charts, ensuring alignment with provider service releases.

Implement Content Moderation Tools

As the Akash Network expands to accommodate Web2 customers, the necessity for robust content moderation tools intensifies to ensure providers can effectively manage the content hosted on their platforms. Develop and integrate advanced content moderation tools in PraetorApp that empower providers to monitor, filter, and block potentially harmful or legally risky content. This initiative will include features for automatic content scanning, user-defined filters, and real-time alerts, ensuring proactive content management and compliance with applicable regulations. Collaboration with other team members will be essential to leverage existing expertise and resources in this development.

Implement Provider Revenue and Profitability Analytics Tools

Develop a sophisticated analytics dashboard within PraetorApp that allows providers to track, visualize, and analyze their revenue and related costs over time. This tool will help providers assess their profitability, identify trends, and make informed decisions based on historical and predictive analytics. The functionality will include customizable reports, real-time data updates, and visual analytics that can break down earnings by different metrics such as time, service type, and customer segments. By equipping providers with these tools, PraetorApp will enhance their ability to optimize operations and maximize profitability on the Akash Network.

Enhance Kubernetes Cluster Scalability and Management with K3S Research

Leverage ongoing research on the use of K3S for multi-node cluster configurations to enhance the scalability functions in PraetorApp. This project aims to determine the feasibility and benefits of employing K3S in a scaled environment traditionally managed by full-fledged Kubernetes (K8S). By aligning our efforts with the team conducting this research, we can combine our knowledge and resources to develop more efficient and scalable solutions. This collaborative approach will also ensure consistency in tooling across the platform and improve the ease of managing cluster transitions from single node setups to larger, more robust configurations. Include features for node scalability from single to multiple nodes, upgrading Kubernetes versions, and managing software packages like CUDA.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.