This comprehensive guide is designed to assist you in configuring the environment variables critical for the Desearch system. It highlights the specific variables required for Validators and Miners, ensuring they understand their roles and the importance of each key.
- Access to a terminal interface.
- Accounts on OpenAI, Weights & Biases, and Twitter Developer Portal.
Here's a breakdown of the environment variables necessary for the Desearch system, with detailed information on their significance for Validators and Miners:
-
OPENAI_API_KEY
- Usage: Authenticates with the OpenAI API.
- How to Obtain: Sign up or log in at OpenAI API, navigate to the API section, and generate a key.
- Required for: Validator and Miners.
-
TWITTER_BEARER_TOKEN
- Usage: Grants access to the Twitter API.
- How to Obtain: Create a Twitter Developer account, create an app at Twitter Developer Portal, and generate a token.
- Required for: Miners exclusively.
-
WANDB_API_KEY
- Usage: For experiment tracking with Weights & Biases.
- How to Obtain: Sign up or log in at Weights & Biases, and generate a key in your account settings.
- Required for: Validator and Miners.
-
EXPECTED_ACCESS_KEY
- Usage: Secures access to the validator service.
- How to Create: Generate a unique, strong, and random string.
- Required for: Validators exclusively.
-
APIFY_API_KEY
- Usage: Used for Apify actors
- How to Create: Sign up or log in at Apify, and generate a key in your account settings.
- Required for: Validator and Miners.
-
SERPAPI_API_KEY
- Usage: Used to search web using Serp API
- How to Create: Sign up or log in at Serp API, and generate a key in your account settings.
- Required for: Miners exclusively.
To set the environment variables, open a terminal and replace <your_key_here>
with your actual keys. For Validators, secure and authenticated access is crucial:
export OPENAI_API_KEY=<your_openai_api_key_here>
export TWITTER_BEARER_TOKEN=<your_twitter_bearer_token_here> # Only for Miners
export EXPECTED_ACCESS_KEY=<your_EXPECTED_ACCESS_KEY_here> # Only for Validators
export WANDB_API_KEY=<your_wandb_api_key_here>
export APIFY_API_KEY=<your_apify_api_key_here> # Only for Validators
export SERPAPI_API_KEY<your_serp_api_key_here> # Only for Miners
If you prefer to use .bashrc
for setting up environment variables, execute these commands:
echo 'export OPENAI_API_KEY="<your_openai_api_key>"' >> ~/.bashrc # Both for Validators and Miners
echo 'export TWITTER_BEARER_TOKEN="<your_twitter_bearer_token>"' >> ~/.bashrc # Only for Miners
echo 'export EXPECTED_ACCESS_KEY="<your_EXPECTED_ACCESS_KEY>"' >> ~/.bashrc # Only for Validators
echo 'export WANDB_API_KEY="<your_wandb_api_key>"' >> ~/.bashrc # Only for Validators
echo 'export APIFY_API_KEY="<your_apify_api_key>"' >> ~/.bashrc # Both for Validators and Miners
echo 'export SERPAPI_API_KEY="<your_serp_api_key_here>"' >> ~/.bashrc # Only for Miners
source ~/.bashrc