Upgrade
Follow these steps to upgrade your OpenAlgo application:
Backup the Database
Navigate to your database folder and make a copy of the current database file for safekeeping.
Update the Application Code
Open your terminal and run the following command to pull the latest changes:
4. Install Dependencies
Install or update the required Python packages by running:
Run the Migration Script
Execute the migration script to add the feed_token
column to your database:
The script will:
Check if the
feed_token
column already existsAdd the column if it doesn't exist
Log the results of the operation
Verify the Migration
After running the script, verify that the column was added successfully by:
Checking the script output for success messages
Logging into your OpenAlgo application and testing Angel broker authentication
Technical Notes
What is the Feed Token?
The feed token (data token) is provided by Angel Broking's API during authentication and is used for real-time market data operations. It is separate from the authentication token and has its own validity period.
Implementation Details
The upgrade adds:
A new
feed_token
column to theauth
table in the databaseStorage and retrieval mechanisms for the feed token
Integration of the feed token with market data operations
Modified Files
This upgrade modifies the following key files:
openalgo/broker/angel/api/auth_api.py
- To extract and return the feed token from the Angel authentication responseopenalgo/database/auth_db.py
- To add storage and retrieval functions for the feed tokenopenalgo/utils/auth_utils.py
- To handle the feed token in session management
Troubleshooting
"Unable to open database file" Error
If you encounter this error, check:
The database path in your
.env
file is correctThe directory exists and has proper permissions
You are running the script from the correct location
"feed_token column already exists" Message
This is not an error. It means the migration has already been applied to your database.
Authentication Issues After Upgrade
If you experience authentication issues:
Verify that all files have been properly updated
Log out and log back in to generate a new feed token
Check the application logs for specific error messages
Support
If you need assistance with the feed token upgrade, please:
Check the OpenAlgo documentation
Refer to the Angel broking API documentation for feed token details
File an issue on the OpenAlgo GitHub repository
Dependecies Check (Optional)
Ensure all installed dependencies are compatible with the new version:
• Use a virtual environment to avoid conflicts:
Configure the Environment
Create a .env file from the provided .sample.env file. Update the following configurations in the .env file:
• Generate random values for APP_KEY and API_KEY_PEPPER using: • Update the following parameters:
• BROKER_API_KEY
• BROKER_API_SECRET
• REDIRECT_URL
• Verify and adjust other configurations as needed.
Sample .env template
Last updated