Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/pages/brand.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,9 @@ When using Dojo brand assets:
- **Do** maintain clear space around logos equal to the height of the icon
- **Do** use appropriate contrast for backgrounds
- **Do** maintain original aspect ratios
- **Don't** modify colors or proportions
- **Don't** add effects, shadows, or distortions
- **Don't** combine with other brand elements
- **Do not** modify colors or proportions
- **Do not** add effects, shadows, or distortions
- **Do not** combine with other brand elements

### Typography

Expand Down
6 changes: 3 additions & 3 deletions docs/pages/client/sdk/bevy.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Built specifically for Bevy's ECS architecture, it seamlessly integrates with Be

## Core Concepts

Before diving into building onchain games with Bevy, let's explore the essential components of the Dojo.bevy architecture:
Before diving into building onchain games with Bevy, let us explore the essential components of the Dojo.bevy architecture:

### `DojoPlugin`

Expand Down Expand Up @@ -245,7 +245,7 @@ fn handle_player_actions(

## Example Game

Here's a pedagogical example showing the key concepts for a 3D game where players can spawn and move cubes:
Here is a pedagogical example showing the key concepts for a 3D game where players can spawn and move cubes:

```rust
use bevy::prelude::*;
Expand Down Expand Up @@ -325,7 +325,7 @@ For a complete implementation including 3D rendering, entity tracking, and full

### Account Management

For production applications, you'll want to use custom accounts instead of predeployed ones:
For production applications, you will want to use custom accounts instead of predeployed ones:

```rust
fn setup_custom_account(
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/client/sdk/c/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ const client = await new ToriiClient(config);
```

dojo.c provides everything you need for Dojo game development in one comprehensive package.
Whether you're building Unity games, web applications, or custom integrations, it delivers consistent, reliable blockchain interaction with the convenience of an integrated Torii client, account management, and Starknet provider.
Whether you are building Unity games, web applications, or custom integrations, it delivers consistent, reliable blockchain interaction with the convenience of an integrated Torii client, account management, and Starknet provider.

## Next Steps

Expand Down
8 changes: 4 additions & 4 deletions docs/pages/client/sdk/javascript.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ It streamlines data fetching and subscriptions, supporting both simple and compl
- **Optimistic Client Rendering**: Update state before a transaction has finalized.

:::note
dojo.js is a wrapper around [dojo.c](/client/sdk/c/wasm-bindings) that exposes Torii client features via WASM.
Dojo.js is a wrapper around [dojo.c](/client/sdk/c/wasm-bindings) that exposes Torii client features via WASM.
For more information about the Torii gRPC client, check out [this documentation](/toolchain/torii/grpc).
:::

Expand Down Expand Up @@ -232,7 +232,7 @@ const entities = await sdk.getEntities({
```

:::note
When you use AND with different model types, you're looking for **entities that have both components**.
When you use AND with different model types, you are looking for **entities that have both components**.
:::

For large datasets, use pagination and ordering:
Expand Down Expand Up @@ -387,7 +387,7 @@ This can be used to implement things like **chat systems, leaderboards, social f

The key benefit: **Players authenticate the data** (proving it came from them) **without gas fees**, while Torii broadcasts it to all connected clients in real-time.

Here's an example of how to send a signed message:
Here is an example of how to send a signed message:

```typescript
// Generate typed data for a chat message model
Expand All @@ -412,7 +412,7 @@ try {
```

:::note
If you want messages to be broadcast to all of your Torii client instances, you'll have to pass a `relayUrl` to `init`.
If you want messages to be broadcast to all of your Torii client instances, you will have to pass a `relayUrl` to `init`.
`relayUrl` is a _multiaddr_ format which looks like something like this when deployed on slot:
`/dns4/api.cartridge.gg/tcp/443/x-parity-wss/%2Fx%2Fyour-slot-deployment-name%2Ftorii%2Fwss`
:::
Expand Down
12 changes: 6 additions & 6 deletions docs/pages/client/sdk/rust.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description: "Native Rust integration for building Dojo applications with Rust"
# Dojo Rust SDK

Dojo is built in Rust, making it seamless to integrate into your Rust projects.
Simply import the required crates and you're ready to build powerful applications that interact with Dojo worlds.
Simply import the required crates and you are ready to build powerful applications that interact with Dojo worlds.

The Dojo Rust SDK provides access to the core framework functionality, built on the same [dojo.c foundation](/client/sdk/c) that powers other language bindings.

Expand Down Expand Up @@ -58,7 +58,7 @@ use torii_client::client::Client;
use starknet_crypto::Felt;

// The #[tokio::main] attribute makes this function run in an async runtime
// This is required because we'll be making network calls
// This is required because we will be making network calls
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Configure connection URLs for your Dojo world
Expand Down Expand Up @@ -219,21 +219,21 @@ pub struct Data {}
#[poise::command(slash_command)]
pub async fn hello(ctx: Context<'_>) -> Result<(), Error> {
// ctx.say() sends a message back to Discord in response to the command
ctx.say("🤖 Hello! I'm your Dojo Discord Bot - monitoring world events and ready to help!").await?;
ctx.say("🤖 Hello! I am your Dojo Discord Bot - monitoring world events and ready to help!").await?;
Ok(())
}

#[poise::command(slash_command)]
pub async fn world_status(ctx: Context<'_>) -> Result<(), Error> {
ctx.say("🌍 Connected to Dojo World! I'm watching for all the exciting things happening in your autonomous world.").await?;
ctx.say("🌍 Connected to Dojo World! I am watching for all the exciting things happening in your autonomous world.").await?;
Ok(())
}

// Configuration structure to hold all the connection details
// This keeps our configuration organized and type-safe
struct Config {
discord_token: String, // Discord bot authentication token
channel_id: NonZero<u64>, // Discord channel ID (NonZero ensures it's never 0)
channel_id: NonZero<u64>, // Discord channel ID (NonZero ensures it is never 0)
torii_url: String, // URL to connect to Torii indexer
node_url: String, // URL to connect to Starknet node (Katana)
torii_relay_url: String, // URL for P2P relay connection
Expand Down Expand Up @@ -392,7 +392,7 @@ async fn subscribe(client: torii_client::client::Client, config: Config) {
}
// If we get here, the stream ended (connection lost)
}
// Failed to connect - we'll retry
// Failed to connect - we will retry
Err(_) => {
println!("Subscription was lost, attempting to reconnect");
tries += 1;
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/client/sdk/telegram.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description: "Complete guide for building Telegram Mini Apps with Dojo and Cartr

# Dojo Telegram Integration

Build fully on-chain games and applications that run seamlessly within Telegram using Dojo and the [Cartridge Controller](https://docs.cartridge.gg/controller/overview).
Build fully onchain games and applications that run seamlessly within Telegram using Dojo and the [Cartridge Controller](https://docs.cartridge.gg/controller/overview).

Telegram [Mini Apps](https://core.telegram.org/bots/webapps) are web applications that run directly inside Telegram, providing users with rich, interactive experiences directly inside the messaging platform.

Expand Down
28 changes: 14 additions & 14 deletions docs/pages/client/sdk/unity.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ Unity is one of the world's most popular cross-platform game engines, powering m
With its intuitive visual editor, robust scripting capabilities in C#, and extensive asset ecosystem, Unity enables developers to create everything from simple 2D indies to complex 3D AAA titles.

Dojo.unity is the official Unity Engine SDK for interacting with Dojo worlds to develop web and desktop 2D and 3D games.
Whether you're creating a tactical RPG, a real-time strategy game, or an immersive 3D world, dojo.unity provides the tools you need to bring your onchain game vision to life.
Whether you are creating a tactical RPG, a real-time strategy game, or an immersive 3D world, Dojo.unity provides the tools you need to bring your onchain game vision to life.

## Core Concepts

Before diving into the exciting world of onchain games and worlds with Unity, let's explore some essential concepts:
Before diving into the exciting world of onchain games and worlds with Unity, let us explore some essential concepts:

### World Manager

Expand Down Expand Up @@ -58,21 +58,21 @@ You can learn more about Sozo's binding generation features [here](/toolchain/so

## Getting Started

To get started with the dojo.unity SDK, follow these steps:
To get started with the Dojo.unity SDK, follow these steps:

::::steps

#### Prerequisites

Before getting started, ensure you have [Unity](https://unity.com/download) `>= 2022.3.15f1` installed.

#### Download dojo.unity
#### Download Dojo.unity

Visit the [dojo.unity release page](https://github.com/dojoengine/dojo.unity/releases) and download the latest version of `dojo.unitypackage`.
Visit the [Dojo.unity release page](https://github.com/dojoengine/dojo.unity/releases) and download the latest version of `dojo.unitypackage`.

#### Open or create a Unity project

Launch Unity and either create a new project or open an existing one where you intend to integrate dojo.unity
Launch Unity and either create a new project or open an existing one where you intend to integrate Dojo.unity

#### Import `dojo.unitypackage`

Expand Down Expand Up @@ -139,7 +139,7 @@ Drag the desired `ScriptableObject` (either the default one or your custom confi

#### Adding model bindings

1. Generate model bindings: If you haven't already created your model bindings, please refer to the [bindgen section](/toolchain/sozo/binding-generation#unity) for instructions.
1. Generate model bindings: If you have not already created your model bindings, please refer to the [bindgen section](/toolchain/sozo/binding-generation#unity) for instructions.

2. Import model bindings: Locate the `bindings/client/unity/Models` folder within your Dojo project, and drag the desired `model` files from this folder into your Unity project.
The [Synchronization Master](#synchronization-master) will automatically detect and load these models for seamless data exchange.
Expand Down Expand Up @@ -208,7 +208,7 @@ To do this, we must first teach our Unity project about our Dojo contracts using

Sozo's [bindgen](/toolchain/sozo/binding-generation#unity) generates bindings for contracts, which must be transferred into your Unity project.

Let's consider a practical example: a `PlayerActions` contract that handles player creation in an RPG game.
Let us consider a practical example: a `PlayerActions` contract that handles player creation in an RPG game.
This system allows players to create their character by choosing a name and selecting their gender, then stores this information onchain as part of the game state.

```rust
Expand Down Expand Up @@ -279,7 +279,7 @@ public class PlayerActions : MonoBehaviour {
}
```

Let's break down the concepts:
Let us break down the concepts:

- `public string contractAddress;`: The contract address of the `PlayerActions` system, obtained as output from `sozo migrate`.
- `new dojo.Call{ ... }`: Creates a new call, where the `selector` is the name of the system function ("create"), and `calldata` contains the serialized parameters (player name and gender ID).
Expand Down Expand Up @@ -369,7 +369,7 @@ Here are the steps to address it:
- Under `Resolution and Presentation`, ensure the `Dojo` Template is selected.
- If the Dojo template is missing, proceed to `step 2`.

2. **Download WebGL Templates Folder**: If the Dojo template is unavailable in Player Settings, it's likely missing from your project.
2. **Download WebGL Templates Folder**: If the Dojo template is unavailable in Player Settings, it is likely missing from your project.

- Navigate to the [Dojo Unity repository](https://github.com/dojoengine/dojo.unity)
- Download the `WebGL templates` folder.
Expand Down Expand Up @@ -436,21 +436,21 @@ The solution is to navigate to the `src` directory within your Dojo project and

## Example Project

This section provides a walkthrough for running the example from the dojo.unity repository using the `Dojo Starter` repository.
This section provides a walkthrough for running the example from the Dojo.unity repository using the `Dojo Starter` repository.

[![dojo.unity demo](https://markdown-videos-api.jorgenkh.no/url?url=https%3A%2F%2Fyoutu.be%2F25ocgPsHs4w)](https://youtu.be/25ocgPsHs4w)
[![Dojo.unity demo](https://markdown-videos-api.jorgenkh.no/url?url=https%3A%2F%2Fyoutu.be%2F25ocgPsHs4w)](https://youtu.be/25ocgPsHs4w)

:::steps

#### Prerequisites

Clone the [dojo.unity](https://github.com/dojoengine/dojo.unity) and [Dojo Starter](https://github.com/dojoengine/dojo-starter) repositories.
Clone the [Dojo.unity](https://github.com/dojoengine/dojo.unity) and [Dojo Starter](https://github.com/dojoengine/dojo-starter) repositories.

#### Setting up Dojo Starter

Follow the steps outlined in the [Dojo Starter setup guide](/tutorials/dojo-starter) to deploy your Dojo project locally: 1) launch Katana, 2) build with Sozo, and 3) launch Torii.

#### Setting up dojo.unity
#### Setting up Dojo.unity

1. Open the scene: In the `Project tab`, navigate to `Assets/Spawn And Move/Scenes/Sample scene`
2. Adjusting Scriptable Objects:
Expand Down
10 changes: 6 additions & 4 deletions docs/pages/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ Clients (like web browsers) do not exist on the chain but exist purely to intera
### What is a provable game?

Thanks to the magic of zero-knowledge proofs, we can ensure a game is fair by verifying a zk proof created off-chain.
But what does that entail? Consider a game of chess.
But what does that entail?
Consider a game of chess.
We aim for an experience where players trust each other's moves.
In a straightforward approach — and given the simple rules of chess — if this were in a blockchain environment, every move would be a transaction on the blockchain.
This is costly.
Expand All @@ -28,7 +29,7 @@ This constitutes a provable game.
### What is an autonomous world?

An autonomous world is one that exists entirely onchain.
It's not controlled by any single entity but is instead governed by the rules set within that world.
It is not controlled by any single entity but is instead governed by the rules set within that world.
[Dive deeper into the topic here](/theory/autonomous-worlds).

## Dojo Development
Expand All @@ -41,12 +42,13 @@ It standardizes the process of building such games and provides a suite of tools
### What is Cairo?

Cairo is an open-source programming language invented by StarkWare.
It's a Turing-complete low-level language designed to compile to the Cairo Virtual Machine.
It is a Turing-complete low-level language designed to compile to the Cairo Virtual Machine.
Learn more about it here: [Cairo](https://www.cairo-lang.org/).

### Can I deploy Dojo to Starknet?

Yes! Dojo can run on any StarknetVM including the public blockchains.
Yes!
Dojo can run on any StarknetVM including the public blockchains.
Within the dojo toolchain exists [Katana](/toolchain/katana) which is a gaming specific sequencer, which is perfectly suited to Dojo games.

### Can Dojo do client side proofs?
Expand Down
4 changes: 2 additions & 2 deletions docs/pages/framework/configuration/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ Each section controls a different aspect of your Dojo world.
```toml
[world]
name = "My Dojo Game"
description = "An awesome on-chain game built with Dojo"
description = "An awesome onchain game built with Dojo"
seed = "my-unique-seed"
cover_uri = "file://assets/cover.png"
icon_uri = "file://assets/icon.png"
Expand Down Expand Up @@ -358,7 +358,7 @@ icon_uri = "ipfs://YourIconHash"
website = "https://mygame.com"

[env]
rpc_url = "https://api.cartridge.gg/x/prod-my-game/katana"
rpc_url = "https://api.Cartridge.gg/x/prod-my-game/katana"
account_address = "0x127fd..."
keystore_path = "~/.starknet_accounts/mainnet.json"

Expand Down
15 changes: 10 additions & 5 deletions docs/pages/framework/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ import { LinkCard } from "../../components/LinkCard";
# Dojo Framework Overview

:::note
Dojo is built on top of Cairo. We suggest [familiarizing yourself with Cairo](https://book.cairo-lang.org/) before using Dojo.
Dojo is built on top of Cairo.
We suggest [familiarizing yourself with Cairo](https://book.cairo-lang.org/) before using Dojo.
:::

## What is Dojo?

Dojo is a comprehensive framework for building provable games and autonomous worlds on Starknet. It combines the power of Cairo smart contracts with Entity-Component-System (ECS) architecture to create scalable, composable onchain applications.
Dojo is a comprehensive framework for building provable games and autonomous worlds on Starknet.
It combines the power of Cairo smart contracts with Entity-Component-System (ECS) architecture to create scalable, composable onchain applications.

**Key Benefits:**

Expand All @@ -29,7 +31,8 @@ Dojo is a comprehensive framework for building provable games and autonomous wor
[Entity-Component-System](https://en.wikipedia.org/wiki/Entity_component_system) (ECS) is a design pattern that separates data from logic, enabling highly modular and scalable applications.

**The Problem ECS Solves:**
Traditional object-oriented programming can lead to complex inheritance hierarchies and tight coupling between data and behavior. ECS addresses these issues by decomposing your application into three distinct parts:
Traditional object-oriented programming can lead to complex inheritance hierarchies and tight coupling between data and behavior.
ECS addresses these issues by decomposing your application into three distinct parts:

### The ECS Trinity

Expand Down Expand Up @@ -121,7 +124,8 @@ Dojo adapts ECS for the onchain environment with three core concepts:

### 1. Models (Components)

Models are Cairo structs that define your application's data structures. They act as _components_ in the ECS pattern.
Models are Cairo structs that define your application's data structures.
They act as _components_ in the ECS pattern.

```rust
#[derive(Copy, Drop, Serde)]
Expand Down Expand Up @@ -258,7 +262,8 @@ world.emit_event(@PlayerMoved { player, direction });

## Next Steps

Ready to start building with Dojo? Here's your learning path:
Ready to start building with Dojo?
Here is your learning path:

<div className="grid grid-cols-2 gap-8">
<LinkCard
Expand Down
8 changes: 4 additions & 4 deletions docs/pages/framework/models/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ world.erase_models_ptrs(ptrs);
Field operations are more efficient when you only need to update specific fields:

:::warning
Field-level operations are advanced features that require careful use. For most applications,
use the simpler `world.read_model()` and `world.write_model()` methods.
Field-level operations are advanced features that require careful use.
For most applications, use the simpler `world.read_model()` and `world.write_model()` methods.
:::

#### Reading Fields
Expand Down Expand Up @@ -448,7 +448,7 @@ When reading non-existent models, the API returns default values (all fields set
// Reading a non-existent model returns default values
let player: ContractAddress = 0.try_into().unwrap();
let position: Position = world.read_model(player);
// If model doesn't exist: position.vec.x = 0, position.vec.y = 0
// If model does not exist: position.vec.x = 0, position.vec.y = 0

// For optional model reading, check if all fields are default
let position: Position = world.read_model(player);
Expand All @@ -471,7 +471,7 @@ For more advanced usage and examples, see the [Model Examples](https://github.co

## Complete Real-World Example

Here's a complete example from a typical Dojo game showing common patterns:
Here is a complete example from a typical Dojo game showing common patterns:

```cairo
use dojo::model::{ModelStorage};
Expand Down
Loading