hummingbot-developer について
hummingbot-developerは、Hummingbotスタックをソースから開発するためのワークフロースキルです。Hummingbot、Gateway、hummingbot-apiのインストール、ビルド、検証、実行を支援します。
主な機能
- 01開発環境の確認
- 02複数リポジトリのブランチ選択
- 033つのリポジトリのインストールとビルド
- 04ビルドとサービス接続の検証
- 05開発スタック全体の起動
活用シーン
- 01ローカルのHummingbot開発環境の構築
- 02DockerイメージとHummingbot wheelのビルド
- 03APIとGatewayの接続確認
インストール
コマンドをコピーしてターミナルで実行します。
npx skills add https:/ / github.com/ hummingbot/ skills --skill hummingbot-developerインストール後、Claude Code で/hummingbot-developerを入力して読み込まれたか確認します。
同梱ファイル
SKILL.md と一緒にインストールされる参考資料やスクリプト。
references/DEVELOPERS.mddocker-compose.dev.ymlDockerfile.devenvironment.docker.ymlenvironment.yml.examplescripts/build_all.shcheck_api.shcheck_env.shcheck_gateway.shcheck_repos.shinstall_all.shinstall_deps.shrun_dev_stack.shselect_branches.shtest_integration.pyverify_build.sh詳細
hummingbot-developer
ソースから Hummingbot スタック全体をビルドして実行するための開発者ワークフロースキルです。
コマンド (/hummingbot-developer <command> として実行):
| コマンド | 説明 |
|---|---|
start | 開発環境のステータスを確認 |
select-branches | 3 つのリポジトリすべてのブランチを選択 |
install-all | 3 つのリポジトリをすべて順番にインストール |
build-all | wheel + すべての Docker イメージをビルド |
verify-build | ビルドが正しく同期しているか検証 |
run-dev-stack | ソースからスタック全体を起動 |
setup-hummingbot | ソースから Hummingbot をインストール |
run-hummingbot | ソースから Hummingbot CLI を実行 |
build-hummingbot | wheel + Docker イメージをビルド |
setup-gateway | ソースから Gateway をインストール |
run-gateway | 開発モードで Gateway を実行 |
build-gateway | Gateway の Docker イメージをビルド |
setup-api-dev | API をローカルの Hummingbot ソースに接続 |
run-api-dev | ホットリロード付きでソースから API を実行 |
test-integration | スタック全体のスモークテスト |
一般的な開発ワークフロー:
install-deps → select-branches → install-all → build-all → verify-build → run-dev-stack → test-integration
リポジトリの場所 (すべてワークスペース内):
| リポジトリ | パス |
|---|---|
| hummingbot | ~/.openclaw/workspace/hummingbot |
| gateway | ~/.openclaw/workspace/hummingbot-gateway |
| hummingbot-api | ~/.openclaw/workspace/hummingbot-api |
環境変数 HUMMINGBOT_DIR、GATEWAY_DIR、HUMMINGBOT_API_DIR、または WORKSPACE で上書きできます。
コマンド: install-deps
不足している開発依存関係をすべて自動インストールします。再実行しても安全です — すでにインストール済みのものはスキップされます。
bash scripts/install_deps.sh
インストール対象 (不足している場合のみ):
- Homebrew (macOS)
- Xcode Command Line Tools (macOS — Cython の
build_extに必要) - Miniconda (conda)
- Node.js v22 (nvm、Homebrew、または nvm をインストール経由)
- pnpm (npm または Homebrew 経由)
- Git
- Docker Desktop (macOS — Homebrew cask またはダウンロードページを開く経由)
オプション:
--check # check only, don't install anything
--conda # only install conda
--node # only install node + nvm
--pnpm # only install pnpm
インストール後は、ターミナルを再起動する (または source ~/.zshrc を実行する) ことで PATH の変更を反映し、その後 check_env.sh を実行して確認してください。
コマンド: select-branches
各リポジトリのブランチを対話的に選択し、チェックアウトして .dev-branches に保存します。
bash scripts/select_branches.sh
非対話型オプション:
# Use development for all
bash scripts/select_branches.sh --defaults
# Specify each branch
bash scripts/select_branches.sh \
--hummingbot development \
--gateway core-2.7 \
--api development
ブランチの選択は $WORKSPACE/.dev-branches に保存され、install_all.sh、build_all.sh、verify_build.sh によって自動的に読み込まれます。
コマンド: install-all
3 つのリポジトリすべてを正しい順序でインストールします。事前に select-branches が必要です (または --defaults を渡します)。
bash scripts/install_all.sh
実行内容 (順番に):
environment.ymlからsoldersを削除 (pip のみ)- hummingbot で
make install→conda env hummingbot - hummingbot 環境に
pip install solders>=0.19.0 - gateway に対して
pnpm install && pnpm build && pnpm run setup:with-defaults - hummingbot-api に対して
conda env create pip install -e <hummingbot_dir> --no-deps→ ローカルソースを API 環境に接続
オプション:
--skip-hbot # skip hummingbot conda install
--skip-gateway # skip gateway pnpm install
--skip-api # skip hummingbot-api install
--no-local-hbot # use PyPI hummingbot in API env instead of local source
コマンド: build-all
hummingbot の wheel とすべての Docker イメージを正しい順序でビルドします。
bash scripts/build_all.sh
ビルド順序:
python setup.py bdist_wheelによるhummingbotwheel (dist/*.whl)hummingbot/hummingbot:devDocker イメージhummingbot/gateway:devDocker イメージ (dist/ も再ビルド)hummingbot/hummingbot-api:devDocker イメージ
各イメージにはブランチ名もタグ付けされます (例: hummingbot/gateway:core-2.7)。
オプション:
--wheel-only # only build hummingbot wheel, no Docker
--no-docker # skip all Docker builds
--no-hbot # skip hummingbot builds
--no-gateway # skip gateway builds
--no-api # skip hummingbot-api builds
--tag <name> # Docker tag (default: dev)
コマンド: verify-build
すべてのビルドが正しく、同期していることを検証します。
bash scripts/verify_build.sh
チェック項目:
- 各リポジトリが期待されるブランチ上にある (
.dev-branchesから) - Hummingbot wheel が
dist/に存在する - Gateway の
dist/がビルドされており、ソースに対して古くなっていない - ローカルの hummingbot ソースが hummingbot-api 環境で有効になっている
- 正しいブランチラベルを持つ Docker イメージが存在する
- 実行中のサービス (API + Gateway) に到達可能である
- API → Gateway の接続性
bash scripts/verify_build.sh --no-docker # skip Docker checks
bash scripts/verify_build.sh --no-running # skip service checks
bash scripts/verify_build.sh --json # JSON output
コマンド: run-dev-stack
ソースから開発スタック全体を起動します。
bash scripts/run_dev_stack.sh
起動順序:
docker compose up emqx postgres -dによる Docker インフラ (postgres + EMQX)- バックグラウンドでソースから Gateway (
node dist/index.js --passphrase=hummingbot --dev) - フォアグラウンドでソースから Hummingbot API (
uvicorn main:app --reload)
オプション:
--no-gateway # skip gateway start
--passphrase <pass> # gateway passphrase (default: hummingbot)
--stop # stop everything
--status # show running status
ログ:
- Gateway ログ:
tail -f ~/.openclaw/workspace/.gateway.log - API ログ: ターミナルに出力 (フォアグラウンド)
コマンド: start
開発環境全体をチェックし、ステータス概要を表示します。
ステップ 1: 環境チェックを実行
bash scripts/check_env.sh --json
ステップ 2: リポジトリのブランチを確認
bash scripts/check_repos.sh --json
ステップ 3: 実行中のサービスを確認
bash scripts/check_api.sh --json
bash scripts/check_gateway.sh --json
ステップ 4: ステータスチェックリストを表示
次のようなチェックリストを表示します:
Dev Environment Status
======================
[x] Prerequisites — conda, node, pnpm, docker, git OK
[x] Hummingbot repo — branch: development, env: hummingbot (installed)
[x] Gateway repo — branch: development, built: yes
[x] Hummingbot API — running at http://localhost:8000
[x] Gateway — running at http://localhost:15888
[ ] Local hummingbot — hummingbot-api NOT using local source
Next: run /hummingbot-developer setup-api-dev to wire API to local source
実際の状態に合わせて調整してください。すべて問題なければ、テストコマンドを表示します。
コマンド: setup-hummingbot
development ブランチのソースから Hummingbot をインストールします。
ステップ 1: 前提条件を確認
bash scripts/check_env.sh
ステップ 2: development ブランチをチェックアウト
cd <HUMMINGBOT_DIR>
git fetch origin
git checkout development
git pull origin development
ステップ 3: environment.yml から solders を削除 (pip 専用パッケージ)
sed -i '' '/solders/d' setup/environment.yml 2>/dev/null || sed -i '/solders/d' setup/environment.yml
ステップ 4: conda 環境をインストール
make install
これにより hummingbot conda 環境が作成されます。初回実行時は 3〜10 分かかります。
ステップ 5: pip 経由で solders をインストール (conda にはありません)
conda run -n hummingbot pip install "solders>=0.19.0"
出力の読み方
| 出力 | 意味 | 次のステップ |
|---|---|---|
conda develop . が成功 | 開発インストールが登録済み | 次へ進む |
PackagesNotFoundError: solders | ステップ 3 を忘れた | sed を実行して再インストール |
Error: Conda is not found | conda が PATH にない | source ~/.zshrc または Anaconda をインストール |
build_ext エラー | ビルドツールが不足 | Xcode CLT をインストール: xcode-select --install |
セットアップ後
[x] conda env "hummingbot" created
[x] solders installed via pip
Run hummingbot: /hummingbot-developer run-hummingbot
Build image: /hummingbot-developer build-hummingbot
コマンド: run-hummingbot
ソースから Hummingbot CLI を実行します。
cd <HUMMINGBOT_DIR>
conda activate hummingbot
./bin/hummingbot_quickstart.py
または make 経由で:
cd <HUMMINGBOT_DIR>
make run
注意: これにより対話型の Hummingbot CLI が開きます。終了するには exit を使用してください。
特定の設定で実行するには:
make run ARGS="--config-file-name conf_pure_mm_1.yml"
コマンド: build-hummingbot
ソースから Hummingbot wheel や Docker イメージをビルドします。
wheel をビルド (ローカルの pip インストール用)
cd <HUMMINGBOT_DIR>
conda activate hummingbot
pip install build wheel # if not already installed
python -m build --wheel --no-isolation
wheel は dist/hummingbot-*.whl に出力されます。
重要: wheel は hummingbot-api の環境に合わせて Python 3.12 でビルドする必要があります。
この wheel を使って他の環境にインストールする:
pip install dist/hummingbot-*.whl --force-reinstall --no-deps
Docker 用の Linux wheel をビルド
hummingbot-api の Docker イメージをビルドする際には、Linux wheel (macOS/Windows ではない) が必要です。互換性を確保するため、Docker 内でビルドしてください:
cd <HUMMINGBOT_DIR>
# Build Linux wheel using Docker (Python 3.12 to match hummingbot-api)
docker run --rm -v $(pwd):/hummingbot -w /hummingbot continuumio/miniconda3 bash -c "
apt-get update -qq && apt-get install -y -qq gcc g++ build-essential > /dev/null 2>&1 &&
conda create -n build python=3.12 cython numpy -y -q &&
conda run -n build pip install -q build wheel &&
conda run -n build python -m build --wheel
"
# Verify the Linux wheel was created
ls dist/*linux*.whl
# Example: hummingbot-20260126-cp312-cp312-linux_aarch64.whl
プラットフォーム別 wheel サフィックス:
linux_x86_64— Linux AMD/Intel 64 ビットlinux_aarch64— Linux ARM64 (Apple Silicon Docker、AWS Graviton)macosx_11_0_arm64— macOS Apple Silicon (ネイティブ専用、Docker には不可)macosx_10_9_x86_64— macOS Intel (ネイティブ専用、Docker には不可)
Docker イメージをビルド
cd <HUMMINGBOT_DIR>
docker build -t hummingbot/hummingbot:dev -f Dockerfile .
または make 経由で (先にクリーンも実行):
make build TAG=:dev
hummingbot-api で使用するためのタグ:
docker build -t hummingbot/hummingbot:development -f Dockerfile .
出力の読み方
| 出力 | 意味 |
|---|---|
Successfully built + wheel のパス | wheel が dist/ に準備完了 |
Successfully tagged hummingbot/hummingbot:dev | Docker イメージが準備完了 |
build_ext エラー | Cython コンパイルの問題 — conda 環境が有効か確認 |
| Docker ビルド中の OOM | --memory 4g フラグを追加 |
コマンド: setup-gateway
ソースから Gateway をインストールして設定します。
ステップ 1: 前提条件を確認
Node.js 20+、pnpm、git が必要です。
bash scripts/check_env.sh
ステップ 2: development ブランチをチェックアウト
cd <GATEWAY_DIR>
git fetch origin
git checkout development
git pull origin development
ステップ 3: 依存関係をインストール
cd <GATEWAY_DIR>
pnpm install
macOS で USB HID エラーが表示される場合:
pnpm install --force
ステップ 4: TypeScript をビルド
pnpm build
ステップ 5: セットアップを実行
# Non-interactive with defaults (recommended for dev)
pnpm run setup:with-defaults
# Interactive (choose which configs to update)
pnpm run setup
セットアップにより以下が作成されます:
conf/— チェーン、コネクター、トークン、RPC の設定certs/— TLS 証明書 (開発用の自己署名)
出力の解釈
| 出力 | 意味 | 次のステップ |
|---|---|---|
Gateway setup complete | 開始準備完了 | run-gateway |
tsc エラー | TypeScript のコンパイルエラー | Node のバージョンを確認 (node --version ≥ 20) |
pnpm: command not found | pnpm がインストールされていない | npm install -g pnpm |
ENOSPC | ディスク容量 | 空き容量を確保する |
コマンド: run-gateway
ソースから Gateway を開発モード (HTTP、TLS なし) で実行します。
cd <GATEWAY_DIR>
pnpm start --passphrase=<PASSPHRASE> --dev
デフォルトのパスフレーズは hummingbot-api のセットアップと一致します: hummingbot
pnpm start --passphrase=hummingbot --dev
--dev の動作:
- ポート 15888 で HTTP モード (TLS なし) で実行します
- 詳細ログを有効にします
- Hummingbot API が
http://localhost:15888に自動接続します
実行中であることを確認する:
curl http://localhost:15888/
起動シーケンスのログを確認する:
Gateway listening on port 15888
Solana mainnet-beta initialized
...
カスタム RPC を設定する (レート制限を回避するために推奨):
# After gateway is running, update RPC via API
curl -X POST http://localhost:15888/network/config \
-H "Content-Type: application/json" \
-d '{"chain": "solana", "network": "mainnet-beta", "nodeURL": "https://your-rpc.com"}'
コマンド: build-gateway
ソースから Gateway の Docker イメージをビルドします。
cd <GATEWAY_DIR>
docker build \
--build-arg BRANCH=$(git rev-parse --abbrev-ref HEAD) \
--build-arg COMMIT=$(git rev-parse HEAD) \
--build-arg BUILD_DATE=$(date -u +%Y-%m-%dT%H:%M:%SZ) \
-t hummingbot/gateway:dev \
-f Dockerfile .
hummingbot-api で使用するために development としてタグ付けする:
docker tag hummingbot/gateway:dev hummingbot/gateway:development
イメージを確認する:
docker run --rm hummingbot/gateway:dev node -e "console.log('OK')"
コマンド: setup-api-dev
PyPI パッケージの代わりに ローカルの Hummingbot ソースビルド を使用するように Hummingbot API を設定します。
これにより、Docker イメージを再ビルドすることなく、Hummingbot に変更を加えて API 経由ですぐにテストできます。
ステップ 1: hummingbot-api の conda 環境をインストールする
cd <HUMMINGBOT_API_DIR>
make install
これにより、PyPI 版の hummingbot を含む hummingbot-api conda 環境が作成されます。
ステップ 2: ローカルの Hummingbot を hummingbot-api 環境にインストールする
オプション A — 編集可能インストール (活発な開発に推奨):
conda run -n hummingbot-api pip install -e <HUMMINGBOT_DIR> --no-deps
hummingbot ソースへの変更はすぐに反映されます (再インストールは不要です)。
オプション B — Wheel インストール (特定のビルドをテストする場合):
# First build the wheel
cd <HUMMINGBOT_DIR> && conda run -n hummingbot python setup.py bdist_wheel
# Install into hummingbot-api env
conda run -n hummingbot-api pip install <HUMMINGBOT_DIR>/dist/hummingbot-*.whl --force-reinstall --no-deps
ステップ 3: ローカルバージョンが有効であることを確認する
conda run -n hummingbot-api python -c "import hummingbot; print(hummingbot.__file__)"
site-packages ではなく、<HUMMINGBOT_DIR> 内のパスが表示されるはずです。
ステップ 4: solders をインストールする
conda run -n hummingbot-api pip install "solders>=0.19.0"
出力の解釈
| 出力 | 意味 |
|---|---|
| hummingbot ディレクトリ内のパス | ✅ ローカルソースが有効 |
anaconda3/.../site-packages 内のパス | ❌ 依然として PyPI 版を使用中 |
ImportError: No module named hummingbot | pip install が失敗しました — 再試行してください |
コマンド: run-api-dev
ローカルの Hummingbot を使用して、ホットリロード付きでソースから Hummingbot API を実行します。
ステップ 1: インフラストラクチャを起動する (Docker 経由で postgres + EMQX)
cd <HUMMINGBOT_API_DIR>
docker compose up emqx postgres -d
それらが正常であることを確認します:
docker compose ps
ステップ 2: uvicorn のホットリロードで API を実行する
cd <HUMMINGBOT_API_DIR>
conda run --no-capture-output -n hummingbot-api uvicorn main:app --reload
または make 経由で:
make run
API は http://localhost:8000 で利用できます
Swagger UI は http://localhost:8000/docs にあります
ホットリロードの意味: hummingbot-api 内の *.py ファイルへの変更はすぐに適用されます。hummingbot ソースへの変更 (編集可能インストール) もリロード時に反映されます。
ステップ 3: ローカルの hummingbot が使用されていることを確認する
curl -s http://localhost:8000/health | python3 -m json.tool
起動時に API ログで hummingbot のバージョンを確認してください。
便利な開発コマンド
# Watch logs
conda run -n hummingbot-api uvicorn main:app --reload --log-level debug
# Run on different port
conda run -n hummingbot-api uvicorn main:app --reload --port 8001
# Check what's running
docker compose ps
curl http://localhost:8000/health
コマンド: test-integration
開発スタック全体 — API、Gateway、Hummingbot の接続性 — をスモークテストします。
bash scripts/check_api.sh
bash scripts/check_gateway.sh
python scripts/test_integration.py
テストされる内容
| テスト | 確認内容 |
|---|---|
| API ヘルス | GET /health が 200 を返す |
| API バージョン | hummingbot のソースパス (PyPI ではない) を確認する |
| Gateway ヘルス | ポート 15888 の GET / が 200 を返す |
| API→Gateway | API が Gateway に到達できる (/gateway/status) |
| コネクタ | API 経由で少なくとも 1 つのコネクタが表示される |
| ウォレット | Gateway のウォレット一覧にアクセスできる |
結果の解釈
| 出力 | 意味 | 修正 |
|---|---|---|
✓ API running | API 稼働中 | — |
✓ Gateway running | Gateway 稼働中 | — |
✓ API→Gateway connected | スタック全体が接続済み | — |
✗ API not running | run-api-dev で起動してください | — |
✗ Gateway not running | run-gateway で起動してください | — |
✗ API→Gateway: connection refused | Gateway URL の不一致 | .env の GATEWAY_URL=http://localhost:15888 を確認してください |
✗ Local hummingbot not active | PyPI 版を使用中 | setup-api-dev を実行してください |
Docker ベースの API 開発
Docker コンテナで(ソースコードではなく)テストするには、お使いの hummingbot wheel を使ってカスタムの hummingbot-api イメージをビルドします。
ステップ 1: Docker 用の Linux wheel をビルドする
cd <HUMMINGBOT_DIR>
# Build Linux wheel using Docker (Python 3.12)
docker run --rm -v $(pwd):/hummingbot -w /hummingbot continuumio/miniconda3 bash -c "
apt-get update -qq && apt-get install -y -qq gcc g++ build-essential > /dev/null 2>&1 &&
conda create -n build python=3.12 cython numpy -y -q &&
conda run -n build pip install -q build wheel &&
conda run -n build python -m build --wheel
"
ls dist/*linux*.whl
ステップ 2: hummingbot-api Docker イメージをビルドする
cd <HUMMINGBOT_API_DIR>
# Copy wheel to API directory
cp <HUMMINGBOT_DIR>/dist/hummingbot-*-cp312-*-linux_*.whl .
# Update environment.docker.yml with wheel filename
# Then build using Dockerfile.dev
docker build -f Dockerfile.dev -t hummingbot/hummingbot-api:dev .
ステップ 3: docker-compose.dev.yml でデプロイする
cd <HUMMINGBOT_API_DIR>
docker compose -f docker-compose.dev.yml up -d
ステップ 4: 開発機能を確認する
# Check lp_executor is available (only in development hummingbot)
curl -s -u admin:admin http://localhost:8000/executors/types/available | grep lp_executor
カスタムイメージでボットをデプロイする
API 経由でボットをデプロイする際は、使用する hummingbot Docker イメージを指定します。
開発用イメージでデプロイする
curl -X POST http://localhost:8000/bot-orchestration/deploy-v2-controllers \
-u admin:admin \
-H "Content-Type: application/json" \
-d '{
"instance_name": "my-bot",
"credentials_profile": "master_account",
"controllers_config": ["my_controller.yml"],
"image": "hummingbot/hummingbot:development"
}'
利用可能な hummingbot イメージ
| イメージ | 説明 |
|---|---|
hummingbot/hummingbot:latest | 安定版 PyPI リリース(デフォルト) |
hummingbot/hummingbot:development | Docker Hub の開発ブランチ |
hummingbot/hummingbot:dev | ローカルでビルドしたイメージ |
DEX コネクタには Gateway が必要です
meteora/clmm のようなコネクタでは、Gateway が起動している必要があります:
docker run -d --name gateway -p 15888:15888 \
-e GATEWAY_PASSPHRASE=admin \
hummingbot/gateway:development
クイックリファレンス
完全な開発環境セットアップ(初回)
# 1. Setup repos
cd ~/Documents/hummingbot && git checkout development && git pull
cd ~/.openclaw/workspace/hummingbot-gateway && git checkout development && git pull
# 2. Install hummingbot
cd ~/Documents/hummingbot
sed -i '' '/solders/d' setup/environment.yml
make install
conda run -n hummingbot pip install "solders>=0.19.0"
# 3. Install gateway
cd ~/.openclaw/workspace/hummingbot-gateway
pnpm install && pnpm build && pnpm run setup:with-defaults
# 4. Wire hummingbot-api to local source
cd ~/.openclaw/workspace/hummingbot-api
make install
conda run -n hummingbot-api pip install -e ~/Documents/hummingbot --no-deps
conda run -n hummingbot-api pip install "solders>=0.19.0"
# 5. Start everything
cd ~/.openclaw/workspace/hummingbot-gateway
pnpm start --passphrase=hummingbot --dev &
cd ~/.openclaw/workspace/hummingbot-api
docker compose up emqx postgres -d
make run
Hummingbot の変更をテストする
# 1. Make changes in hummingbot source
# 2. If editable install: just save the file (hot-reload picks it up)
# 3. If wheel install: rebuild and reinstall
cd ~/Documents/hummingbot
conda run -n hummingbot python setup.py bdist_wheel
conda run -n hummingbot-api pip install dist/hummingbot-*.whl --force-reinstall --no-deps
# 4. Restart API
# 5. Run tests
python scripts/test_integration.py
リポジトリのパス(デフォルト)
| コンポーネント | デフォルトパス |
|---|---|
| Hummingbot | ~/Documents/hummingbot |
| Gateway | ~/.openclaw/workspace/hummingbot-gateway |
| Hummingbot API | ~/.openclaw/workspace/hummingbot-api |
環境変数を設定することで上書きできます:
export HUMMINGBOT_DIR=~/code/hummingbot
export GATEWAY_DIR=~/code/gateway
export HUMMINGBOT_API_DIR=~/code/hummingbot-api
スクリプトリファレンス
| スクリプト | 目的 |
|---|---|
check_env.sh | 前提条件(conda、node、pnpm、docker、git)を確認する |
check_repos.sh | 各リポジトリのブランチとビルド状況を表示する |
check_api.sh | Hummingbot API が実行中かどうかを確認する |
check_gateway.sh | Gateway が実行中かどうかを確認する |
test_integration.py | エンドツーエンドのスモークテスト |