hummingbot-deploy

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

hummingbot-deploy

Hummingbot部署

Deploy the Hummingbot trading infrastructure. Before starting, explain to the user what will be installed:
部署Hummingbot交易基础设施。开始之前,请向用户说明将要安装的内容:

What You're Installing

您将安装的内容

  1. Hummingbot API (Required): Your personal trading server that exposes a standardized REST API for trading, fetching market data, and deploying bot strategies across many CEXs and DEXs.
  2. Hummingbot MCP (Required): MCP server that helps AI agents (Claude, Gemini, Codex, etc.) interact with Hummingbot API. This is necessary to use Hummingbot Skills.
  3. Condor (Optional): Terminal and Telegram-based UI for Hummingbot API.
  1. Hummingbot API(必填):您的个人交易服务器,提供标准化REST API,用于在多个中心化交易所(CEX)和去中心化交易所(DEX)进行交易、获取市场数据以及部署机器人策略。
  2. Hummingbot MCP(必填):帮助AI Agent(Claude、Gemini、Codex等)与Hummingbot API交互的MCP服务器。这是使用Hummingbot Skills的必要组件。
  3. Condor(可选):基于终端和Telegram的Hummingbot API用户界面。

Components

组件

ComponentRepository
Hummingbot APIhummingbot/hummingbot-api
MCP Serverhummingbot/mcp
Condorhummingbot/condor
组件代码仓库
Hummingbot APIhummingbot/hummingbot-api
MCP Serverhummingbot/mcp
Condorhummingbot/condor

Pre-Installation Check

安装前检查

First, run the environment check to verify prerequisites:
bash
bash <(curl -s https://raw.githubusercontent.com/hummingbot/skills/main/skills/hummingbot-deploy/scripts/check_env.sh)
This checks: container detection, TTY, Docker, Docker Compose, Git, Make.
首先,运行环境检查以验证前置条件:
bash
bash <(curl -s https://raw.githubusercontent.com/hummingbot/skills/main/skills/hummingbot-deploy/scripts/check_env.sh)
此脚本会检查:容器检测、TTY、Docker、Docker Compose、Git、Make。

Install Hummingbot API

安装Hummingbot API

If ~/hummingbot-api already exists, verify it's running by checking docker logs:
bash
cd ~/hummingbot-api && make deploy && sleep 2 && docker logs hummingbot-api 2>&1 | grep -i "uvicorn running"
If logs show "Uvicorn running", skip to "Install MCP Server". Otherwise, reset and reinstall.
Fresh install:
bash
git clone https://github.com/hummingbot/hummingbot-api.git ~/hummingbot-api
cd ~/hummingbot-api
On regular machines (interactive TTY - check_env.sh shows "Interactive TTY: Yes"):
bash
make setup    # Prompts for: API username, password, config password (defaults: admin/admin/admin)
make deploy
In containers (no TTY - check with
[ -t 0 ] && echo "TTY" || echo "No TTY"
):
bash
undefined
如果 ~/hummingbot-api 已存在,通过查看Docker日志验证它是否在运行:
bash
cd ~/hummingbot-api && make deploy && sleep 2 && docker logs hummingbot-api 2>&1 | grep -i "uvicorn running"
如果日志显示“Uvicorn running”,跳至“安装MCP Server”部分。否则,重置并重新安装。
全新安装:
bash
git clone https://github.com/hummingbot/hummingbot-api.git ~/hummingbot-api
cd ~/hummingbot-api
在常规机器上(交互式TTY - check_env.sh显示“Interactive TTY: Yes”):
bash
make setup    # 提示输入:API用户名、密码、配置密码(默认值:admin/admin/admin)
make deploy
在容器中(无TTY - 使用
[ -t 0 ] && echo "TTY" || echo "No TTY"
检查):
bash
undefined

Set USER env var and create sudo shim if needed

设置USER环境变量,必要时创建sudo垫片

export USER=${USER:-root} [ "$(id -u)" = "0" ] && ! command -v sudo &>/dev/null && echo -e '#!/bin/bash\nwhile [[ "$1" == = ]]; do export "$1"; shift; done\nexec "$@"' > /usr/local/bin/sudo && chmod +x /usr/local/bin/sudo
export USER=${USER:-root} [ "$(id -u)" = "0" ] && ! command -v sudo &>/dev/null && echo -e '#!/bin/bash\nwhile [[ "$1" == = ]]; do export "$1"; shift; done\nexec "$@"' > /usr/local/bin/sudo && chmod +x /usr/local/bin/sudo

Create .env manually (skip interactive setup)

手动创建.env文件(跳过交互式设置)

Note: In containers, services communicate via Docker network (use container names, not localhost)

注意:在容器中,服务通过Docker网络通信(使用容器名称,而非localhost)

cat > .env << EOF USERNAME=admin PASSWORD=admin CONFIG_PASSWORD=admin DEBUG_MODE=false BROKER_HOST=hummingbot-broker BROKER_PORT=1883 BROKER_USERNAME=admin BROKER_PASSWORD=password DATABASE_URL=postgresql+asyncpg://hbot:hummingbot-api@hummingbot-postgres:5432/hummingbot_api BOTS_PATH=/hummingbot-api/bots EOF
cat > .env << EOF USERNAME=admin PASSWORD=admin CONFIG_PASSWORD=admin DEBUG_MODE=false BROKER_HOST=hummingbot-broker BROKER_PORT=1883 BROKER_USERNAME=admin BROKER_PASSWORD=password DATABASE_URL=postgresql+asyncpg://hbot:hummingbot-api@hummingbot-postgres:5432/hummingbot_api BOTS_PATH=/hummingbot-api/bots EOF

Patch docker-compose.yml (bind mounts don't work in Docker-in-Docker)

修补docker-compose.yml(绑定挂载在Docker-in-Docker环境中无法工作)

sed -i 's|./bots:/hummingbot-api/bots|hummingbot-bots:/hummingbot-api/bots|g' docker-compose.yml sed -i '/init-db.sql.*docker-entrypoint/d' docker-compose.yml
sed -i 's|./bots:/hummingbot-api/bots|hummingbot-bots:/hummingbot-api/bots|g' docker-compose.yml sed -i '/init-db.sql.*docker-entrypoint/d' docker-compose.yml

Add volume definition (check last 5 lines to avoid false positive from service definition)

添加卷定义(检查最后5行,避免服务定义中的误匹配)

tail -5 docker-compose.yml | grep -q "hummingbot-bots:" || echo " hummingbot-bots: { }" >> docker-compose.yml
touch .setup-complete make deploy

**Verify:** Wait 2 seconds then check logs for "Uvicorn running on http://0.0.0.0:8000":
```bash
sleep 2 && docker logs hummingbot-api 2>&1 | grep -i "uvicorn running"
tail -5 docker-compose.yml | grep -q "hummingbot-bots:" || echo " hummingbot-bots: { }" >> docker-compose.yml
touch .setup-complete make deploy

**验证:** 等待2秒后,检查日志中是否包含“Uvicorn running on http://0.0.0.0:8000”:
```bash
sleep 2 && docker logs hummingbot-api 2>&1 | grep -i "uvicorn running"

Install MCP Server

安装MCP Server

Install the MCP server using your CLI's native command. Use the same credentials from API setup.
IMPORTANT: Do NOT ask the user which CLI to use. You already know which CLI you are:
  • If you are Claude Code, use
    claude
  • If you are Gemini CLI, use
    gemini
  • If you are Codex CLI, use
    codex
bash
bash <(curl -s https://raw.githubusercontent.com/hummingbot/skills/main/skills/hummingbot-deploy/scripts/install_mcp.sh) \
  --agent <YOUR_CLI> --user <USERNAME> --pass <PASSWORD>
Example for Claude (substitute your actual CLI name and credentials):
bash
bash <(curl -s https://raw.githubusercontent.com/hummingbot/skills/main/skills/hummingbot-deploy/scripts/install_mcp.sh) \
  --agent claude --user admin --pass admin
使用您的CLI原生命令安装MCP服务器。使用API设置时相同的凭据。
重要提示: 不要询问用户使用哪个CLI。您已明确自己的CLI类型:
  • 如果您是Claude Code,使用
    claude
  • 如果您是Gemini CLI,使用
    gemini
  • 如果您是Codex CLI,使用
    codex
bash
bash <(curl -s https://raw.githubusercontent.com/hummingbot/skills/main/skills/hummingbot-deploy/scripts/install_mcp.sh) \
  --agent <YOUR_CLI> --user <USERNAME> --pass <PASSWORD>
Claude的示例(替换为您实际的CLI名称和凭据):
bash
bash <(curl -s https://raw.githubusercontent.com/hummingbot/skills/main/skills/hummingbot-deploy/scripts/install_mcp.sh) \
  --agent claude --user admin --pass admin

Installation Complete

安装完成

After all components are installed, tell the user:
  1. Restart your AI agent (Claude Code, Gemini CLI, Codex CLI, etc.) to load the MCP server
  2. Install Hummingbot Skills to enable trading capabilities:
    bash
    npx skills add hummingbot/skills
所有组件安装完成后,告知用户:
  1. 重启您的AI Agent(Claude Code、Gemini CLI、Codex CLI等)以加载MCP服务器
  2. 安装Hummingbot Skills以启用交易功能:
    bash
    npx skills add hummingbot/skills

Install Condor (Optional)

安装Condor(可选)

bash
git clone https://github.com/hummingbot/condor.git ~/condor
cd ~/condor
bash setup-environment.sh  # Prompts for Telegram bot token
make deploy
bash
git clone https://github.com/hummingbot/condor.git ~/condor
cd ~/condor
bash setup-environment.sh  # 提示输入Telegram机器人令牌
make deploy

Upgrade

升级

bash
cd ~/hummingbot-api && git pull && make deploy
bash
cd ~/hummingbot-api && git pull && make deploy

Verify Installation

验证安装

bash
bash <(curl -s https://raw.githubusercontent.com/hummingbot/skills/main/skills/hummingbot-deploy/scripts/verify.sh)
bash
bash <(curl -s https://raw.githubusercontent.com/hummingbot/skills/main/skills/hummingbot-deploy/scripts/verify.sh)

Troubleshooting

故障排除

bash
undefined
bash
undefined

View logs

查看日志

cd ~/hummingbot-api && docker compose logs -f
cd ~/hummingbot-api && docker compose logs -f

Reset

重置

cd ~/hummingbot-api && docker compose down -v && rm -rf ~/hummingbot-api
undefined
cd ~/hummingbot-api && docker compose down -v && rm -rf ~/hummingbot-api
undefined

See Also

另请参阅