block-quote On this pagechevron-down
copy Copy chevron-down
SUBNETS chevron-right Legacy Subnet 25 Mainframe chevron-right Subnet 25 Mainframe API chevron-right Folding API Running Folding API Server The Folding API provides protein folding capabilities through the Bittensor network. This API allows users to submit protein sequences for folding, query the status of folding jobs, and retrieve results. The service is designed to work with NVIDIA GPUs for optimal performance in protein folding computations.
To ensure reliable and efficient MD simulations, please make sure your environment meets the following requirements:
GPU : NVIDIA RTX 4090 (recommended)
Required for protein folding workloads due to its high number of CUDA cores and strong performance with molecular dynamics tasks.
See our reproducibility guidelinesarrow-up-right for more details on why this specific GPU is recommended.
Python : Version 3.11 (for compatibility with Bittensor and OpenMM)
Conda : For managing Python environments
Poetry : For managing project dependencies
1. Clone the Repository
Copy git clone https://github.com/macrocosm-os/mainframe.git
cd folding 2. Install Conda
If you don't have Conda installed, run the following command:
Copy mkdir -p ~/miniconda3
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh
bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
rm ~/miniconda3/miniconda.sh
# Initialize conda
source ~/miniconda3/bin/activate
conda init --all 3. Create and Activate Conda Environment
4. Install Dependencies
Running the API
Replace your_wallet_name and your_hotkey with your Bittensor wallet credentials.
Global Job Pool (GJP)
The API queries the Global Job Pool (GJP) using SQL for job information:
/job_pool endpoint executes SQL queries against the GJP database
Results are parsed and transformed into appropriate response models
Allows filtering by status, job IDs, and PDB ID search
The Global Job Pool also allows validators to distribute jobs and miners to fetch work. The following describes how miners interact with the GJP:
When your miner starts, it automatically connects to the read node
It maintains a local snapshot of the GJP in the /db directory
You can use /scripts/query_rqlite.py to examine and analyze data from the job pool
The interaction between miners and the GJP is facilitated by the FoldingMiner class, which handles job fetching, preparation, and execution.
1. Accessing the API Documentation
Once the API is running, you can access:
API server: http://0.0.0.0:8029
You can edit server address to access Interactive API documentation: http://localhost:8029/docs
2. Authentication
Locate the api_keys.json file in the folding folder
In the Swagger UI (/docs), click "Authorize" and enter your API key
You can now make authenticated requests to the API
Additional Notes
The API requires an NVIDIA GPU with CUDA support for MD simulations
Regular system updates and proper CUDA configuration are essential
Monitor system resources during folding operations
Keep your API key secure and never share it publicly
Last updated 10 months ago