xiaohongshu
xiaohongshu
dojo-integration-test
Use this skill when the user asks to "test dojo contracts", "run integration tests", "start dojo stack", "test with torii", "verify contract behavior", mentions integration testing for Dojo/Cairo contracts, or needs to set up local katana/torii infrastructure.
Full skill instructions
This skill sets up a complete local Dojo development stack and enables integration testing of smart contracts.
Before running this skill, you MUST know the contract location on local disk:
./worlds/dojo-starter)This path should contain:
Scarb.toml - Cairo project configurationsrc/ - Cairo source filesdojo_dev.toml - Dojo development configurationBefore starting, verify the following:
Required asdf plugins: sozo, katana, torii, scarb
asdf current sozo && asdf current katana && asdf current torii && asdf current scarb
Project files:
.tool-versions - defines tool versionsScarb.toml - Cairo project configurationdojo_dev.toml - Dojo development configurationAvailable ports:
Check with: lsof -i :5050 -i :8080 -i :50051
Extract contract information from manifest and config files:
# Get world address (after migration)
jq -r '.world.address' manifest_dev.json
# List all contracts
jq -r '.contracts[].tag' manifest_dev.json
# List all models
jq -r '.models[].tag' manifest_dev.json
# Get RPC URL from dojo_dev.toml
grep rpc_url dojo_dev.toml
katana --dev --dev.no-fee &
Wait for: curl -s localhost:5050 | jq .
sozo build && sozo migrate
Extract world address after migration:
WORLD_ADDRESS=$(jq -r '.world.address' manifest_dev.json)
echo "World address: $WORLD_ADDRESS"
Default mode (asdf-installed torii):
torii --world $WORLD_ADDRESS --http.cors_origins "*" &
From source mode (when user requests "build from source", "use source", or "compile torii"):
Ask the user for the torii source directory path, then run:
cd <TORII_SOURCE_PATH> && cargo run --release --bin torii -- --world $WORLD_ADDRESS --http.cors_origins "*" &
Wait for health check: curl -s localhost:8080/health
Before executing contract functions, you need to discover available contracts, their functions, and understand the calldata format.
# List all deployed contracts
jq -r '.contracts[].tag' manifest_dev.json
# Get detailed contract info including systems/functions
jq '.contracts[] | {tag, systems}' manifest_dev.json
# List all functions for a specific contract
jq '.contracts[] | select(.tag == "dojo_starter-actions") | .systems' manifest_dev.json
To understand function parameters, read the Cairo source files:
# Find system implementations
ls src/systems/
# Read the actions contract to see function signatures
cat src/systems/actions.cairo
Example: In actions.cairo, you might find:
fn spawn(ref self: ContractState) { ... }
fn move(ref self: ContractState, direction: Direction) { ... }
For enum types like Direction, check the models file:
# Read model definitions
cat src/models.cairo
Example Direction enum:
#[derive(Copy, Drop, Serde, PartialEq, Introspect)]
pub enum Direction {
None, // 0
Left, // 1
Right, // 2
Up, // 3
Down, // 4
}
# Format: sozo execute <namespace>-<contract> <function> [calldata...]
# No arguments
sozo execute dojo_starter-actions spawn
# With enum argument (use numeric value)
sozo execute dojo_starter-actions move -c 1 # Direction::Left
sozo execute dojo_starter-actions move -c 3 # Direction::Up
# With multiple arguments
sozo execute dojo_starter-actions some_func -c 0x123,42,1
sozo inspect
curl -X POST http://localhost:8080/graphql \
-H "Content-Type: application/json" \
-d '{"query": "{ dojoStarterMovesModels { edges { node { player remaining } } } }"}'
grpcurl -plaintext \
-d '{"clause":{"keys":{"keys":[],"pattern_matching":1,"models":["dojo_starter-Position"]}}}' \
localhost:50051 world.World/SubscribeEntities
| Service | Command | Expected |
|---|---|---|
| Katana | curl -s localhost:5050 | JSON-RPC response |
| Torii HTTP | curl -s localhost:8080/health | 200 OK |
| Torii gRPC | grpcurl -plaintext localhost:50051 list | Service list |
After executing a contract function, verify state changes:
# Execute spawn
sozo execute dojo_starter-actions spawn
# Check Position model via GraphQL
curl -X POST http://localhost:8080/graphql \
-H "Content-Type: application/json" \
-d '{"query": "{ dojoStarterPositionModels { edges { node { player vec { x y } } } } }"}'
# Kill katana
pkill -f "katana"
# Kill torii
pkill -f "torii"
rm -rf torii.db* katana.db*
Complete workflow for testing:
# 1. Check prerequisites
asdf current sozo katana torii scarb
# 2. Start katana
katana --dev --dev.no-fee &
sleep 2
# 3. Build and migrate
sozo build && sozo migrate
# 4. Extract world address
WORLD_ADDRESS=$(jq -r '.world.address' manifest_dev.json)
# 5. Start torii
torii --world $WORLD_ADDRESS --http.cors_origins "*" &
sleep 3
# 6. Verify services
curl -s localhost:5050 > /dev/null && echo "Katana: OK"
curl -s localhost:8080/health > /dev/null && echo "Torii: OK"
# 7. Execute test transaction
sozo execute dojo_starter-actions spawn
# 8. Verify state change
curl -s -X POST http://localhost:8080/graphql \
-H "Content-Type: application/json" \
-d '{"query": "{ dojoStarterPositionModels { edges { node { player vec { x y } } } } }"}'
# Find process using port
lsof -i :5050
lsof -i :8080
# Kill by PID
kill -9 <PID>
# Clean build artifacts
sozo clean
sozo build
sozo migrate
Ensure world address matches:
# Verify world address in manifest
jq -r '.world.address' manifest_dev.json
# Restart torii with correct address
pkill -f torii
torii --world $(jq -r '.world.address' manifest_dev.json) --http.cors_origins "*" &
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience