重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
npx skills add https://github.com/dojoengine/book --skill dojo-config管理 Dojo 项目配置,包括 Scarb.toml、部署配置文件和世界设置。
管理配置文件:
Scarb.toml - 包清单和依赖项dojo_dev.toml - 本地开发配置文件dojo_<profile>.toml - 其他环境配置文件交互模式:
"更新我的 Dojo 配置"
我会询问:
直接模式:
"将 Origami 库添加到我的依赖项中"
"为 Sepolia 配置生产部署"
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
Dojo 项目使用两种类型的配置文件:
Scarb.toml - 项目清单定义项目依赖项和构建设置:
[package]
cairo-version = "2.12.2"
name = "my-dojo-game"
version = "1.0.0"
edition = "2024_07"
[[target.starknet-contract]]
sierra = true
build-external-contracts = ["dojo::world::world_contract::world"]
[dependencies]
starknet = "2.12.2"
dojo = "1.7.1"
[dev-dependencies]
cairo_test = "2.12.2"
dojo_cairo_test = "1.7.1"
[tool.scarb]
allow-prebuilt-plugins = ["dojo_cairo_macros"]
dojo_<profile>.toml - 配置文件配置特定于配置文件的部署设置。Dojo 默认查找 dojo_dev.toml。
[world]
name = "My Game"
description = "An awesome on-chain game"
seed = "my-unique-seed"
cover_uri = "file://assets/cover.png"
icon_uri = "file://assets/icon.png"
[env]
rpc_url = "http://localhost:5050/"
account_address = "0x127fd..."
private_key = "0xc5b2f..."
[namespace]
default = "my_game"
[writers]
"my_game" = ["my_game-actions"]
[owners]
"my_game" = ["my_game-admin"]
Dojo 使用配置文件来管理不同的环境:
# 使用默认的 'dev' 配置文件 (dojo_dev.toml)
sozo build
sozo migrate
# 使用特定配置文件 (dojo_mainnet.toml)
sozo build --profile mainnet
sozo migrate --profile mainnet
配置文件命名规则: dojo_<profile>.toml
dojo_dev.toml - 开发环境(默认)dojo_staging.toml - 预发布环境dojo_mainnet.toml - 生产环境[world]
name = "My Game" # 人类可读的名称
description = "A provable game" # 描述
seed = "my-unique-seed" # 地址生成的唯一种子
cover_uri = "ipfs://Qm..." # 封面图片 (ipfs:// 或 file://)
icon_uri = "ipfs://Qm..." # 图标图片
[world.socials]
x = "https://x.com/mygame"
discord = "https://discord.gg/mygame"
[env]
rpc_url = "http://localhost:5050/"
account_address = "0x127fd..."
private_key = "0xc5b2f..."
# 或者在生产环境中使用密钥库:
# keystore_path = "/path/to/keystore"
world_address = "0x077c0..." # 首次部署后设置
命名空间用于组织你的资源:
[namespace]
default = "my_game" # 所有资源的默认命名空间
# 可选:将特定资源映射到命名空间
mappings = { "weapons" = ["Sword", "Bow"], "characters" = ["Player", "Enemy"] }
资源会被标记为 <命名空间>-<资源名称>。
在部署时设置初始权限:
[writers]
# 命名空间级别:actions 可以写入 my_game 中的所有资源
"my_game" = ["my_game-actions"]
# 资源特定:movement 只能写入 Position
"my_game-Position" = ["my_game-movement"]
[owners]
# 命名空间所有权
"my_game" = ["my_game-admin"]
[dependencies]
starknet = "2.12.2"
dojo = "1.7.1"
[dev-dependencies]
cairo_test = "2.12.2"
dojo_cairo_test = "1.7.1"
Origami(游戏实用工具):
[dependencies]
origami_token = { git = "https://github.com/dojoengine/origami", tag = "v1.0.0" }
Alexandria(数学实用工具):
[dependencies]
alexandria_math = { git = "https://github.com/keep-starknet-strange/alexandria" }
当使用带有模型的外部库时:
[[target.starknet-contract]]
build-external-contracts = [
"dojo::world::world_contract::world",
"armory::models::m_Flatbow", # 格式:<crate>::<path>::m_<ModelName>
]
[world]
name = "My Game (Dev)"
seed = "dev-my-game"
[env]
rpc_url = "http://localhost:5050/"
account_address = "0x127fd..."
private_key = "0xc5b2f..."
[namespace]
default = "dev"
[writers]
"dev" = ["dev-actions"]
[world]
name = "My Game"
seed = "prod-my-game"
description = "Production deployment"
cover_uri = "ipfs://YourCoverHash"
icon_uri = "ipfs://YourIconHash"
[env]
rpc_url = "https://api.cartridge.gg/x/starknet/mainnet"
account_address = "0x..."
keystore_path = "~/.starknet_accounts/mainnet.json"
[namespace]
default = "game"
[writers]
"game" = ["game-actions"]
[owners]
"game" = ["game-admin"]
切勿提交私钥。 使用 .gitignore:
# 忽略敏感配置
dojo_mainnet.toml
dojo_*_secrets.toml
# 保留开发配置
!dojo_dev.toml
在生产环境中使用密钥库:
[env]
keystore_path = "~/.starknet_accounts/mainnet.json"
# 而不是:private_key = "0x..."
"配置文件未找到":
dojo_<profile>.toml 存在于项目根目录--profile 标志匹配"世界未找到":
[env] 中设置 world_address"账户未找到":
配置完成后:
dojo-deploy 技能根据你的配置进行部署dojo-migrate 技能dojo-world 技能管理运行时权限每周安装次数
58
代码仓库
GitHub 星标数
53
首次出现时间
2026年1月30日
安全审计
已安装于
opencode55
codex54
kimi-cli53
gemini-cli53
cursor53
github-copilot52
Manage Dojo project configuration including Scarb.toml, deployment profiles, and world settings.
Manages configuration files:
Scarb.toml - Package manifest and dependenciesdojo_dev.toml - Local development profiledojo_<profile>.toml - Other environment profilesInteractive mode:
"Update my Dojo configuration"
I'll ask about:
Direct mode:
"Add the Origami library to my dependencies"
"Configure production deployment for Sepolia"
Dojo projects use two types of configuration files:
Scarb.toml - Project ManifestDefines project dependencies and build settings:
[package]
cairo-version = "2.12.2"
name = "my-dojo-game"
version = "1.0.0"
edition = "2024_07"
[[target.starknet-contract]]
sierra = true
build-external-contracts = ["dojo::world::world_contract::world"]
[dependencies]
starknet = "2.12.2"
dojo = "1.7.1"
[dev-dependencies]
cairo_test = "2.12.2"
dojo_cairo_test = "1.7.1"
[tool.scarb]
allow-prebuilt-plugins = ["dojo_cairo_macros"]
dojo_<profile>.toml - Profile ConfigurationProfile-specific deployment settings. Dojo looks for dojo_dev.toml by default.
[world]
name = "My Game"
description = "An awesome on-chain game"
seed = "my-unique-seed"
cover_uri = "file://assets/cover.png"
icon_uri = "file://assets/icon.png"
[env]
rpc_url = "http://localhost:5050/"
account_address = "0x127fd..."
private_key = "0xc5b2f..."
[namespace]
default = "my_game"
[writers]
"my_game" = ["my_game-actions"]
[owners]
"my_game" = ["my_game-admin"]
Dojo uses profiles to manage different environments:
# Use default 'dev' profile (dojo_dev.toml)
sozo build
sozo migrate
# Use specific profile (dojo_mainnet.toml)
sozo build --profile mainnet
sozo migrate --profile mainnet
Profile file naming: dojo_<profile>.toml
dojo_dev.toml - Development (default)dojo_staging.toml - Stagingdojo_mainnet.toml - Production[world]
name = "My Game" # Human-readable name
description = "A provable game" # Description
seed = "my-unique-seed" # Unique seed for address generation
cover_uri = "ipfs://Qm..." # Cover image (ipfs:// or file://)
icon_uri = "ipfs://Qm..." # Icon image
[world.socials]
x = "https://x.com/mygame"
discord = "https://discord.gg/mygame"
[env]
rpc_url = "http://localhost:5050/"
account_address = "0x127fd..."
private_key = "0xc5b2f..."
# Or use keystore for production:
# keystore_path = "/path/to/keystore"
world_address = "0x077c0..." # Set after first deployment
Namespaces organize your resources:
[namespace]
default = "my_game" # Default namespace for all resources
# Optional: Map specific resources to namespaces
mappings = { "weapons" = ["Sword", "Bow"], "characters" = ["Player", "Enemy"] }
Resources get tagged as <namespace>-<resource_name>.
Set up initial permissions at deployment time:
[writers]
# Namespace-level: actions can write to all resources in my_game
"my_game" = ["my_game-actions"]
# Resource-specific: movement can only write to Position
"my_game-Position" = ["my_game-movement"]
[owners]
# Namespace ownership
"my_game" = ["my_game-admin"]
[dependencies]
starknet = "2.12.2"
dojo = "1.7.1"
[dev-dependencies]
cairo_test = "2.12.2"
dojo_cairo_test = "1.7.1"
Origami (game utilities):
[dependencies]
origami_token = { git = "https://github.com/dojoengine/origami", tag = "v1.0.0" }
Alexandria (math utilities):
[dependencies]
alexandria_math = { git = "https://github.com/keep-starknet-strange/alexandria" }
When using external libraries with models:
[[target.starknet-contract]]
build-external-contracts = [
"dojo::world::world_contract::world",
"armory::models::m_Flatbow", # Format: <crate>::<path>::m_<ModelName>
]
[world]
name = "My Game (Dev)"
seed = "dev-my-game"
[env]
rpc_url = "http://localhost:5050/"
account_address = "0x127fd..."
private_key = "0xc5b2f..."
[namespace]
default = "dev"
[writers]
"dev" = ["dev-actions"]
[world]
name = "My Game"
seed = "prod-my-game"
description = "Production deployment"
cover_uri = "ipfs://YourCoverHash"
icon_uri = "ipfs://YourIconHash"
[env]
rpc_url = "https://api.cartridge.gg/x/starknet/mainnet"
account_address = "0x..."
keystore_path = "~/.starknet_accounts/mainnet.json"
[namespace]
default = "game"
[writers]
"game" = ["game-actions"]
[owners]
"game" = ["game-admin"]
Never commit private keys. Use .gitignore:
# Ignore sensitive configs
dojo_mainnet.toml
dojo_*_secrets.toml
# Keep development config
!dojo_dev.toml
Use keystore for production:
[env]
keystore_path = "~/.starknet_accounts/mainnet.json"
# Instead of: private_key = "0x..."
"Profile not found":
dojo_<profile>.toml exists in project root--profile flag"World not found":
world_address in [env] after first deployment"Account not found":
After configuration:
dojo-deploy skill to deploy with your configdojo-migrate skill when updating deploymentsdojo-world skill to manage runtime permissionsWeekly Installs
58
Repository
GitHub Stars
53
First Seen
Jan 30, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykFail
Installed on
opencode55
codex54
kimi-cli53
gemini-cli53
cursor53
github-copilot52
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
123,700 周安装