hummingbot-deploy
Deploy the Hummingbot trading infrastructure. Before starting, explain to the user what will be installed:
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 (Optional): MCP server that helps AI agents (Claude, Gemini, Codex, etc.) interact with Hummingbot API. Only needed if using AI agent CLIs.
- 3. Condor (Optional): Terminal and Telegram-based UI for Hummingbot API.
Components
hummingbot/mcp |
| Condor |
hummingbot/condor |
Pre-Installation Check
Only Hummingbot API is required. MCP and Condor are optional add-ons.
First, run the environment check to verify prerequisites:
CODEBLOCK0
This checks: container detection, TTY, Docker, Docker Compose, Git, Make.
Install Hummingbot API
If ./hummingbot-api already exists, verify it's running by checking docker logs:
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:
CODEBLOCK2
On regular machines (interactive TTY - check_env.sh shows "Interactive TTY: Yes"):
CODEBLOCK3
In containers (no TTY - check with [ -t 0 ] && echo "TTY" || echo "No TTY"):
CODEBLOCK4
Verify: Wait 2 seconds then check logs for "Uvicorn running on http://0.0.0.0:8000":
CODEBLOCK5
Install 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 INLINECODE1
- If you are Gemini CLI, use INLINECODE2
- If you are Codex CLI, use INLINECODE3
CODEBLOCK6
Example for Claude (substitute your actual CLI name and credentials):
CODEBLOCK7
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
- Install Hummingbot Skills to enable trading capabilities:
CODEBLOCK8
Install Condor (Optional)
CODEBLOCK9
Upgrade
CODEBLOCK10
Verify Installation
CODEBLOCK11
Troubleshooting
CODEBLOCK12
See Also
hummingbot-deploy
部署 Hummingbot 交易基础设施。开始前,向用户说明将要安装的内容:
您即将安装的内容
- 1. Hummingbot API(必需):您的个人交易服务器,提供标准化的 REST API,用于交易、获取市场数据以及在众多中心化交易所和去中心化交易所上部署机器人策略。
- 2. Hummingbot MCP(可选):MCP 服务器,帮助 AI 代理(Claude、Gemini、Codex 等)与 Hummingbot API 交互。仅在使用 AI 代理 CLI 时需要。
- 3. Condor(可选):基于终端和 Telegram 的 Hummingbot API 用户界面。
组件
hummingbot/mcp |
| Condor |
hummingbot/condor |
安装前检查
仅 Hummingbot API 是必需的。 MCP 和 Condor 是可选的附加组件。
首先,运行环境检查以验证先决条件:
bash
bash <(curl -s https://raw.githubusercontent.com/hummingbot/skills/main/skills/hummingbot-deploy/scripts/check_env.sh)
此项检查:容器检测、TTY、Docker、Docker Compose、Git、Make。
安装 Hummingbot API
如果 ./hummingbot-api 已存在,通过检查 Docker 日志验证其是否正在运行:
bash
cd ./hummingbot-api && make deploy && sleep 2 && docker logs hummingbot-api 2>&1 | grep -i uvicorn running
如果日志显示 Uvicorn running,跳至安装 MCP 服务器。否则,重置并重新安装。
全新安装:
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
设置 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
手动创建 .env(跳过交互式设置)
注意:在容器中,服务通过 Docker 网络通信(使用容器名称,而非 localhost)
cat > .env << EOF
API_USER=admin
API_PASS=admin
CONFIG
APIPASS=admin
DEBUG_MODE=false
BROKER_HOST=hummingbot-broker
BROKER_PORT=1883
BROKER
APIUSER=admin
BROKER_PASSWORD=password
DATABASE
URL=postgresql+asyncpg://hbot:hummingbot-api@hummingbot-postgres:5432/hummingbotapi
BOTS_PATH=/hummingbot-api/bots
EOF
修补 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
添加卷定义(检查最后 5 行以避免服务定义误报)
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
安装 MCP 服务器
使用您的 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 CLI> --user USER> --pass
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
安装完成
所有组件安装完成后,告知用户:
- 1. 重启您的 AI 代理(Claude Code、Gemini CLI、Codex CLI 等)以加载 MCP 服务器
- 安装 Hummingbot Skills 以启用交易功能:
bash
npx skills add hummingbot/skills
安装 Condor(可选)
bash
git clone https://github.com/hummingbot/condor.git ./condor
cd ./condor
bash setup-environment.sh # 提示输入 Telegram 机器人令牌
make deploy
升级
bash
cd ./hummingbot-api && git pull && make deploy
验证安装
bash
bash <(curl -s https://raw.githubusercontent.com/hummingbot/skills/main/skills/hummingbot-deploy/scripts/verify.sh)
故障排除
bash
查看日志
cd ./hummingbot-api && docker compose logs -f
重置
cd ./hummingbot-api && docker compose down -v && rm -rf ./hummingbot-api
另请参阅