### Fresh Install Command Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/01-overview.md Installs both Condor and the Hummingbot API by piping the setup script to bash and then executing it. ```bash curl -fsSL https://raw.githubusercontent.com/hummingbot/deploy/main/setup.sh | bash bash setup.sh ``` -------------------------------- ### Hummingbot Deploy Entry Points Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/README.md Shows different ways to execute the setup script for installation, CI/CD, API-only deployment, and upgrades. ```bash # Fresh install (interactive) bash setup.sh ``` ```bash # Non-interactive (CI/CD) DEPLOY_NONINTERACTIVE=1 TELEGRAM_TOKEN=... ADMIN_USER_ID=... bash setup.sh ``` ```bash # API only bash setup.sh --hummingbot-api ``` ```bash # Upgrade existing bash setup.sh --upgrade ``` -------------------------------- ### Install Condor Source: https://github.com/hummingbot/deploy/blob/main/README.md Run this command to install Condor and optionally Hummingbot API. The installer will guide you through setup questions. ```bash curl -fsSL https://raw.githubusercontent.com/hummingbot/deploy/main/setup.sh | bash ``` -------------------------------- ### Fresh Condor Installation Workflow Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/05-deployment-workflows.md This outlines the sequence of operations performed by the `setup.sh` script for a new Condor installation. It covers OS detection, dependency management, code cloning, environment configuration, building the application, and starting the service via tmux. ```bash 1. detect_os_arch() ├── Set $OS (linux or darwin) └── Set $ARCH (amd64, arm64, arm) 2. check_disk_space() └── Verify ≥2 GB available 3. install_dependencies "condor-only" ├── Check for git, curl, make, tmux, uv, node, npm └── Auto-install missing (on Linux; prompt on macOS) 4. clone_condor() ├── git clone --depth 1 https://github.com/hummingbot/condor.git condor/ └── Verify Makefile exists 5. ensure_condor_env_noninteractive() ├── If non-interactive: write TELEGRAM_TOKEN + ADMIN_USER_ID to condor/.env └── If interactive: leave .env unwritten; Condor's setup will prompt 6. run_condor_make_install() ├── cd condor/ ├── SKIP_SETUP_RESTART=1 make install (with TTY) └── make build-frontend (with TTY) 7. update_condor_config() └── Replace ADMIN_USER_ID_PLACEHOLDER in condor/config.yml 8. start_condor_tmux() ├── Kill any existing 'condor' session ├── tmux new-session -d -s condor "uv run python main.py" └── Verify session started 9. print_tmux_section() └── Show: tmux attach -t condor 10. print_telegram_verify_section() └── Instruct user to check Telegram for "Condor is online and ready" 11. print_condor_install_footer() ├── Show upgrade command: bash setup.sh --upgrade └── Show API-only command: bash setup.sh --hummingbot-api ``` -------------------------------- ### Test Individual Functions Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/07-error-reference.md Source the setup script and test specific functions like dependency installation, Docker checks, and configuration updates. Use dry runs where available. ```bash # Source the script and test source setup.sh ``` ```bash # Test dependency detection install_dependencies "all" # Dry run (checks only) ``` ```bash # Test Docker check_docker_running detect_docker_compose ``` ```bash # Test configuration ensure_condor_env_noninteractive update_condor_config ``` -------------------------------- ### Start API Docker Compose Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/05-deployment-workflows.md Starts the PostgreSQL, EMQX, and API containers in detached mode for a fresh installation. ```bash docker compose up -d ``` -------------------------------- ### API-Only Install Command Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/01-overview.md Installs only the Hummingbot API service. The setup script is piped to bash with a specific flag, followed by a direct execution with the same flag. ```bash curl -fsSL https://raw.githubusercontent.com/hummingbot/deploy/main/setup.sh | bash -s -- --hummingbot-api bash setup.sh --hummingbot-api ``` -------------------------------- ### Run Fresh Hummingbot Installation Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/03-functions-api.md Orchestrates a complete fresh installation of Condor. This includes cloning the repository, setting up environment variables, building the project, and starting the service in tmux. ```bash run_fresh_install ``` -------------------------------- ### Run Condor Makefile Install Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/03-functions-api.md Executes Condor's Makefile for installation and frontend build. It bypasses setup restarts to avoid nested shell restarts. ```bash run_condor_make_install ``` -------------------------------- ### Install Hummingbot API on New VPS Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/05-deployment-workflows.md Install Hummingbot with API support on a new Virtual Private Server (VPS) non-interactively. Assumes Docker is already installed. ```bash # On a fresh VPS with Docker already installed curl -fsSL https://raw.githubusercontent.com/hummingbot/deploy/main/setup.sh | bash -s -- \ -y \ --hummingbot-api ``` -------------------------------- ### Basic Usage of setup.sh Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/02-command-reference.md The primary command to initiate the setup process. It can be run interactively or with pre-configured environment variables for non-interactive setups. ```bash bash setup.sh [OPTIONS] ``` -------------------------------- ### Get Hummingbot Version Context Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/07-error-reference.md Retrieve the installer script's help output to understand the available options and version context when reporting issues. ```bash # Output of `bash setup.sh --help` (version context) bash setup.sh --help ``` -------------------------------- ### Start and Enable Docker Daemon on Linux Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/06-integration-guide.md Use these commands to start the Docker daemon and ensure it automatically starts on system reboot. ```bash sudo systemctl start docker sudo systemctl enable docker # Auto-start on reboot ``` -------------------------------- ### Manual Condor Make Install Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/07-error-reference.md If Condor's Makefile install or build-frontend fails, navigate to the condor directory and run 'make install' directly to view detailed error output. Ensure Node.js and its dependencies are installed. ```bash cd condor make install ``` ```bash node -v && npm -v ``` -------------------------------- ### Condor Configuration Bootstrap Steps Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/05-deployment-workflows.md Outlines the process for bootstrapping Condor configuration, including environment variable setup and config file updates. This is used for initial setup or when non-interactive environment setup is required. ```shell 1. ensure_condor_env_noninteractive() └── Write condor/.env (non-interactive or when no TTY) ├── TELEGRAM_TOKEN= ├── ADMIN_USER_ID= └── DEPLOY_HUMMINGBOT_API= 2. Condor's setup-environment.sh (via make install) ├── Reads condor/.env if present (skips prompts) └── Or interactively prompts the user if .env missing 3. update_condor_config() └── Write/update condor/config.yml ├── Create from template if missing └── Replace ADMIN_USER_ID_PLACEHOLDER with actual ID 4. sync_condor_config_api_credentials() [on upgrade] └── Update server credentials in condor/config.yml └── Extract USERNAME + PASSWORD from hummingbot-api/.env ``` -------------------------------- ### Print Formatted Sections Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/03-functions-api.md Utility functions for outputting formatted sections with color codes and examples to guide the user through post-installation steps. These include instructions for accessing logs, verifying online, API setup, and upgrade hints. ```bash print_tmux_section ``` ```bash print_telegram_verify_section ``` ```bash print_hummingbot_api_manual_section ``` ```bash print_condor_install_footer ``` ```bash print_api_post_install_summary ``` -------------------------------- ### Manual Node.js Installation via NVM Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/07-error-reference.md Install Node.js and npm using Node Version Manager (nvm) if the automated installation fails. This involves downloading the nvm script, sourcing it, and then installing a specific Node.js version. ```bash curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.4/install.sh | bash source $HOME/.nvm/nvm.sh nvm install 24 ``` -------------------------------- ### Troubleshoot Condor Not Starting in tmux Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/06-integration-guide.md Check tmux session status, view error output, and verify Python/uv environment and package installations if Condor fails to start. ```bash # Check tmux session tmux ls # View error output tmux capture-pane -t condor -p # Manually check if Python/uv is working cd condor uv run python main.py # Check if required Python packages are missing uv pip list ``` -------------------------------- ### Install Condor (Manual Backup) Source: https://github.com/hummingbot/deploy/blob/main/README.md Manual installation steps for Condor if the curl command fails. This involves cloning the repository and running make commands. ```bash make install make run ``` -------------------------------- ### Install Hummingbot API Standalone Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/03-functions-api.md Installs the Hummingbot API as a standalone service, without Condor. This function automates cloning, setup, Docker image pulling, and deployment. ```bash install_api_standalone ``` -------------------------------- ### Install Missing Dependencies on macOS Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/06-integration-guide.md Install necessary tools like git, curl, make, tmux, and Node.js using Homebrew on macOS. After installation, re-run the setup script. ```bash # Install via Homebrew brew install git curl make tmux uv node@24 docker # Then re-run setup.sh bash setup.sh ``` -------------------------------- ### Manual uv Installation Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/07-error-reference.md Install the uv package manager manually by downloading and executing its installation script. Ensure the installation directory is added to your PATH. ```bash curl -LsSf https://astral.sh/uv/install.sh | sh export PATH="$HOME/.local/bin:$PATH" ``` -------------------------------- ### Run Headless Setup with Credentials Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/07-error-reference.md When running in a headless environment or CI, provide necessary credentials via environment variables to enable non-interactive setup. This bypasses the need for an interactive terminal. ```bash DEPLOY_NONINTERACTIVE=1 \ TELEGRAM_TOKEN="..." \ ADMIN_USER_ID="..." \ bash setup.sh ``` -------------------------------- ### Install Hummingbot Condor Locally Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/05-deployment-workflows.md Perform an interactive fresh installation of Hummingbot Condor on a local macOS machine. Assumes Homebrew is already installed. ```bash # On macOS laptop (brew install already done) bash setup.sh ``` -------------------------------- ### Non-Interactive Installation (CI/CD) Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/02-command-reference.md Automate the installation process by setting environment variables for credentials and deployment options. This is ideal for CI/CD pipelines. ```bash DEPLOY_NONINTERACTIVE=1 \ TELEGRAM_TOKEN="123:ABC..." \ ADMIN_USER_ID="987654321" \ DEPLOY_HUMMINGBOT_API=true \ bash setup.sh ``` -------------------------------- ### Terraform Provisioning for Hummingbot VPS Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/06-integration-guide.md Provision a DigitalOcean VPS and deploy Hummingbot using Terraform. This example uses a remote-exec provisioner to run the setup script on the newly created droplet. ```hcl # main.tf resource "digitalocean_droplet" "hummingbot" { name = "hummingbot-api" region = "sfo3" size = "s-2vcpu-4gb" image = "ubuntu-24-04-x64" ssh_keys = [digitalocean_ssh_key.default.fingerprint] provisioner "remote-exec" { inline = [ "apt-get update", "apt-get install -y curl", "curl -fsSL https://raw.githubusercontent.com/hummingbot/deploy/main/setup.sh | bash -s -- --hummingbot-api -y" ] connection { type = "ssh" user = "root" private_key = file("~/.ssh/id_rsa") host = self.ipv4_address } } } output "api_url" { value = "http://${digitalocean_droplet.hummingbot.ipv4_address}:8000/docs" } ``` -------------------------------- ### Install Hummingbot API Only Source: https://github.com/hummingbot/deploy/blob/main/README.md Use this command to install only the Hummingbot API and database stack, typically on a separate machine or server. Docker must be installed and running beforehand. ```bash curl -fsSL https://raw.githubusercontent.com/hummingbot/deploy/main/setup.sh | bash -s -- --hummingbot-api ``` -------------------------------- ### Enable Verbose Installer Output Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/07-error-reference.md Run the installer script with debug output enabled to capture detailed logs for troubleshooting. Redirect output to a file for later analysis. ```bash # Run installer with debug output bash -x setup.sh 2>&1 | tee debug.log ``` ```bash # Run specific function with verbose output bash -x -c 'source setup.sh && install_dependencies all' 2>&1 ``` -------------------------------- ### Project Structure Overview Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/README.md Illustrates the basic file structure of the Hummingbot Deploy project, including the installer script, README, and git repository. ```bash /workspace/home/deploy/ ├── setup.sh (831-line bash installer) ├── README.md (user-facing guide) └── .git/ (git repository) ``` -------------------------------- ### API-Only Installation Workflow Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/05-deployment-workflows.md This outlines the steps for installing Hummingbot in API-only mode, triggered by specific command-line flags or environment variables. It includes dependency installation, Docker checks, and either upgrading an existing installation or performing a fresh standalone installation. ```bash 1. install_dependencies "all" ├── Check for git, curl, make, tmux, uv, node, npm, docker, docker-compose └── Auto-install missing (on Linux; prompt on macOS) 2. check_docker_running └── Verify docker daemon is responsive 3. detect_docker_compose ├── Check for `docker compose` (plugin) ├── Fall back to `docker-compose` (standalone) └── Abort if neither found 4. Check if hummingbot-api/ exists ├── YES: prompt_yesno "Upgrade existing API?" │ ├── If YES: │ │ ├── cd hummingbot-api && git pull │ │ ├── docker compose pull │ │ ├── pull_hummingbot_images() │ │ └── docker compose up -d --remove-orphans │ │ │ └── If NO: exit cleanly │ └── NO: install_api_standalone() ├── git clone --depth 1 hummingbot-api ├── ensure_api_dotenv_unattended() │ └── Write defaults to .env (unattended mode) ├── cd hummingbot-api && make setup (with TTY) ├── docker compose pull ├── pull_hummingbot_images() ├── docker compose up -d (deploy containers) └── Display post-install summary 5. print_api_post_install_summary() ├── Show REST/Swagger endpoint: http://localhost:8000/docs ├── Show EMQX dashboard: http://localhost:18083 ├── Show docker compose commands for status/logs └── Show update commands ``` -------------------------------- ### Deploy Development or Feature Branch Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/06-integration-guide.md Use the setup script to deploy a specific development or feature branch. Specify the branch name with the -b flag. ```bash # Deploy development branch bash setup.sh -b develop # Deploy feature branch bash setup.sh -b feature/trading-strategy ``` -------------------------------- ### Install Node.js via nvm Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/04-configuration.md Installs Node.js using nvm, cloning the nvm repository, installing the latest LTS version of Node.js, setting it as default, and updating the PATH. ```bash install_nodejs_via_nvm ``` -------------------------------- ### Example Deployment Output Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/02-command-reference.md Illustrates the typical output format during a Hummingbot deployment, showing informational messages, successful steps, and warnings. ```text [INFO] Detected OS: linux, Architecture: amd64 [OK] Dependencies present (git, curl, make, tmux, uv, node, npm, docker, docker-compose) [INFO] Cloning Condor repository... [OK] Condor installed successfully [INFO] Starting Condor in tmux... [OK] Condor session 'condor' started (tmux attach -t condor) ``` -------------------------------- ### Install Hummingbot from Specific PR Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/INDEX.md Installs Hummingbot using code from a specific GitHub Pull Request. ```bash bash setup.sh -p 42 ``` -------------------------------- ### Upgrade Workflow Detection and Dependency Installation Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/05-deployment-workflows.md This snippet outlines the initial steps of the upgrade process, including detecting existing services (Hummingbot API or Condor) and installing necessary dependencies, potentially including Docker. ```bash 1. Detect existing services: ├── If hummingbot-api/ exists: │ └── install_dependencies "all" (include Docker) │ ├── check_docker_running() │ └── detect_docker_compose() │ └── Else (only Condor): └── install_dependencies "condor-only" ``` -------------------------------- ### Manual Install Hummingbot API (Docker) Source: https://github.com/hummingbot/deploy/blob/main/README.md A backup method for installing Hummingbot API using git clone and make commands. This is an alternative if the primary curl command fails. ```bash git clone --depth 1 https://github.com/hummingbot/hummingbot-api.git hummingbot-api cd hummingbot-api && make setup && docker compose pull && make deploy ``` -------------------------------- ### Manual Dependency Installation (Linux) Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/07-error-reference.md Manually install required development tools on Linux systems when an unsupported package manager is detected. This is a fallback for automated installation failures. ```bash # Manually install: git curl make tmux uv node npm # Manually install (if needed): docker docker-compose ``` -------------------------------- ### Install Hummingbot API using Bash Source: https://github.com/hummingbot/deploy/blob/main/README.md Alternative command to install Hummingbot API using bash directly, useful if curl is blocked or fails. ```bash bash setup.sh --hummingbot-api ``` -------------------------------- ### Install Condor using Bash Source: https://github.com/hummingbot/deploy/blob/main/README.md Alternative command to install Condor using bash directly, useful if curl is blocked or fails. ```bash bash setup.sh ``` -------------------------------- ### Wrap Hummingbot Installer with Custom Logic Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/06-integration-guide.md Use this script to add custom pre-flight checks, call the upstream installer, and perform post-deployment validation. Ensure necessary environment variables like ORG_APPROVAL_TOKEN are set before execution. ```bash #!/bin/bash # custom-deploy.sh # Wraps setup.sh with organization-specific logic set -eu # Pre-flight checks echo "Running organizational pre-flight checks..." [[ -n "${ORG_APPROVAL_TOKEN:-}" ]] || { echo "Missing ORG_APPROVAL_TOKEN"; exit 1; } # Call the upstream installer curl -fsSL https://raw.githubusercontent.com/hummingbot/deploy/main/setup.sh | DEPLOY_NONINTERACTIVE=1 \ TELEGRAM_TOKEN="${TELEGRAM_TOKEN}" \ ADMIN_USER_ID="${ADMIN_USER_ID}" \ bash -s -- "$@" # Post-deployment validation echo "Running organizational post-deployment checks..." curl -s http://localhost:8000/docs > /dev/null || { echo "API health check failed"; exit 1; } tmux send-keys -t condor "status" Enter || { echo "Condor health check failed"; exit 1; } echo "Deployment successful and validated" ``` -------------------------------- ### Install Hummingbot Dependencies Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/03-functions-api.md Installs system dependencies for Hummingbot. Use 'all' for the full stack including Docker, or 'condor-only' for Condor without Docker. Auto-installs on Linux if TTY is available, otherwise fails on macOS. ```bash install_dependencies [MODE] ``` ```bash install_dependencies "all" # For full Condor + API stack install_dependencies "condor-only" # For Condor only ``` -------------------------------- ### CI/CD Pipeline for Hummingbot Installation Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/05-deployment-workflows.md Automate the Hummingbot installation process for a CI/CD pipeline using environment variables for configuration. This script handles dependencies and deployment non-interactively. ```bash #!/bin/bash set -e export DEPLOY_NONINTERACTIVE=1 export TELEGRAM_TOKEN="$TELEGRAM_TOKEN" # From secrets export ADMIN_USER_ID="$ADMIN_USER_ID" # From secrets export DEPLOY_HUMMINGBOT_API=true export HUMMINGBOT_API_USERNAME="$API_USER" export HUMMINGBOT_API_PASSWORD="$API_PASS" curl -fsSL https://raw.githubusercontent.com/hummingbot/deploy/main/setup.sh | bash ``` -------------------------------- ### Upgrade Workflow: Condor Installation Footer Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/05-deployment-workflows.md Prints a footer message after the Condor installation or upgrade process is completed. ```bash └── print_condor_install_footer() ``` -------------------------------- ### Non-Interactive Mode Setup Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/01-overview.md Configures Hummingbot Deploy for automated deployments by setting environment variables before executing the setup script. ```bash DEPLOY_NONINTERACTIVE=1 \ TELEGRAM_TOKEN=your_token \ ADMIN_USER_ID=your_id \ bash setup.sh ``` -------------------------------- ### Install Hummingbot from Specific Branch Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/INDEX.md Installs Hummingbot using code from a specified development branch. ```bash bash setup.sh -b dev-feature ``` -------------------------------- ### Install Missing Dependencies (macOS) Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/07-error-reference.md Use Homebrew to install missing development tools on macOS. This command should be run after the installer detects missing dependencies and the OS is not Linux. ```bash brew install git curl make tmux uv node docker ``` -------------------------------- ### Install Hummingbot (Non-Interactive) Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/INDEX.md Perform a non-interactive installation of Condor and Hummingbot API, suitable for CI/CD pipelines. Requires Telegram token and admin user ID. ```bash DEPLOY_NONINTERACTIVE=1 TELEGRAM_TOKEN=... ADMIN_USER_ID=... bash setup.sh ``` -------------------------------- ### Troubleshoot API Containers Not Starting Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/06-integration-guide.md Check Docker Compose status, view container logs, identify port conflicts, and rebuild containers if API services fail to start. ```bash # Check Docker Compose status cd hummingbot-api docker compose ps # View container logs docker compose logs -f # Check if ports are in use lsof -i :8000 # API port lsof -i :5432 # PostgreSQL port lsof -i :1883 # MQTT port # Rebuild containers docker compose down docker compose pull docker compose up -d ``` -------------------------------- ### Debug Installer Output Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/05-deployment-workflows.md Pipe the installer script output to a file for later analysis. This captures both standard output and standard error. ```bash bash setup.sh 2>&1 | tee install.log ``` -------------------------------- ### Docker Compose Start Services Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/04-configuration.md Starts Docker Compose services in detached mode, removing orphaned containers. ```shell $DOCKER_COMPOSE up -d --remove-orphans ``` -------------------------------- ### Hummingbot API Only Installation with Auto-confirmation Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/02-command-reference.md Deploy the Hummingbot API stack and automatically confirm any prompts, such as upgrade confirmations. ```bash bash setup.sh --hummingbot-api -y ``` -------------------------------- ### Upgrade Condor Source: https://github.com/hummingbot/deploy/blob/main/README.md Manually upgrade Condor by running the installer script again in the same folder where Condor was initially installed. ```bash curl -fsSL https://raw.githubusercontent.com/hummingbot/deploy/main/setup.sh | bash -s -- --upgrade ``` -------------------------------- ### API Configuration Bootstrap Steps Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/05-deployment-workflows.md Details the bootstrapping process for Hummingbot API configuration, including unattended environment variable setup and Docker Compose deployment. This is crucial for headless or automated deployments. ```shell 1. ensure_api_dotenv_unattended() └── Write hummingbot-api/.env (unattended/headless mode) ├── USERNAME= ├── PASSWORD= ├── CONFIG_PASSWORD= ├── DATABASE_URL= ├── BROKER_HOST= ├── GATEWAY_URL= └── BOTS_PATH= 2. hummingbot-api's setup.sh (via make setup) ├── Reads .env if present (skips prompts) └── Or interactively prompts the user if .env missing 3. Docker Compose (make deploy) ├── Reads hummingbot-api/.env ├── Starts postgres + emqx + API containers └── Services auto-connect via environment variables ``` -------------------------------- ### Manual Condor Repository Clone Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/07-error-reference.md Use this command to manually clone the Condor repository if the automated installer fails. Ensure you have Git installed and a stable internet connection. ```bash git clone --depth 1 https://github.com/hummingbot/condor.git condor ``` -------------------------------- ### Deploy Pull Request for Testing Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/06-integration-guide.md Test pull requests by deploying them directly using the setup script with the -p flag, specifying the pull request number. ```bash # Deploy pull request (for testing PRs) bash setup.sh -p 42 # Pulls PR #42 from condor repo ``` -------------------------------- ### Add API to Existing Condor Installation Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/05-deployment-workflows.md Integrate the Hummingbot API into an existing Condor installation. This script may prompt for configuration details. ```bash # In same directory as existing condor/ bash setup.sh --hummingbot-api ``` -------------------------------- ### GitHub Actions for Hummingbot Deployment Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/06-integration-guide.md Automate Hummingbot deployment using GitHub Actions. Requires checkout of the deploy repository and setting environment variables for non-interactive setup. ```yaml name: Deploy Hummingbot on: push: branches: [main] workflow_dispatch: jobs: deploy: runs-on: ubuntu-latest steps: - name: Checkout deploy repository uses: actions/checkout@v4 - name: Deploy Condor and API env: DEPLOY_NONINTERACTIVE: "1" TELEGRAM_TOKEN: ${{ secrets.TELEGRAM_TOKEN }} ADMIN_USER_ID: ${{ secrets.ADMIN_USER_ID }} HUMMINGBOT_API_USERNAME: ${{ secrets.API_USERNAME }} HUMMINGBOT_API_PASSWORD: ${{ secrets.API_PASSWORD }} DEPLOY_HUMMINGBOT_API: "true" run: | bash setup.sh ``` -------------------------------- ### Print Rerun Command Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/03-functions-api.md Outputs a suggested command for re-running the installer with additional flags. It adapts the output format based on how the script was invoked (e.g., bash vs. curl pipe). ```bash deploy_print_rerun EXTRA_FLAGS [SUFFIX] ``` ```bash deploy_print_rerun "--upgrade" # Output: bash /path/to/setup.sh --upgrade # or: curl -fsSL ... | bash -s -- --upgrade ``` -------------------------------- ### Attach to Condor Logs Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/05-deployment-workflows.md If issues arise after installation, attach to the Condor tmux session to view logs. ```bash tmux attach -t condor # View logs ``` -------------------------------- ### Hummingbot Deploy Architecture Overview Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/01-overview.md Illustrates the role of the setup.sh script in orchestrating the deployment of Condor and optionally Hummingbot API. ```text setup.sh (installer orchestrator) ├── Detects OS, arch, dependencies ├── Clones/pulls Condor repository ├── Runs Condor Makefile (handles Node.js/TypeScript build) ├── Starts Condor in tmux session └── Optionally clones/manages Hummingbot API (Docker Compose stack) ``` -------------------------------- ### Restart Condor Bot Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/07-error-reference.md Kill the existing Condor bot session and restart it using the setup script. ```bash tmux kill-session -t condor && bash setup.sh --upgrade ``` -------------------------------- ### View Docker Compose API Logs Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/05-deployment-workflows.md Follow logs for all services or specific services within the hummingbot-api Docker Compose setup. ```bash cd hummingbot-api docker compose logs -f # All services docker compose logs -f api # API service only docker compose logs -f postgres # Database only docker compose logs -f emqx # MQTT broker only ``` -------------------------------- ### Start Condor Tmux Session Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/05-deployment-workflows.md Kills any existing 'condor' tmux session and creates a new one to run the Hummingbot API. ```bash tmux kill-session -t condor tmux new-session -d -s condor "uv run python main.py" ``` -------------------------------- ### Condor .env Configuration Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/04-configuration.md Environment variables for Condor bot setup. This file is written by ensure_condor_env_noninteractive() and should have 600 permissions. Condor's setup-environment.sh will prompt for missing values if this file does not exist. ```shell TELEGRAM_TOKEN= ADMIN_USER_ID= DEPLOY_HUMMINGBOT_API=true|false ``` -------------------------------- ### Environment-Specific Configuration Script Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/06-integration-guide.md This script sets environment variables for different deployment environments (dev, staging, production) before running the setup script. It supports non-interactive deployment. ```bash #!/bin/bash # deploy-env.sh # Supports dev, staging, production environments ENV="${1:-dev}" case "$ENV" in dev) export TELEGRAM_TOKEN="${DEV_TELEGRAM_TOKEN}" export ADMIN_USER_ID="${DEV_ADMIN_ID}" export HUMMINGBOT_API_USERNAME="devadmin" ;; staging) export TELEGRAM_TOKEN="${STAGING_TELEGRAM_TOKEN}" export ADMIN_USER_ID="${STAGING_ADMIN_ID}" export HUMMINGBOT_API_USERNAME="stagingadmin" ;; production) export TELEGRAM_TOKEN="${PROD_TELEGRAM_TOKEN}" export ADMIN_USER_ID="${PROD_ADMIN_ID}" export HUMMINGBOT_API_USERNAME="prodadmin" ;; *) echo "Unknown environment: $ENV" exit 1 ;; esac export DEPLOY_NONINTERACTIVE=1 bash setup.sh ``` -------------------------------- ### Use a Specific Condor Branch Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/02-command-reference.md Clone and install a specific development or experimental branch of Condor instead of the main branch. ```bash bash setup.sh -b dev-feature ``` ```bash bash setup.sh --branch experimental ``` -------------------------------- ### Detect OS and Architecture Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/03-functions-api.md Detects the operating system and CPU architecture, mapping them to standard values. On macOS, it also sources the Homebrew environment if installed. Results are stored in global variables. ```bash detect_os_arch echo "Running on $OS ($ARCH)" ``` -------------------------------- ### GitLab CI for Hummingbot Deployment Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/06-integration-guide.md Deploy Hummingbot using GitLab CI. This example uses a Docker image and sets environment variables for a non-interactive deployment on the main branch. ```yaml deploy_hummingbot: image: ubuntu:latest script: - bash setup.sh environment: name: production variables: DEPLOY_NONINTERACTIVE: "1" TELEGRAM_TOKEN: $TELEGRAM_TOKEN ADMIN_USER_ID: $ADMIN_USER_ID DEPLOY_HUMMINGBOT_API: "true" only: - main ``` -------------------------------- ### Manually Run Condor for Debugging Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/07-error-reference.md Run the Condor Python script directly to inspect startup errors. This is useful when the tmux session fails but the underlying process might be starting. ```bash cd condor uv run python main.py ``` -------------------------------- ### High-Availability Deployment Script Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/06-integration-guide.md This script deploys multiple Hummingbot (Condor) instances in separate directories and starts them in tmux sessions. It's intended for setting up instances behind a load balancer. ```bash #!/bin/bash # deploy-ha.sh for instance in 1 2 3; do DIR="condor-$instance" mkdir -p "$DIR" cd "$DIR" bash setup.sh -b main # Start in separate tmux session tmux new-session -d -s "condor-$instance" "uv run python main.py" cd .. done echo "Deployed 3 Condor instances" # Now add these behind a reverse proxy or load balancer ``` -------------------------------- ### Upgrade Workflow: Condor Component Upgrade Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/05-deployment-workflows.md Details the steps for upgrading the Condor component, including pulling the latest code, installing dependencies, and building the frontend. This is executed when the Condor directory is detected. ```bash 3. run_upgrade() ├── If condor/ exists: │ ├── cd condor && git pull │ ├── refresh_tool_path() │ ├── SKIP_SETUP_RESTART=1 make install (with TTY) │ └── make build-frontend (with TTY) ``` -------------------------------- ### Ensure Hummingbot API Environment Unattended Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/03-functions-api.md Seeds the `hummingbot-api/.env` file for unattended API setup. Only writes if `.env` does not exist and a TTY is not available. Sets default credentials and database URL. ```bash ensure_api_dotenv_unattended API_ROOT_PATH ``` ```bash ensure_api_dotenv_unattended "$(pwd)/hummingbot-api" ``` -------------------------------- ### Check Docker Daemon Status Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/03-functions-api.md Verifies if the Docker daemon is running and responsive using 'docker info'. Provides guidance for starting Docker Desktop on macOS or the Docker service on Linux if it's not running. ```bash check_docker_running # Exits process if Docker is not running ``` -------------------------------- ### Ansible Playbook for Hummingbot Deployment Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/06-integration-guide.md Deploy Hummingbot using an Ansible playbook. This playbook installs dependencies and runs the setup script with environment variables, including sensitive ones managed by Vault. ```yaml --- - hosts: hummingbot_servers become: yes vars: telegram_token: "{{ vault_telegram_token }}" admin_user_id: "{{ vault_admin_user_id }}" api_username: "{{ vault_api_username }}" api_password: "{{ vault_api_password }}" tasks: - name: Install dependencies apt: name: [curl, git, make, tmux, docker.io, docker-compose-plugin] state: present when: ansible_os_family == "Debian" - name: Deploy Hummingbot shell: | curl -fsSL https://raw.githubusercontent.com/hummingbot/deploy/main/setup.sh | bash environment: DEPLOY_NONINTERACTIVE: "1" TELEGRAM_TOKEN: "{{ telegram_token }}" ADMIN_USER_ID: "{{ admin_user_id }}" DEPLOY_HUMMINGBOT_API: "true" HUMMINGBOT_API_USERNAME: "{{ api_username }}" HUMMINGBOT_API_PASSWORD: "{{ api_password }}" ``` -------------------------------- ### Remove Existing Hummingbot API Directory Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/07-error-reference.md Delete the existing Hummingbot API directory to perform a fresh installation. This is an alternative recovery step when encountering a 'Directory Already Exists' warning and a fresh setup is desired. ```bash rm -rf hummingbot-api bash setup.sh --hummingbot-api ``` -------------------------------- ### Start Condor Tmux Session Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/03-functions-api.md Starts Condor within a dedicated tmux session. It ensures a clean start by killing any existing session before launching the Condor process. ```bash start_condor_tmux # User can now attach with: tmux attach -t condor ``` -------------------------------- ### Upgrade Workflow: Post-Upgrade Summary Display (API) Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/05-deployment-workflows.md Provides information for verifying the Hummingbot API upgrade, including commands to check running services, view logs, and access the API documentation. ```bash ├── If API was upgraded: │ ├── Show: cd hummingbot-api && docker compose ps │ ├── Show: cd hummingbot-api && docker compose logs -f │ └── Show: http://localhost:8000/docs ``` -------------------------------- ### Pre-create Customized .env Files for Hummingbot Components Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/06-integration-guide.md This script generates custom .env files for the Hummingbot gateway (condor) and API server, setting specific configurations and credentials. It then invokes the main setup.sh script, which will utilize these pre-created files. ```bash #!/bin/bash # pre-deploy-setup.sh # Create condor/.env with custom values mkdir -p condor cat > condor/.env << EOF TELEGRAM_TOKEN=${TELEGRAM_TOKEN} ADMIN_USER_ID=${ADMIN_USER_ID} DEPLOY_HUMMINGBOT_API=true CUSTOM_LOG_LEVEL=DEBUG CUSTOM_FEATURES=advanced_analytics EOF chmod 600 condor/.env # Create API .env with custom database credentials mkdir -p hummingbot-api cat > hummingbot-api/.env << EOF USERNAME=hbot PASSWORD=$(openssl rand -base64 16) CONFIG_PASSWORD=$(openssl rand -base64 16) DATABASE_URL=postgresql+asyncpg://hbot:hbot@db.internal.example.com:5432/hummingbot_api BROKER_HOST=mqtt.internal.example.com BROKER_PORT=1883 DEBUG_MODE=false GATEWAY_URL=http://localhost:15888 EOF chmod 600 hummingbot-api/.env # Now run setup.sh (will use existing .env files) bash setup.sh ``` -------------------------------- ### Upgrade Existing Hummingbot Installations Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/03-functions-api.md Upgrades both Condor and Hummingbot API installations. It handles git pulls, rebuilds, Docker image updates, and configuration synchronization. ```bash run_upgrade ``` -------------------------------- ### Hummingbot Deploy File Structure Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/01-overview.md Shows the main files and directories within the Hummingbot Deploy project. ```text /workspace/home/deploy/ ├── setup.sh # Main installer (831 lines) ├── README.md # User-facing installation guide └── .git/ # Git repository metadata ``` -------------------------------- ### Access Hummingbot API Documentation Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/INDEX.md Opens the Hummingbot API documentation in a web browser. ```bash http://localhost:8000/docs ``` -------------------------------- ### Hummingbot API .env Configuration Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/04-configuration.md Environment variables for unattended Hummingbot API setup. This file is written by ensure_api_dotenv_unattended() when /dev/tty is unavailable or non-interactive mode is active. It has 600 permissions and is used by Hummingbot API's make setup and Docker Compose. ```shell USERNAME=admin PASSWORD=admin CONFIG_PASSWORD=admin DEBUG_MODE=false BROKER_HOST=localhost BROKER_PORT=1883 BROKER_USERNAME=admin BROKER_PASSWORD=password DATABASE_URL=postgresql+asyncpg://hbot:hummingbot-api@localhost:5432/hummingbot_api GATEWAY_URL=http://localhost:15888 GATEWAY_PASSPHRASE=admin BOTS_PATH= ``` -------------------------------- ### Hummingbot Documentation Structure Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/INDEX.md This snippet outlines the directory structure of the Hummingbot deployment documentation. It lists the main markdown files and their respective topics, providing a roadmap for navigating the documentation. ```markdown ``` INDEX.md (this file) ├── 01-overview.md [Architecture, environments, concepts] ├── 02-command-reference.md [CLI flags, examples, env vars] ├── 03-functions-api.md [Function signatures and behavior] ├── 04-configuration.md [Config files, system detection] ├── 05-deployment-workflows.md [Installation flows, debugging] ├── 06-integration-guide.md [CI/CD, IaC, advanced scenarios] └── 07-error-reference.md [Errors, troubleshooting, recovery] ``` ``` -------------------------------- ### Verify Telegram Connection Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/05-deployment-workflows.md After a fresh Condor installation, check Telegram for the online confirmation message. ```bash # Open Telegram, check for "Condor is online and ready" message ``` -------------------------------- ### Capture Logs After Failure Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/07-error-reference.md Collect logs from Condor, the Hummingbot API, or the installer to diagnose issues that occur during operation. ```bash # Condor logs tmux capture-pane -t condor -p > condor_logs.txt ``` ```bash # API logs cd hummingbot-api && docker compose logs > api_logs.txt ``` ```bash # Installer output (if saved) less install.log ``` -------------------------------- ### Upgrade Workflow: Condor Configuration Synchronization Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/05-deployment-workflows.md Synchronizes API credentials from the hummingbot-api/.env file to the condor/config.yml file. ```bash └── sync_condor_config_api_credentials() └── Sync API credentials from hummingbot-api/.env to condor/config.yml ``` -------------------------------- ### View EMQX Broker Logs Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/07-error-reference.md Display logs for the EMQX MQTT broker container. ```bash cd hummingbot-api docker compose logs emqx ``` -------------------------------- ### Check System State Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/07-error-reference.md Verify system information, disk space, memory availability, network connectivity, and open ports to ensure the environment meets Hummingbot requirements. ```bash # OS and arch uname -a ``` ```bash # Free disk space df -h ``` ```bash # Available memory free -h ``` ```bash # Network connectivity ping -c 1 github.com curl -I https://api.telegram.org ``` ```bash # Open ports netstat -tlnp | grep LISTEN ``` -------------------------------- ### Check PostgreSQL Database URL Source: https://github.com/hummingbot/deploy/blob/main/_autodocs/07-error-reference.md Verify that the DATABASE_URL in the .env file is correctly configured. ```bash cd hummingbot-api grep DATABASE_URL .env ```