跳转到内容

安装

组件要求
OSLinux、macOS、Windows
Rust1.90+
Memory4 GB RAM
Disk2 GB 可用空间
组件要求
Rust1.91(最新)
Memory8 GB RAM
CPU多核处理器

如果你还没有安装 Rust:

Terminal window
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

设置正确的 toolchain 版本:

Terminal window
rustup default 1.90

添加用于构建 components 的 WASM target:

Terminal window
rustup target add wasm32-wasip2
Terminal window
cargo install greentic-cli
Terminal window
gtc --version

预期输出:

gtc 0.4.x

用于生产部署:

Terminal window
docker run -d --name nats -p 4222:4222 nats:latest

用于生产环境中的 session 持久化:

Terminal window
docker run -d --name redis -p 6379:6379 redis:alpine

用于基于 webhook 的 providers(Telegram、Slack 等):

Terminal window
# Install
brew install ngrok/ngrok/ngrok # macOS
# or download from https://ngrok.com/download
# Configure
ngrok config add-authtoken YOUR_TOKEN
# Run
ngrok http 8080

构建 .gtpack 归档:

Terminal window
cargo install greentic-pack

校验 flow 定义:

Terminal window
cargo install greentic-flow

创建 WASM components:

Terminal window
cargo install greentic-component

运行以下命令以确认一切正常:

Terminal window
# Check GTC CLI
gtc --help
# Check Rust WASM target
rustup target list --installed | grep wasm32-wasip2
# Create and run a test bundle
gtc wizard --dry-run

错误:“wasm32-wasip2 target not found”

Terminal window
rustup target add wasm32-wasip2

错误:“Cannot connect to NATS”

Terminal window
# Start embedded NATS with gtc start
gtc start ./my-bundle --nats on

错误:“Permission denied”

Terminal window
# On Linux/macOS, ensure binary is executable
chmod +x /usr/local/bin/gtc