安装
| 组件 | 要求 |
|---|---|
| OS | Linux、macOS、Windows |
| Rust | 1.95+ |
| Memory | 4 GB RAM |
| Disk | 2 GB 可用空间 |
| 组件 | 要求 |
|---|---|
| Rust | 1.95+(最新支持版本) |
| Memory | 8 GB RAM |
| CPU | 多核处理器 |
安装 Rust
Section titled “安装 Rust”如果你还没有安装 Rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh设置正确的 toolchain 版本:
rustup default 1.95添加用于构建 components 的 WASM target:
rustup target add wasm32-wasip2安装 GTC CLI
Section titled “安装 GTC CLI”先安装 gtc router,然后让 gtc install 安装 Greentic companion tools。正常使用时不要直接安装 greentic-cli 或单独的 companion crates;gtc install 会让 delegated binaries 与 router 保持一致。
cargo install cargo-binstallcargo binstall gtcgtc installgtc doctorgit clone https://github.com/greenticai/greentic.gitcd greentic/greenticcargo build --release
# Add to PATHexport PATH="$PATH:$(pwd)/target/release"gtc installgtc doctor从 GitHub Releases 下载:
# macOS (Apple Silicon)curl -LO https://github.com/greenticai/greentic/releases/latest/download/gtc-darwin-arm64.tar.gztar -xzf gtc-darwin-arm64.tar.gzsudo mv gtc /usr/local/bin/
# macOS (Intel)curl -LO https://github.com/greenticai/greentic/releases/latest/download/gtc-darwin-x64.tar.gz
# Linux (x86_64)curl -LO https://github.com/greenticai/greentic/releases/latest/download/gtc-linux-x64.tar.gz
# Windows# Download gtc-windows-x64.zip from releasesgtc --versiongtc doctorRedis(Session 存储)
Section titled “Redis(Session 存储)”用于生产环境中的 session 持久化:
docker run -d --name redis -p 6379:6379 redis:alpinebrew install redisredis-serverNgrok/Cloudflared(公共 URL)
Section titled “Ngrok/Cloudflared(公共 URL)”用于基于 webhook 的 providers(Telegram、Slack 等):
# Installbrew install ngrok/ngrok/ngrok # macOS# or download from https://ngrok.com/download
# Configurengrok config add-authtoken YOUR_TOKEN
# Runngrok http 8080# Installbrew install cloudflared # macOS# or download from https://developers.cloudflare.com/cloudflare-one/connections/connect-apps/install-and-setup/
# Runcloudflared tunnel --url http://localhost:8080Greentic Toolchain
Section titled “Greentic Toolchain”安装或更新 gtc router 使用的 delegated Greentic binaries:
gtc install使用 gtc install --dry-run 预览安装计划。对于受控环境,可以固定 toolchain:
gtc install --release 1.0.15gtc install --manifest ./greentic-toolchain.jsonComponent Authoring
Section titled “Component Authoring”gtc install 会安装标准 companion tools。对于独立 component development,也可以安装 cargo-component:
cargo binstall cargo-component然后使用 delegated component surface:
gtc dev component --help验证你的环境
Section titled “验证你的环境”运行以下命令以确认一切正常:
# Check GTC CLIgtc --help
# Check Rust WASM targetrustup target list --installed | grep wasm32-wasip2
# Create and run a test bundlegtc wizard --dry-run错误:“wasm32-wasip2 target not found”
rustup target add wasm32-wasip2错误:“Permission denied”
# On Linux/macOS, ensure binary is executablechmod +x /usr/local/bin/gtc- Quick Start - 创建你的第一个数字员工
- Architecture Overview - 了解平台架构