Configuration Guide
Learn how to configure FlavumHive for your specific needs. This guide covers all configuration options and best practices.
Configuration Files
FlavumHive uses several configuration files:
.env
- Environment variables and credentialsconfig.json
- Platform and system settingspersonalities/*.json
- Personality configurations
Environment Variables (.env
)
Core Settings
# OpenAI Configuration
OPENAI_API_KEY="your_openai_api_key"
OPENAI_MODEL="gpt-4" # or gpt-3.5-turbo
# Database Configuration
DB_PATH="bot.db"
DATABASE_PATH="reddit_bot.db"
Twitter Configuration
# Twitter Credentials
TWITTER_USERNAME="your_username"
TWITTER_PASSWORD="your_password"
TWITTER_EMAIL="your_email"
TWITTER_2FA_SECRET="optional_2fa_secret"
TWITTER_DRY_RUN="false" # Set to true for testing
Reddit Configuration
# Reddit API Credentials
REDDIT_USERNAME="your_username"
REDDIT_PASSWORD="your_password"
REDDIT_CLIENT_ID="your_client_id"
REDDIT_CLIENT_SECRET="your_client_secret"
REDDIT_USER_AGENT="FlavumHive Bot v1.0"
# Reddit Rate Limits
REDDIT_POSTS_PER_HOUR=2
REDDIT_COMMENTS_PER_HOUR=5
Platform Configuration (config.json
)
Global Settings
{
"global_settings": {
"debug_mode": false,
"dry_run": false,
"database": {
"path": "bot.db",
"backup_frequency": "daily"
}
}
}
Twitter Settings
{
"platforms": {
"twitter": {
"enabled": true,
"personality": {
"active": "crypto_researcher",
"settings": {
"add_signature": true,
"auto_reply": true,
"reply_probability": 0.8
}
},
"rate_limits": {
"tweets_per_hour": 5,
"replies_per_hour": 10,
"min_delay_between_actions": 30
}
}
}
}
Reddit Settings
{
"platforms": {
"reddit": {
"enabled": true,
"personality": {
"active": "crypto_researcher",
"settings": {
"add_signature": true,
"auto_reply": true,
"reply_probability": 0.7
}
},
"target_subreddits": ["RedHarmonyAI"],
"rate_limits": {
"posts_per_hour": 2,
"comments_per_hour": 5,
"min_delay_between_actions": 20
}
}
}
}
Personality Configuration
Basic Structure
{
"name": "crypto_researcher",
"platform_settings": {
"twitter": {
"tweet_style": "informative",
"interaction_style": "academic_analytical"
},
"reddit": {
"post_style": "detailed",
"comment_style": "helpful"
}
},
"knowledge": [
"Blockchain Economics",
"DeFi Protocols",
"Market Analysis"
]
}
Advanced Settings
{
"personality_traits": {
"formality": 0.8,
"enthusiasm": 0.6,
"technical_depth": 0.9
},
"response_templates": {
"greeting": "Greetings! As a blockchain researcher...",
"analysis": "Based on the data, we can observe..."
}
}
Rate Limiting
Platform-Specific Limits
{
"rate_limits": {
"tweets_per_hour": 5,
"posts_per_hour": 2,
"min_delay": 30,
"max_daily_actions": 100
}
}
Best Practices
- Start with conservative limits
- Monitor platform feedback
- Adjust based on account age/reputation
- Implement gradual ramp-up
Monitoring Configuration
Log Settings
{
"logging": {
"level": "INFO",
"file_rotation": "1 day",
"max_files": 7,
"debug_screenshots": true
}
}
Health Checks
{
"health_checks": {
"enabled": true,
"interval": 300,
"alerts": {
"email": "alerts@yourdomain.com",
"slack_webhook": "your_webhook_url"
}
}
}
Advanced Configuration
Custom Handlers
# platforms/custom/handler.py
class CustomHandler(BaseHandler):
def __init__(self, config):
self.config = config
# Custom initialization
Database Configuration
{
"database": {
"type": "sqlite",
"path": "bot.db",
"backup": {
"enabled": true,
"frequency": "daily",
"retention": 7
}
}
}
Security Considerations
-
Credential Management
- Use environment variables
- Never commit
.env
- Regular key rotation
-
Rate Limiting
- Respect platform limits
- Implement backoff
- Monitor for blocks
-
Error Handling
- Log all errors
- Implement recovery
- Alert on issues
Troubleshooting
Common Issues
- Rate limit errors
- Authentication failures
- Database connection issues
Solutions
- Check configuration values
- Verify credentials
- Review log files