tari-rust/build.bat

69 lines
1.4 KiB
Batchfile
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@echo off
REM GBT构建脚本 (Windows版本)
REM 用于编译GBT客户端
echo === Tari GBT客户端构建脚本 ===
echo.
REM 检查Rust环境
where cargo >nul 2>nul
if %errorlevel% neq 0 (
echo 错误: 未找到cargo请先安装Rust
echo 访问 https://rustup.rs/ 安装Rust
pause
exit /b 1
)
echo ✓ Rust环境检查通过
for /f "tokens=2" %%i in ('cargo --version') do echo Rust版本: %%i
echo.
echo 检查依赖项...
REM 检查ZMQ (Windows下通常通过vcpkg安装)
where zmq >nul 2>nul
if %errorlevel% neq 0 (
echo 警告: 未找到ZMQ可能需要安装
echo 建议使用vcpkg安装: vcpkg install zeromq
echo.
echo 继续构建但可能遇到ZMQ相关错误...
)
echo ✓ 依赖检查完成
REM 清理旧的构建
echo.
echo 清理旧的构建文件...
cargo clean
REM 构建
echo.
echo 开始构建GBT客户端...
echo 构建模式: release
echo.
cargo build --release
if %errorlevel% equ 0 (
echo.
echo ✓ 构建成功!
echo.
echo 可执行文件位置: target\release\gbt.exe
echo.
echo 使用方法:
echo target\release\gbt.exe --help
echo.
echo 示例:
echo target\release\gbt.exe --base-node 127.0.0.1:18102 --base-node-http 127.0.0.1:9000
echo.
echo 测试ZMQ通信:
echo python test_gbt.py
) else (
echo.
echo ✗ 构建失败!
echo 请检查错误信息并修复问题
pause
exit /b 1
)
pause