DRL Trading Bot
Feature: HTF Agent integration β€” live trading, API endpoints, UI tab
fc115d5
|
Raw
History Blame Contribute Delete
2.21 kB

A newer version of the Streamlit SDK is available: 1.62.0

Upgrade

Cloudflare Workers Proxy for Binance Testnet

This proxy bypasses geo-restrictions (Error 451) when accessing Binance testnet from HuggingFace Spaces.

🎯 Quick Start

1. Deploy the Worker (15 minutes)

Follow the step-by-step guide in DEPLOYMENT_GUIDE.md

Summary:

  1. Sign up at workers.cloudflare.com (FREE, no credit card)
  2. Create a new Worker
  3. Copy code from binance-testnet-proxy.js
  4. Save and Deploy
  5. Copy your Worker URL

2. Configure HuggingFace Space

Add your Worker URL to HuggingFace Secrets:

  1. Go to your Space Settings β†’ Repository Secrets
  2. Add new secret:
    • Name: BINANCE_TESTNET_PROXY_URL
    • Value: https://your-worker.workers.dev
  3. Restart the Space

3. Test Locally (Optional)

Before deploying to HuggingFace, test locally:

# Add to .env file
echo "BINANCE_TESTNET_PROXY_URL=https://your-worker.workers.dev" >> .env

# Run test script
python test_proxy.py

If all tests pass βœ…, you're ready to deploy to HuggingFace!


πŸ“Š Free Tier Limits

  • Requests: 100,000 per day (FREE)
  • CPU Time: 50ms per request
  • Workers: 30 deployed scripts
  • Storage: 1GB total

For a single trading bot: These limits are more than enough!


πŸ”’ Security

  • βœ… You control the proxy code
  • βœ… API keys are not logged or stored
  • βœ… CORS protection limits access to your HuggingFace Spaces only
  • βœ… All traffic is encrypted (HTTPS)

πŸ“ Files in This Directory

  • binance-testnet-proxy.js - The Cloudflare Worker code
  • DEPLOYMENT_GUIDE.md - Detailed deployment instructions
  • README.md - This file

πŸ†˜ Need Help?

  1. Check the DEPLOYMENT_GUIDE.md for troubleshooting
  2. Review Cloudflare Workers docs: https://developers.cloudflare.com/workers/
  3. Check if your Worker is deployed correctly in the Cloudflare dashboard

βœ… Success Checklist

  • Cloudflare account created
  • Worker deployed with proxy code
  • Worker URL copied
  • BINANCE_TESTNET_PROXY_URL added to HuggingFace Secrets
  • HuggingFace Space restarted
  • Testnet tab working! πŸŽ‰