安装
| 组件 | 要求 |
|---|---|
| OS | Linux、macOS、Windows |
| Rust | 1.90+ |
| Memory | 4 GB RAM |
| Disk | 2 GB 可用空间 |
| 组件 | 要求 |
|---|---|
| Rust | 1.91(最新) |
| 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.90添加用于构建 components 的 WASM target:
rustup target add wasm32-wasip2安装 GTC CLI
Section titled “安装 GTC CLI”cargo install greentic-cligit clone https://github.com/greenticai/greentic.gitcd greentic/greenticcargo build --release
# Add to PATHexport PATH="$PATH:$(pwd)/target/release"从 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 --version预期输出:
gtc 0.4.xNATS(消息总线)
Section titled “NATS(消息总线)”用于生产部署:
docker run -d --name nats -p 4222:4222 nats:latestbrew install nats-servernats-server从 nats.io 下载
Redis(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:8080Pack Builder
Section titled “Pack Builder”构建 .gtpack 归档:
cargo install greentic-packFlow Validator
Section titled “Flow Validator”校验 flow 定义:
cargo install greentic-flowComponent Authoring
Section titled “Component Authoring”创建 WASM components:
cargo install greentic-component验证你的环境
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错误:“Cannot connect to NATS”
# Start embedded NATS with gtc startgtc start ./my-bundle --nats on错误:“Permission denied”
# On Linux/macOS, ensure binary is executablechmod +x /usr/local/bin/gtc- Quick Start - 创建你的第一个数字员工
- Architecture Overview - 了解平台架构