| #!/bin/bash |
| set -e |
|
|
| |
| date -u +'%Y-%m-%d %H:%M UTC' > /app/last_startup.txt |
|
|
| |
| if [ ! -f /app/last_factory_rebuild.txt ]; then |
| cp /app/last_startup.txt /app/last_factory_rebuild.txt |
| fi |
|
|
| |
| |
| sed -i '/Economic event:/d' /app/notes.txt 2>/dev/null || true |
|
|
| |
| run_forever() { |
| local name="$1" |
| shift |
| echo "Starting $name with auto-restart..." |
| while true; do |
| "$@" 2>&1 || true |
| echo "[$name] Process exited. Restarting in 5 seconds..." |
| sleep 5 |
| done |
| } |
|
|
| |
|
|
| echo "Starting arbitrage bot..." |
| run_forever "arbitrage_bot" python arbitrage_launcher.py & |
|
|
| echo "Starting PolyHub listener..." |
| run_forever "polyhub_listener" python polyhub_listener.py & |
|
|
| echo "Starting Hermes Agent..." |
| run_forever "hermes_agent" python hermes_agent.py & |
|
|
| |
| python -c "from llm_wiki import ensure_wiki_dir; ensure_wiki_dir()" |
|
|
| echo "Starting Balance Updater..." |
| run_forever "balance_updater" python balance_updater.py & |
|
|
| echo "Starting Daily Report..." |
| run_forever "daily_report" python daily_report.py & |
|
|
| echo "Starting Dry Run Simulator..." |
| run_forever "dry_run_simulator" python dry_run_simulator.py & |
|
|
| echo "Starting Wiki Cleanup daemon..." |
| run_forever "wiki_cleanup" python wiki_cleanup.py & |
|
|
| echo "Starting External Data daemon..." |
| run_forever "external_data" python external_data_daemon.py & |
|
|
| echo "Starting Git Backup daemon..." |
| bash backup.sh & |
|
|
| |
| |
|
|
| echo "Starting Web UI on port ${PORT:-7860}..." |
| exec uvicorn web_ui:app --host 0.0.0.0 --port ${PORT:-7860} |