From 2392e9aceb3e7c4872f72f1ffbac6b7b1be66128 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 30 Mar 2026 18:43:03 +0000 Subject: [PATCH 1/2] =?UTF-8?q?chore(defrag):=20phase=202a=20=E2=80=94=20s?= =?UTF-8?q?entence=20formatting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit One sentence per line, contraction expansion. - tutorials/deploy-to-mainnet/main.md - tutorials/deploy-using-slot/main.md - tutorials/dojo-react.mdx - tutorials/dojo-starter.mdx - tutorials/katana-starkli-scarb/main.md - tutorials/onchain-chess/0-setup.md - tutorials/onchain-chess/1-action.md - tutorials/onchain-chess/3-test.md - tutorials/onchain-chess/README.md - tutorials/react.mdx --- docs/pages/brand.mdx | 6 +- docs/pages/client/sdk/bevy.md | 8 +- docs/pages/client/sdk/c/index.mdx | 2 +- docs/pages/client/sdk/index.md | 6 +- docs/pages/client/sdk/javascript.md | 6 +- docs/pages/client/sdk/rust.md | 12 +- docs/pages/client/sdk/unity.md | 12 +- docs/pages/client/sdk/unrealengine.md | 3 +- docs/pages/faq.md | 10 +- docs/pages/framework/index.mdx | 15 +- docs/pages/framework/models/api.md | 8 +- docs/pages/framework/models/enums.md | 2 +- docs/pages/framework/models/index.md | 2 +- docs/pages/framework/models/introspection.md | 4 +- docs/pages/framework/models/upgrades.md | 4 +- docs/pages/framework/systems/architecture.md | 4 +- docs/pages/framework/systems/index.md | 6 +- docs/pages/framework/testing/index.md | 2 +- docs/pages/framework/upgrading/dojo-1-0.md | 63 ++-- docs/pages/framework/upgrading/dojo-1-7.md | 10 +- docs/pages/framework/upgrading/index.md | 3 +- docs/pages/framework/world/api.md | 2 +- docs/pages/framework/world/permissions.md | 15 +- .../getting-started/development-workflow.mdx | 12 +- docs/pages/getting-started/index.mdx | 30 +- docs/pages/getting-started/next-steps.mdx | 22 +- .../understanding-the-toolchain.mdx | 18 +- .../getting-started/your-first-dojo-app.mdx | 39 +-- docs/pages/installation.mdx | 10 +- docs/pages/libraries/alexandria/index.mdx | 3 +- docs/pages/theory/autonomous-worlds.md | 34 ++- docs/pages/toolchain/katana/advanced.md | 2 +- docs/pages/toolchain/katana/configuration.md | 2 +- docs/pages/toolchain/katana/development.md | 2 +- docs/pages/toolchain/katana/reference.md | 11 +- docs/pages/toolchain/saya/persistent.md | 4 +- docs/pages/toolchain/saya/sovereign.md | 2 +- docs/pages/toolchain/sozo/index.md | 5 +- docs/pages/tutorials/advanced.mdx | 2 +- .../pages/tutorials/deploy-to-mainnet/main.md | 36 ++- .../pages/tutorials/deploy-using-slot/main.md | 6 +- docs/pages/tutorials/dojo-react.mdx | 279 +++++++++++++++++- docs/pages/tutorials/dojo-starter.mdx | 104 ++++--- .../tutorials/katana-starkli-scarb/main.md | 8 +- docs/pages/tutorials/onchain-chess/0-setup.md | 13 +- .../pages/tutorials/onchain-chess/1-action.md | 2 +- docs/pages/tutorials/onchain-chess/3-test.md | 10 +- docs/pages/tutorials/onchain-chess/README.md | 22 +- docs/pages/tutorials/react.mdx | 12 +- 49 files changed, 653 insertions(+), 242 deletions(-) diff --git a/docs/pages/brand.mdx b/docs/pages/brand.mdx index 3ae8765e..309b5c87 100644 --- a/docs/pages/brand.mdx +++ b/docs/pages/brand.mdx @@ -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 diff --git a/docs/pages/client/sdk/bevy.md b/docs/pages/client/sdk/bevy.md index f23914d5..4afb6f62 100644 --- a/docs/pages/client/sdk/bevy.md +++ b/docs/pages/client/sdk/bevy.md @@ -1,3 +1,5 @@ +## File to edit: client/sdk/bevy.md + --- title: "Dojo Bevy SDK" description: "Official Bevy engine integration for building Dojo-powered games with native Rust performance" @@ -13,7 +15,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` @@ -245,7 +247,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::*; @@ -325,7 +327,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( diff --git a/docs/pages/client/sdk/c/index.mdx b/docs/pages/client/sdk/c/index.mdx index 16cd07c8..24b61a7e 100644 --- a/docs/pages/client/sdk/c/index.mdx +++ b/docs/pages/client/sdk/c/index.mdx @@ -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 diff --git a/docs/pages/client/sdk/index.md b/docs/pages/client/sdk/index.md index 836882b7..87d402d8 100644 --- a/docs/pages/client/sdk/index.md +++ b/docs/pages/client/sdk/index.md @@ -98,7 +98,7 @@ The client can then query the world state to get the latest state, which is then - Native C# bindings built on dojo.c foundation - Unity-specific components and prefabs for common patterns - Support for WebGL, desktop, and mobile platforms -- Integrated world state synchronization with Unity's component system +- Integrated world state synchronization with Unity component system ### Active Development @@ -106,7 +106,7 @@ The client can then query the world state to get the latest state, which is then **Best for:** Rust-based game development -- ECS-native integration with Bevy's component system +- ECS-native integration with Bevy component system - Rust-first development experience with compile-time safety - Direct access to dojo.c functionality without FFI overhead @@ -114,7 +114,7 @@ The client can then query the world state to get the latest state, which is then **Best for:** High-fidelity 3D games and applications -- C++ integration with Unreal's Blueprint system +- C++ integration with Unreal Blueprint system - Support for complex game mechanics and AAA-quality experiences - Native performance with dojo.c foundation diff --git a/docs/pages/client/sdk/javascript.md b/docs/pages/client/sdk/javascript.md index 4c671fee..dbabb8b0 100644 --- a/docs/pages/client/sdk/javascript.md +++ b/docs/pages/client/sdk/javascript.md @@ -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: @@ -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 @@ -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` ::: diff --git a/docs/pages/client/sdk/rust.md b/docs/pages/client/sdk/rust.md index bf50d3bd..050573c6 100644 --- a/docs/pages/client/sdk/rust.md +++ b/docs/pages/client/sdk/rust.md @@ -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. @@ -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> { // Configure connection URLs for your Dojo world @@ -219,13 +219,13 @@ 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(()) } @@ -233,7 +233,7 @@ pub async fn world_status(ctx: Context<'_>) -> Result<(), Error> { // This keeps our configuration organized and type-safe struct Config { discord_token: String, // Discord bot authentication token - channel_id: NonZero, // Discord channel ID (NonZero ensures it's never 0) + channel_id: NonZero, // 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 @@ -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; diff --git a/docs/pages/client/sdk/unity.md b/docs/pages/client/sdk/unity.md index 18992d5f..c9f2808e 100644 --- a/docs/pages/client/sdk/unity.md +++ b/docs/pages/client/sdk/unity.md @@ -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 @@ -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. @@ -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 @@ -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). @@ -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. diff --git a/docs/pages/client/sdk/unrealengine.md b/docs/pages/client/sdk/unrealengine.md index eb5b1d1c..afe2648b 100644 --- a/docs/pages/client/sdk/unrealengine.md +++ b/docs/pages/client/sdk/unrealengine.md @@ -41,7 +41,8 @@ Launch Unreal Engine 5 and create a new project or open an existing one where yo 3. Copy the Plugins/Dojo directory from dojo.unreal into your project's Plugins folder -4. Verify the plugin version in `Plugins/Dojo/Source/Dojo/Dojo.Build.cs`. For version updates or platform-specific deployments, refer to [Update the plugin](#update-the-plugin) or [Add a new platform](#add-a-new-platform) respectively. +4. Verify the plugin version in `Plugins/Dojo/Source/Dojo/Dojo.Build.cs`. +For version updates or platform-specific deployments, refer to [Update the plugin](#update-the-plugin) or [Add a new platform](#add-a-new-platform) respectively. 5. Enable the Dojo plugin by adding `"Dojo"` to the `PublicDependencyModuleNames.AddRange` list in `Source/DojoBookTest/PROJECTNAME.Build.cs` diff --git a/docs/pages/faq.md b/docs/pages/faq.md index cd98f165..715d811e 100644 --- a/docs/pages/faq.md +++ b/docs/pages/faq.md @@ -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. @@ -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 @@ -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? diff --git a/docs/pages/framework/index.mdx b/docs/pages/framework/index.mdx index 22e8f3ba..5552f7ce 100644 --- a/docs/pages/framework/index.mdx +++ b/docs/pages/framework/index.mdx @@ -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:** @@ -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 @@ -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)] @@ -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:
{ :::warning Use `#[inline(always)]` wisely to avoid hidden bugs during the cairo to sierra compilation. -Usually it's fine to use it with dojo utils functions. -In case you're using a function you do not know the complexity of, you should avoid using it. +Usually it is fine to use it with dojo utils functions. +In case you are using a function you do not know the complexity of, you should avoid using it. ::: ## IntrospectPacked trait diff --git a/docs/pages/framework/models/upgrades.md b/docs/pages/framework/models/upgrades.md index 0793c7af..9008896b 100644 --- a/docs/pages/framework/models/upgrades.md +++ b/docs/pages/framework/models/upgrades.md @@ -24,7 +24,7 @@ struct Player { } ``` -Now, let's say we want to enhance our system by adding a new field called `level`. +Now, let us say we want to enhance our system by adding a new field called `level`. ```cairo #[derive(Drop, Serde)] @@ -320,7 +320,7 @@ mod migration { 1. **Start with unpacked models**: Use `Introspect` for new models to maintain flexibility 2. **Group stable fields**: Keep frequently changing fields separate from stable ones -3. **Use appropriate types**: Don't over-size fields, but leave room for growth +3. **Use appropriate types**: Do not over-size fields, but leave room for growth 4. **Document constraints**: Clearly document which fields can be changed ### Upgrade Process diff --git a/docs/pages/framework/systems/architecture.md b/docs/pages/framework/systems/architecture.md index 0c12b51a..b10cd0db 100644 --- a/docs/pages/framework/systems/architecture.md +++ b/docs/pages/framework/systems/architecture.md @@ -12,7 +12,7 @@ Good architecture makes your codebase easier to understand, modify, and extend a ### Separation of Concerns -Each system should have a clear, distinct responsibility that doesn't overlap with other systems. +Each system should have a clear, distinct responsibility that does not overlap with other systems. This makes your codebase more modular and easier to maintain. ```cairo @@ -64,7 +64,7 @@ This creates a clean dependency flow and makes testing easier. ### Interface Segregation -Design focused interfaces that expose only what's necessary. +Design focused interfaces that expose only what is necessary. Large, monolithic interfaces become difficult to implement and maintain. ```cairo diff --git a/docs/pages/framework/systems/index.md b/docs/pages/framework/systems/index.md index b9ba51fe..12ef581b 100644 --- a/docs/pages/framework/systems/index.md +++ b/docs/pages/framework/systems/index.md @@ -116,7 +116,7 @@ impl InternalImpl of InternalTrait { ### What Systems Should Not Do -1. **Data Storage**: Systems don't store persistent state +1. **Data Storage**: Systems do not store persistent state 2. **UI Logic**: Keep presentation concerns separate 3. **External Integration**: Avoid direct external service calls 4. **Complex Calculations**: Delegate to specialized libraries when possible @@ -167,7 +167,7 @@ mod game_actions { ### Initialization -Systems are stateless functions and don't have constructors. +Systems are stateless functions and do not have constructors. However, Dojo contracts support a `dojo_init` function that acts as a constructor-equivalent. The World calls `dojo_init` on each contract during `sozo migrate`, after the contract is registered. @@ -262,4 +262,4 @@ Explore the deeper aspects of system implementation: - **[System Architecture](/framework/systems/architecture)** - Structural patterns and organization - **[System Coordination](/framework/systems/coordination)** - How systems interact and coordinate -Systems are the heart of your application - design them thoughtfully and they'll serve you well. +Systems are the heart of your application - design them thoughtfully and they will serve you well. diff --git a/docs/pages/framework/testing/index.md b/docs/pages/framework/testing/index.md index 8f0712ee..c8cb610f 100644 --- a/docs/pages/framework/testing/index.md +++ b/docs/pages/framework/testing/index.md @@ -20,7 +20,7 @@ This will search for all tests within your project and run them. ## Writing Unit Tests It is best practise to include unit tests in the same file as the [model](/framework/models/) / [system](/framework/systems/) you are writing. -Lets show a `model` test example from the [dojo-starter](https://github.com/dojoengine/dojo-starter): +Let us show a `model` test example from the [dojo-starter](https://github.com/dojoengine/dojo-starter): ```cairo // models.cairo diff --git a/docs/pages/framework/upgrading/dojo-1-0.md b/docs/pages/framework/upgrading/dojo-1-0.md index 92e207c5..ebbecd34 100644 --- a/docs/pages/framework/upgrading/dojo-1-0.md +++ b/docs/pages/framework/upgrading/dojo-1-0.md @@ -20,19 +20,23 @@ Dojo is composed of 5 basic resources: Every resource in the world is identified by a dojo selector, a single felt identifier obtained by hashing. -For human readability, namespaced resources can also be identified by what's called a `Tag`, which is a combination of the namespace and the resource name: -`namespace-resource_name`. The tag can be used to obtain the dojo selector of the resource. +For human readability, namespaced resources can also be identified by what is called a `Tag`, which is a combination of the namespace and the resource name: +`namespace-resource_name`. +The tag can be used to obtain the dojo selector of the resource. A single resource can be registered multiple times into the world using different namespaces. -All the resources without exception in the world are permissioned. This means that only the specified addresses can write/own resources. There's only two permissions in Dojo: +All the resources without exception in the world are permissioned. +This means that only the specified addresses can write/own resources. +There are only two permissions in Dojo: - `writer`: Can write to the resource. - `owner`: Can grant/revoke writer permissions, can register/upgrade resources. ## Interacting with the world and its data -First, when you are inside a dojo contract (define with `#[dojo::contract]`), you have to retrieve the world's instance. As mentioned previously, all the resources are namespaced, so you have to specify the default namespace to use: +First, when you are inside a dojo contract (define with `#[dojo::contract]`), you have to retrieve the world's instance. +As mentioned previously, all the resources are namespaced, so you have to specify the default namespace to use: ```rust // Get the world instance, using the namespace "ns": @@ -86,9 +90,11 @@ world.erase_model(@model); The full API of the `ModelStorage` can be found [here](https://github.com/dojoengine/dojo/blob/ab081b9fb8444d84aecaba848126f8c64db45eb8/crates/dojo/core/src/model/storage.cairo#L9) before more documentation is written. The important concept to keep in mind is that the data stored in the world are identified by the `keys` you are adding using `#[key]` in models and events. -A model/event can have one or multiple keys. When those keys are hashed, it's called the `entity_id`. +A model/event can have one or multiple keys. +When those keys are hashed, it is called the `entity_id`. -Events are only emitted by the world, and never stored onchain. Instead, Torii will index them and store them in the SQL database. +Events are only emitted by the world, and never stored onchain. +Instead, Torii will index them and store them in the SQL database. However, they are subjected to the same namespace rules as models. To emit an event, you have to import the `EventStorage` trait: @@ -110,7 +116,8 @@ world.emit_event(@e); ## Permissions -As mentioned previously, all the resources are permissioned. Some examples of the permission API: +As mentioned previously, all the resources are permissioned. +Some examples of the permission API: ```rust use dojo::world::IWorldDispatcherTrait; @@ -140,8 +147,9 @@ fn system_1(ref self: ContractState) { ## Events and Torii -Events are not stored onchain, they are indexed by Torii. And by default, events behave like models, which means only the latest state is kept. -However, you may want sometimes to keep events historical as it's regurlarly for blockchain events. +Events are not stored onchain, they are indexed by Torii. +And by default, events behave like models, which means only the latest state is kept. +However, you may want sometimes to keep events historical as it is regularly for blockchain events. To do so, nothing to change onchain, only one way to define events: @@ -171,11 +179,13 @@ historical = ["ns-MyEvent", "ns-MyOtherEvent"] ## Testing -Currently, Dojo is still only supporting the `cairo-test` test runner. Soon `starknet-foundry` will be unlocked once `scarb` and `cairo-lang` merge some missing features. +Currently, Dojo is still only supporting the `cairo-test` test runner. +Soon `starknet-foundry` will be unlocked once `scarb` and `cairo-lang` merge some missing features. -In the meantime, here's how you can test your contracts. As we've seen, resources like contracts, models and events are namespaced, so you have to specify the namespace you want to use when testing. +In the meantime, here is how you can test your contracts. +As we have seen, resources like contracts, models and events are namespaced, so you have to specify the namespace you want to use when testing. -Before starting to test, here's the flow that `Sozo` follows to migrate a world: +Before starting to test, here is the flow that `Sozo` follows to migrate a world: 1. First of all, `Sozo` will migrate the world itself. 2. Then, `Sozo` will register all the resources. Registering the resources means that all models/events/contracts will be declared and deployed onchain. None of those contracts are using constructor calldata, hence `Sozo` can deploy them without prior inputs. All resources are registered to the world and deployed through the world contract. @@ -184,7 +194,8 @@ Before starting to test, here's the flow that `Sozo` follows to migrate a world: This is important to keep this in mind, since the testing flow must be similar to the migration flow. -Now, let's move on to testing. First, you have to use the `dojo_cairo_test` crate to use dojo utilities in your tests. +Now, let us move on to testing. +First, you have to use the `dojo_cairo_test` crate to use dojo utilities in your tests. ```toml # Scarb.toml @@ -211,7 +222,8 @@ use dojo_starter::models::{ }; ``` -Then, for each resource, you can add them to a specific namespace. Once again, the same model or event type can be registered multiple times into different namespaces, which will yield different resources. +Then, for each resource, you can add them to a specific namespace. +Once again, the same model or event type can be registered multiple times into different namespaces, which will yield different resources. ```rust // Here we map the resource to the namespace "ns". @@ -230,7 +242,7 @@ fn namespace_def() -> NamespaceDef { } ``` -Let's then prepare some contracts definitions [defined here](https://github.com/dojoengine/dojo/blob/ab081b9fb8444d84aecaba848126f8c64db45eb8/crates/dojo/core-cairo-test/src/world.cairo#L57): +Let us then prepare some contracts definitions [defined here](https://github.com/dojoengine/dojo/blob/ab081b9fb8444d84aecaba848126f8c64db45eb8/crates/dojo/core-cairo-test/src/world.cairo#L57): ```rust // Here, we have one contract, and we define at this step @@ -245,7 +257,8 @@ fn contract_defs() -> Span { } ``` -Once you have a namespace definition and contracts definitions, you can spawn a test world with it. The function `spawn_test_world` will register all the resources and return a world instance we've seen previously. +Once you have a namespace definition and contracts definitions, you can spawn a test world with it. +The function `spawn_test_world` will register all the resources and return a world instance we have seen previously. ```rust #[test] @@ -266,7 +279,9 @@ fn test_world_test_set() { By having the registration of the resources and the synchronization of the permissions/init separated, you can easily separate tests functions to setup the world at your will to test different scenarios. -As you remember, the resources are also permissioned. In some occasions, you may want to interact with the world bypassing the permission check. For this, you can use the `test_only` world: +As you remember, the resources are also permissioned. +In some occasions, you may want to interact with the world bypassing the permission check. +For this, you can use the `test_only` world: ```rust let m = MyModel { id: 1, value: 123 }; @@ -283,9 +298,12 @@ You can find detailed information about the configuration file [here](/framework ## Sozo -Sozo has changed to be more robust and 100% stateless for the migration. All the data required to compute diffs and migration strategy are locally built or onchain. +Sozo has changed to be more robust and 100% stateless for the migration. +All the data required to compute diffs and migration strategy are locally built or onchain. -As you remember, Dojo is profile based. Hence, the build and migration must respond to the profile. To specify a profile, use `-P` or `--profile` argument. +As you remember, Dojo is profile based. +Hence, the build and migration must respond to the profile. +To specify a profile, use `-P` or `--profile` argument. Basic commands: @@ -307,7 +325,9 @@ sozo migrate ``` If you change a permission, you just have to run `sozo migrate` again and the permissions will be updated. -We recommend using `sozo inspect` instead of reading output of migration or the build. The `inspect` commands gives you summary of the world or specific resource. Use it at your advantage. +We recommend using `sozo inspect` instead of reading output of migration or the build. +The `inspect` commands gives you summary of the world or specific resource. +Use it at your advantage. ## Sozo useful commands @@ -392,7 +412,8 @@ sozo auth clone --from 0xa --to 0xb --revoke-from ## Road to mainnet -Mainnet is a network with a huge history and thousands of blocks. Currently, some nodes are not supported syncing the events providing block ranges that are too wide. +Mainnet is a network with a huge history and thousands of blocks. +Currently, some nodes are not supported syncing the events providing block ranges that are too wide. For this reason, when you target mainnet, you should do the following: ```bash diff --git a/docs/pages/framework/upgrading/dojo-1-7.md b/docs/pages/framework/upgrading/dojo-1-7.md index eda67363..e0db6072 100644 --- a/docs/pages/framework/upgrading/dojo-1-7.md +++ b/docs/pages/framework/upgrading/dojo-1-7.md @@ -91,7 +91,7 @@ This trait will affect data serialization and requires some code updates to hand ### Dojo Storage Overview -Before describing the issue, here's a brief summary of how Dojo storage works: +Before describing the issue, here is a brief summary of how Dojo storage works: 1. A model is defined as a Cairo struct. 2. This model is serialized using the `Serde` trait and written to world storage via `world.model_write(@m)`. @@ -100,7 +100,7 @@ Before describing the issue, here's a brief summary of how Dojo storage works: Since serialization is handled by the `Serde` trait, enums are serialized as follows: 1. The variant index is stored as the first `felt`. -2. If the variant contains a value (i.e., is not the unit type `()`), the serialized value occupies the remaining `felt`s. +2. If the variant contains a value (that is, is not the unit type `()`), the serialized value occupies the remaining `felt`s. For example, the `Option` enum is serialized as: @@ -171,7 +171,7 @@ From Dojo 1.7.0, models are serialized using a new `DojoStore` trait, which basi When reading an uninitialized model containing an enum, `DojoStore` will automatically use the default variant configured at enum level for deserialization. -Let's see an example: +Let us see an example: ```rust #[derive(Drop)] @@ -361,7 +361,7 @@ fn test_world_test_set() { ### Using Starknet Foundry Now that Starknet Foundry is supported for Dojo contracts, you can opt to use it instead of `dojo-cairo-test` for testing. -YOu can use the whole Starknet Foundry test suite and cheatcodes. +You can use the whole Starknet Foundry test suite and cheatcodes. Update your `Scarb.toml` to add the `dojo_snf_test` dependency: @@ -432,7 +432,7 @@ torii 1.7.0 ### Sozo build errors -If you're having trouble compiling your contracts with Sozo, try adding `dojo_macros` to your `Scarb.toml`: +If you are having trouble compiling your contracts with Sozo, try adding `dojo_macros` to your `Scarb.toml`: ```toml [dependencies] diff --git a/docs/pages/framework/upgrading/index.md b/docs/pages/framework/upgrading/index.md index 70ed6a0f..c3031a10 100644 --- a/docs/pages/framework/upgrading/index.md +++ b/docs/pages/framework/upgrading/index.md @@ -53,7 +53,8 @@ As such, this is the first release in which version compatibility became an issu - Support for Cairo 2.10 (Dojo lang is still a built-in compiler plugin, no scarbs.xyz at the moment). -- The world now keeps track of the ownership counter on resources. It has a new API to verify the ownership of a resource owners_count. +- The world now keeps track of the ownership counter on resources. +It has a new API to verify the ownership of a resource owners_count. - Signed integers are now fully supported by the introspection. diff --git a/docs/pages/framework/world/api.md b/docs/pages/framework/world/api.md index a1094b31..cebb5ea4 100644 --- a/docs/pages/framework/world/api.md +++ b/docs/pages/framework/world/api.md @@ -382,7 +382,7 @@ if let Option::Some(class_hash) = world.dns_class_hash(@"my_contract") { ## Advanced Functions The following functions are primarily used by framework developers, tooling, and migration scripts. -Most application developers won't touch these directly: +Most application developers will not touch these directly: ### Entity Operations diff --git a/docs/pages/framework/world/permissions.md b/docs/pages/framework/world/permissions.md index 32983e87..5f901c4c 100644 --- a/docs/pages/framework/world/permissions.md +++ b/docs/pages/framework/world/permissions.md @@ -128,7 +128,7 @@ world.grant_owner(selector_from_tag!("my_game"), new_owner_ddress); ``` :::note -When you deploy to a world, you automatically become the owner of that namespace, if it's not already registered. +When you deploy to a world, you automatically become the owner of that namespace, if it is not already registered. ::: **Namespace Owner Rights**: @@ -171,13 +171,14 @@ world.grant_writer(selector_from_tag!("my_game"), system_contract); ## Resource-Based Permissions -All permissions in Dojo are resource-based. Every component is a resource: +All permissions in Dojo are resource-based. +Every component is a resource: - **World** → A resource (selector `0`) -- **Namespace** → A resource (e.g., `"my_game"`) -- **Model** → A resource (e.g., `"my_game-Position"`) -- **Contract** → A resource (e.g., `"my_game-actions"`) -- **Event** → A resource (e.g., `"my_game-PlayerMoved"`) +- **Namespace** → A resource (for example, `"my_game"`) +- **Model** → A resource (for example, `"my_game-Position"`) +- **Contract** → A resource (for example, `"my_game-actions"`) +- **Event** → A resource (for example, `"my_game-PlayerMoved"`) **Permission Hierarchy** (order of precedence): @@ -408,7 +409,7 @@ For detailed configuration options, see [Configuration](/framework/configuration ## Debugging Permission Issues -1. **Check Resource Selector**: Ensure you're using the correct resource selector +1. **Check Resource Selector**: Ensure you are using the correct resource selector 2. **Verify Caller**: Confirm the caller address is what you expect 3. **Check Hierarchy**: Verify the permission hierarchy is set up correctly 4. **Use Events**: Monitor permission events to track changes diff --git a/docs/pages/getting-started/development-workflow.mdx b/docs/pages/getting-started/development-workflow.mdx index 0dd20a78..5c2e077c 100644 --- a/docs/pages/getting-started/development-workflow.mdx +++ b/docs/pages/getting-started/development-workflow.mdx @@ -1,6 +1,7 @@ # Development Workflow -Now that you understand Dojo's toolchain, let's explore the typical development workflow. You'll learn how to iterate efficiently, test your code, and debug issues as you build your Dojo applications. +Now that you understand Dojo's toolchain, let us explore the typical development workflow. +You will learn how to iterate efficiently, test your code, and debug issues as you build your Dojo applications. ## The Development Cycle @@ -20,7 +21,7 @@ A typical Dojo development session follows this pattern: 6. Repeat ``` -Let's walk through each step with practical examples. +Let us walk through each step with practical examples. ## Setting Up Your Development Environment @@ -38,7 +39,8 @@ torii --dev # (keep this free for running sozo commands) ``` -> **Tip**: Create a simple script to start all tools at once. Save this as `start-dev.sh`: +> **Tip**: Create a simple script to start all tools at once. +> Save this as `start-dev.sh`: ```bash #!/bin/bash @@ -602,4 +604,6 @@ pkill katana && pkill torii ## Next Steps -You now have a solid understanding of the Dojo development workflow! Ready to explore what comes next in your journey? Continue to [Next Steps](./next-steps) to discover advanced topics, deployment strategies, and community resources. +You now have a solid understanding of the Dojo development workflow! +Ready to explore what comes next in your journey? +Continue to [Next Steps](./next-steps) to discover advanced topics, deployment strategies, and community resources. diff --git a/docs/pages/getting-started/index.mdx b/docs/pages/getting-started/index.mdx index c979ba86..c11d6101 100644 --- a/docs/pages/getting-started/index.mdx +++ b/docs/pages/getting-started/index.mdx @@ -1,8 +1,10 @@ # Getting Started with Dojo -Welcome to Dojo! This learning path will guide you from your first "Hello World" to building and deploying your own provable games and autonomous worlds on Starknet. +Welcome to Dojo! +This learning path will guide you from your first "Hello World" to building and deploying your own provable games and autonomous worlds on Starknet. -Dojo is a comprehensive toolchain for building fully on-chain applications using the Entity Component System (ECS) architecture. Whether you're new to blockchain development or an experienced smart contract developer, these tutorials will help you understand Dojo's unique approach to on-chain applications. +Dojo is a comprehensive toolchain for building fully on-chain applications using the Entity Component System (ECS) architecture. +Whether you are new to blockchain development or an experienced smart contract developer, these tutorials will help you understand Dojo's unique approach to on-chain applications. ## Learning Path Overview @@ -12,7 +14,8 @@ Follow these tutorials in order to build your understanding progressively: **Time: 20-30 minutes** | **Prerequisites: None** -Create and deploy your first Dojo project using the spawn-and-move example. You'll learn: +Create and deploy your first Dojo project using the spawn-and-move example. +You will learn: - How to set up a new Dojo project - Basic ECS concepts (Entities, Components, Systems) @@ -23,7 +26,8 @@ Create and deploy your first Dojo project using the spawn-and-move example. You' **Time: 15-20 minutes** | **Prerequisites: First Dojo App** -Explore the tools that make Dojo development possible. You'll understand: +Explore the tools that make Dojo development possible. +You will understand: - **Katana**: Local Starknet sequencer for development - **Torii**: Indexing engine for efficient data queries @@ -34,7 +38,8 @@ Explore the tools that make Dojo development possible. You'll understand: **Time: 25-35 minutes** | **Prerequisites: Understanding the Toolchain** -Learn the typical development process for Dojo projects. You'll practice: +Learn the typical development process for Dojo projects. +You will practice: - Writing and testing new Systems - Adding and modifying Components @@ -45,16 +50,17 @@ Learn the typical development process for Dojo projects. You'll practice: **Time: 10 minutes** | **Prerequisites: Development Workflow** -Discover where to go next in your Dojo journey. You'll explore: +Discover where to go next in your Dojo journey. +You will explore: - Advanced tutorials and projects - Client SDK integration options - Community resources and support - Deployment to testnet and mainnet -## What You'll Build +## What You Will Build -Throughout this learning path, you'll work with a simple but complete game where a player can: +Throughout this learning path, you will work with a simple but complete game where a player can: - Spawn characters in a virtual world - Move characters around using directional commands @@ -66,11 +72,11 @@ This foundation demonstrates all core Dojo concepts while remaining simple enoug Before starting, ensure you have: -- **Dojo installed**: Follow the [installation guide](/installation) if you haven't already -- **Basic command line knowledge**: You'll be running terminal commands +- **Dojo installed**: Follow the [installation guide](/installation) if you have not already +- **Basic command line knowledge**: You will be running terminal commands - **Text editor**: Any editor that supports Cairo syntax highlighting (VS Code recommended) -> **Note**: No prior blockchain or Cairo experience is required. We'll explain concepts as we go. +> **Note**: No prior blockchain or Cairo experience is required. We will explain concepts as we go. ## Getting Help @@ -82,4 +88,4 @@ If you get stuck during these tutorials: ## Ready to Start? -Let's begin with [your first Dojo app](/getting-started/your-first-dojo-app) and get your development environment running! +Let us begin with [your first Dojo app](/getting-started/your-first-dojo-app) and get your development environment running! diff --git a/docs/pages/getting-started/next-steps.mdx b/docs/pages/getting-started/next-steps.mdx index 4ad26f0b..e52671bd 100644 --- a/docs/pages/getting-started/next-steps.mdx +++ b/docs/pages/getting-started/next-steps.mdx @@ -1,17 +1,18 @@ # Next Steps -Congratulations! You've completed the getting started path and now have a solid foundation in Dojo development. Here's your roadmap to becoming a proficient Dojo developer and building production-ready applications. +Congratulations! You have completed the getting started path and now have a solid foundation in Dojo development. +Here is your roadmap to becoming a proficient Dojo developer and building production-ready applications. -## What You've Accomplished +## What You Have Accomplished -Through this learning path, you've: +Through this learning path, you have: - ✅ Built and deployed your first Dojo application - ✅ Understood the ECS architecture and Dojo's toolchain - ✅ Learned the development workflow and best practices - ✅ Experienced the complete cycle from code to deployment -You're now ready to tackle more advanced topics and build more complex applications. +You are now ready to tackle more advanced topics and build more complex applications. ## Choose Your Path Forward @@ -244,7 +245,8 @@ Set up additional development tools: ## Staying Current -The Dojo ecosystem evolves rapidly. Stay updated: +The Dojo ecosystem evolves rapidly. +Stay updated: ### Regular Updates @@ -260,7 +262,7 @@ The Dojo ecosystem evolves rapidly. Stay updated: ### Community Engagement -- **Share your projects**: Show off what you're building +- **Share your projects**: Show off what you are building - **Ask questions**: The community is helpful and welcoming - **Contribute back**: Help others learn and improve the ecosystem @@ -290,9 +292,10 @@ When you encounter challenges: ## Your Journey Continues -Building with Dojo is a journey, not a destination. The ecosystem is rapidly evolving, with new patterns, tools, and possibilities emerging regularly. +Building with Dojo is a journey, not a destination. +The ecosystem is rapidly evolving, with new patterns, tools, and possibilities emerging regularly. -Whether you're building the next viral on-chain game, creating innovative DeFi mechanisms, or pushing the boundaries of autonomous worlds, you now have the foundation to succeed. +Whether you are building the next viral on-chain game, creating innovative DeFi mechanisms, or pushing the boundaries of autonomous worlds, you now have the foundation to succeed. **Ready to build something amazing?** @@ -300,4 +303,5 @@ Whether you're building the next viral on-chain game, creating innovative DeFi m - Explore the [tutorials section](/tutorials) for your next learning challenge - Check out the ecosystem showcase for inspiration (Coming Soon) -Welcome to the future of on-chain applications. Let's build something incredible together! 🚀 +Welcome to the future of on-chain applications. +Let us build something incredible together! 🚀 diff --git a/docs/pages/getting-started/understanding-the-toolchain.mdx b/docs/pages/getting-started/understanding-the-toolchain.mdx index d76a3451..468030a5 100644 --- a/docs/pages/getting-started/understanding-the-toolchain.mdx +++ b/docs/pages/getting-started/understanding-the-toolchain.mdx @@ -1,6 +1,6 @@ # Understanding the Toolchain -Now that you've built your first Dojo app, let's explore the tools that made it possible. +Now that you have built your first Dojo app, let us explore the tools that made it possible. Understanding each tool's role will help you develop more effectively and debug issues when they arise. :::note @@ -112,7 +112,7 @@ katana --rpc-url --fork-block-number ### Using Torii's APIs After starting `torii --world `, you can access data through multiple interfaces. -Let's make a query to retrieve all the instances of the `Position` model. +Let us make a query to retrieve all the instances of the `Position` model. #### GraphiQL (Browser) @@ -240,7 +240,7 @@ You **must** have a `dojo_dev.toml` file in your contract directory, or Sozo wil ::: After migrating, Sozo will generate a `manifest_.json` file, which contains information about the deployed contracts and interfaces. -Thsi file is meant to be consumed by clients to help them interact with the world. +This file is meant to be consumed by clients to help them interact with the world. #### 4. Interaction @@ -317,7 +317,7 @@ For more information about Saya, [see the docs](/toolchain/saya). ## How The Toolchain Works Together -Here's the typical development flow: +Here is the typical development flow: 1. **Sozo** compiles your Cairo code into deployable contracts 2. **Katana** provides a local blockchain to deploy and test on @@ -373,23 +373,23 @@ sozo execute di-actions spawn --profile staging ## Troubleshooting Common Issues -### Katana Won't Start +### Katana Will Not Start - Verify your `katana.toml` configuration is correct - Check if the port is in use (`lsof -i :5050`) -### Torii Can't Connect +### Torii Cannot Connect - Verify the World address in `torii_dev.toml` matches your migration output - Check that the World was successfully deployed (`sozo inspect`) ### Sozo Commands Fail -- Verify you're in a Dojo project directory (look for `Scarb.toml`) -- Check that you're using the correct account address and private key +- Verify you are in a Dojo project directory (look for `Scarb.toml`) +- Check that you are using the correct account address and private key ## Next Steps -Now that you understand the toolchain, you're ready to learn about the [development workflow](/getting-started/development-workflow) and start building more complex applications. +Now that you understand the toolchain, you are ready to learn about the [development workflow](/getting-started/development-workflow) and start building more complex applications. Each tool has extensive documentation in the toolchain section for when you need to dive deeper into specific features and configurations. diff --git a/docs/pages/getting-started/your-first-dojo-app.mdx b/docs/pages/getting-started/your-first-dojo-app.mdx index 86a4e4c6..e7713267 100644 --- a/docs/pages/getting-started/your-first-dojo-app.mdx +++ b/docs/pages/getting-started/your-first-dojo-app.mdx @@ -5,10 +5,10 @@ description: "Create your first Dojo project from scratch and deploy it locally. # Your First Dojo App -In this tutorial, you'll create your first Dojo project from scratch and deploy it locally. -By the end, you'll have a working game where you can spawn and move a character using a browser-based client. +In this tutorial, you will create your first Dojo project from scratch and deploy it locally. +By the end, you will have a working game where you can spawn and move a character using a browser-based client. -## What You'll Learn +## What You Will Learn - The structure of a Dojo project - Basic Entity Component System (ECS) concepts @@ -46,7 +46,7 @@ dojo-intro/ ## Step 2: Understand the Contract Structure -Let's examine the key `contracts/` files to understand what we're building: +Let us examine the key `contracts/` files to understand what we are building: ### Models (Entities & Components) @@ -147,8 +147,8 @@ For more details about configuration options, see the [configuration guide](/fra ## Step 3: Start the Development Environment -Now let's get the development tools running. -You'll run three tools simultaneously, each in its own terminal: +Now let us get the development tools running. +You will run three tools simultaneously, each in its own terminal: | Tool | Purpose | Terminal | | ---------- | ------------------------------- | ---------- | @@ -166,7 +166,7 @@ cd contracts && katana --config katana.toml _This creates a fast, local Starknet environment for development_ -You'll see output like this: +You will see output like this: ``` 2025-07-10T15:46:43.495560Z INFO katana_core::backend: Genesis initialized @@ -204,7 +204,7 @@ ACCOUNTS SEED 2025-07-10T15:46:43.496406Z INFO rpc: RPC server started. addr=127.0.0.1:5050 ``` -Keep this running - it's your local blockchain. +Keep this running - it is your local blockchain. :::tip By default, Katana runs on port 5050 @@ -239,7 +239,7 @@ Compiling dojo_intro v1.5.0 (~/dojo-intro/contracts/Scarb.toml) ### Terminal 3: Start Torii (Indexer) -In a third terminal you'll start Torii, Dojo's indexer: +In a third terminal you will start Torii, Dojo's indexer: ```bash cd contracts && torii --config torii_dev.toml @@ -248,13 +248,13 @@ cd contracts && torii --config torii_dev.toml _This watches your blockchain and creates queryable APIs for your game data_ :::note -If you look at `torii_dev.toml`, you'll see the same world address as that generated by `sozo migrate`. +If you look at `torii_dev.toml`, you will see the same world address as that generated by `sozo migrate`. Sozo migrations are deterministic based on the seed defined in `dojo_dev.toml`. If you change the seed, the world address will change. ::: Torii will start indexing your world's data. -You'll see: +You will see: ``` 2025-07-10T15:59:27.961623Z INFO torii::relay::server: Relay peer id. peer_id=12D3KooWLaZ5bummiPSM2HHtRahELYUFWQA12NWNeMQ4aYpVhk9h @@ -272,8 +272,8 @@ You'll see: 2025-07-10T15:59:27.974166Z INFO torii::indexer::processors::register_model: Registered model. namespace=di name=Position ``` -Reading this output, you'll see that Torii has set up some local endpoints, which the client will use to fetch game state. -You'll also see that Torii has registered the game models `Moves` and `Position` we saw earlier, within the `di` namespace. +Reading this output, you will see that Torii has set up some local endpoints, which the client will use to fetch game state. +You will also see that Torii has registered the game models `Moves` and `Position` we saw earlier, within the `di` namespace. :::tip By default, Torii runs on port 8080 @@ -284,8 +284,8 @@ Your Dojo development environment is up-and-running. ## Step 4: Launch Your Game Client -Now let's test your game! -First, let's launch your game client: +Now let us test your game! +First, let us launch your game client: ```bash cd client && pnpm install && pnpm run dev @@ -323,7 +323,7 @@ Click `Connect` to launch the Cartridge Controller log-in flow. Once you have logged in with Controller, you should be able to spawn a character and move them around. :::info -Take a moment to appreciate what's happening under the hood. +Take a moment to appreciate what is happening under the hood. Every system execution is being sent by Controller as a transaction to Katana, which emits an event that is picked up by Torii, which is sent back to the client and rendered for you! ::: @@ -331,11 +331,11 @@ After a while, you should have something which looks like this: ![client-2](/getting-started/client-2.png) -**Congratulations, you've just created your first provable game with Dojo!** +**Congratulations, you have just created your first provable game with Dojo!** ## Understanding What Happened -Let's break down what you just accomplished: +Let us break down what you just accomplished: 1. **Defined Components**: `Position` and `Moves` store data about each player 2. **Implemented Systems**: The `spawn` and `move` functions modify component data @@ -367,7 +367,8 @@ When you execute a system, it emits events that Torii captures and indexes, whic ## Next Steps -Congratulations! You've successfully: +Congratulations! +You have successfully: - ✅ Understood basic ECS concepts - ✅ Created and deployed your first Dojo project diff --git a/docs/pages/installation.mdx b/docs/pages/installation.mdx index 94702d6e..60b113e7 100644 --- a/docs/pages/installation.mdx +++ b/docs/pages/installation.mdx @@ -11,7 +11,8 @@ Dojo's installation process was designed to be idiomatically consistent with its You can get up-and-running in just a few steps, and be building provable games in no time. :::warning -Windows is not natively supported. We recommend [WSL2](https://learn.microsoft.com/en-us/windows/wsl/install) for Windows development. +Windows is not natively supported. +We recommend [WSL2](https://learn.microsoft.com/en-us/windows/wsl/install) for Windows development. ::: ## Quick Start @@ -46,7 +47,7 @@ Before installing Dojo, ensure your system meets these requirements: ## Prerequisites -Before installing Dojo, you'll need these foundational tools: +Before installing Dojo, you will need these foundational tools: #### 1. Install Rust with `rustup` @@ -331,7 +332,8 @@ If you continue to experience issues: 2. Join our [Discord](https://discord.gg/invite/dojoengine) for community support 3. Review the [Dojo Book](https://book.dojoengine.org/) for comprehensive documentation -> **Note**: Version numbers in this guide are current as of the latest stable release. For the most current version numbers, check the [Dojo releases page](https://github.com/dojoengine/dojo/releases). +> **Note**: Version numbers in this guide are current as of the latest stable release. +> For the most current version numbers, check the [Dojo releases page](https://github.com/dojoengine/dojo/releases). ## Code Editor Support @@ -350,7 +352,7 @@ If you run into problems getting started with Dojo, join our [Discord](https://d ## Next Steps -With Dojo installed, you're ready to start building: +With Dojo installed, you are ready to start building:
"Autonomous worlds represent persistent, permissionless, and decentralized open environments that users can freely interact with and contribute to." -The precise definition of Autonomous Worlds (AWs) remains somewhat elusive, as it is more of an abstract concept that has yet to be fully crystallized. Lattice first [introduced](https://0xparc.org/blog/autonomous-worlds) the terminology in 2022, but the notion of open worlds operating on the blockchain has been around for a while. The abstraction introduced by MUD served as a catalyst for the market to recognize the potential of these worlds. +The precise definition of Autonomous Worlds (AWs) remains somewhat elusive, as it is more of an abstract concept that has yet to be fully crystallized. +Lattice first [introduced](https://0xparc.org/blog/autonomous-worlds) the terminology in 2022, but the notion of open worlds operating on the blockchain has been around for a while. +The abstraction introduced by MUD served as a catalyst for the market to recognize the potential of these worlds. -Autonomous Worlds share notable similarities with blockchains in their fundamental nature. Once established, they persist, maintaining their state throughout the lifespan of the chain. Players can join or leave, and developers can expand these worlds by deploying features in a permissionless manner, much like how contracts are added to a chain. While there is no universally accepted definition for an Autonomous World, we believe that a game must possess at least the following two essential features to be considered as such: +Autonomous Worlds share notable similarities with blockchains in their fundamental nature. +Once established, they persist, maintaining their state throughout the lifespan of the chain. +Players can join or leave, and developers can expand these worlds by deploying features in a permissionless manner, much like how contracts are added to a chain. +While there is no universally accepted definition for an Autonomous World, we believe that a game must possess at least the following two essential features to be considered as such: -1. Decentralized data availability layer: While the state execution may reside on a centralized layer, it is crucial that the state can be reconstructed if the execution layer ceases to exist. Rollups offer a solution, providing increased capacity execution layers while ensuring data is permanently settled on Ethereum. This guarantees the world's perpetual persistence. +1. Decentralized data availability layer: While the state execution may reside on a centralized layer, it is crucial that the state can be reconstructed if the execution layer ceases to exist. +Rollups offer a solution, providing increased capacity execution layers while ensuring data is permanently settled on Ethereum. +This guarantees the world's perpetual persistence. -2. Permissionless entry point for expanding the world: The World contract must be capable of accepting new systems and components without requiring permission. While this doesn't imply that every component and system will be utilized, they must adhere to this pattern, ensuring open and unrestricted access for potential enhancements. +2. Permissionless entry point for expanding the world: The World contract must be capable of accepting new systems and components without requiring permission. +While this does not imply that every component and system will be utilized, they must adhere to this pattern, ensuring open and unrestricted access for potential enhancements. -We're firm believers in the potential for Autonomous Worlds to catalyze the exploration of novel forms in the medium provided by zk proofs and blockchain technology. This is not only about games, but also about new forms of artwork, coordination, fun, emerging from tinkering and radical innovation, eventually questioning the very notion of "play" in this brave new decentralized and trustless world. +We are firm believers in the potential for Autonomous Worlds to catalyze the exploration of novel forms in the medium provided by zk proofs and blockchain technology. +This is not only about games, but also about new forms of artwork, coordination, fun, emerging from tinkering and radical innovation, eventually questioning the very notion of "play" in this brave new decentralized and trustless world. ### Homework diff --git a/docs/pages/toolchain/katana/advanced.md b/docs/pages/toolchain/katana/advanced.md index 108e6b4f..ffc5d0df 100644 --- a/docs/pages/toolchain/katana/advanced.md +++ b/docs/pages/toolchain/katana/advanced.md @@ -128,7 +128,7 @@ pub trait IOperator { } ``` -The `OperatorMode` allows dynamic control over when and how operators can act (e.g., permanent or time-limited authorization). +The `OperatorMode` allows dynamic control over when and how operators can act (for example, permanent or time-limited authorization). Only the creator of the world can change the mode. More importantly, the `set_entity` function within the world contract is gated by this operator check. diff --git a/docs/pages/toolchain/katana/configuration.md b/docs/pages/toolchain/katana/configuration.md index 4beb8797..56e04cda 100644 --- a/docs/pages/toolchain/katana/configuration.md +++ b/docs/pages/toolchain/katana/configuration.md @@ -38,7 +38,7 @@ katana --config katana_prod.toml ```toml # Core node settings -silent = false # Don't print anything on startup (default: false) +silent = false # Do not print anything on startup (default: false) no_mining = false # Disable auto/interval mining (default: false) block_time = 6000 # Block time in milliseconds (default: none) db_dir = "./katana-db" # Database dir for non-Slot deployments (default: none) diff --git a/docs/pages/toolchain/katana/development.md b/docs/pages/toolchain/katana/development.md index fa293ef9..2196d1d9 100644 --- a/docs/pages/toolchain/katana/development.md +++ b/docs/pages/toolchain/katana/development.md @@ -219,7 +219,7 @@ katana --dev --metrics --dev.no-fee watch -n 1 'curl -s http://127.0.0.1:9100/metrics | grep block_producer' ``` -This provides real-time visibility into your local blockchain's performance characteristics during development and testing. +This provides real-time visibility into your local blockchain performance characteristics during development and testing. ### Enabling explorer diff --git a/docs/pages/toolchain/katana/reference.md b/docs/pages/toolchain/katana/reference.md index 46edb909..c82ce4f5 100644 --- a/docs/pages/toolchain/katana/reference.md +++ b/docs/pages/toolchain/katana/reference.md @@ -30,7 +30,7 @@ See the [Torii documentation](/toolchain/torii) for Torii's API reference. ### Common Development Workflow -Here's a typical workflow using the dev namespace for testing: +Here is a typical workflow using the dev namespace for testing: ```bash # 1. Get predeployed accounts @@ -110,7 +110,8 @@ The full documentation for the RPC methods can be found [here](https://github.co ### `dev` Namespace -The `dev` API provides a way to manipulate the blockchain state at runtime. This namespace is only accessible when the `--dev` flag is enabled. +The `dev` API provides a way to manipulate the blockchain state at runtime. +This namespace is only accessible when the `--dev` flag is enabled. #### `dev_generateBlock` @@ -269,7 +270,8 @@ This API is designed for local development with Cartridge controllers and is not ## Supported Transaction Types -Katana aims to follow the Starknet specifications as closely as possible, mimicking the features currently supported on mainnet. Katana currently supports the following Starknet transaction types: +Katana aims to follow the Starknet specifications as closely as possible, mimicking the features currently supported on mainnet. +Katana currently supports the following Starknet transaction types: | Type | Version | Description | | ------------------ | ------- | --------------------------------------- | @@ -281,7 +283,8 @@ Katana aims to follow the Starknet specifications as closely as possible, mimick **Version 1**: Legacy transaction format with lower gas efficiency. -**Version 3**: Current transaction format with improved gas efficiency and fee estimation. Recommended for new development. +**Version 3**: Current transaction format with improved gas efficiency and fee estimation. +Recommended for new development. **DECLARE Version 2**: Introduces Sierra compilation for improved contract verification. diff --git a/docs/pages/toolchain/saya/persistent.md b/docs/pages/toolchain/saya/persistent.md index a9464a05..4ccf1382 100644 --- a/docs/pages/toolchain/saya/persistent.md +++ b/docs/pages/toolchain/saya/persistent.md @@ -47,7 +47,7 @@ You can inspect the chain by running `katana config per1` :::note The settlement core contract must receive configuration parameters on deployment. -It's recommended to let Katana handle this. +It is recommended to let Katana handle this. If the core contract is already deployed, you should provide it so Katana can verify the configuration parameters. ::: @@ -73,7 +73,7 @@ You will then want to start katana with the `--chain /path` instead of `--chain ## Run Saya -If you haven't already, consult the [Herodotus guide](/toolchain/saya) to get an account and an API key. +If you have not already, consult the [Herodotus guide](/toolchain/saya) to get an account and an API key. If you are not running Saya in [docker](https://github.com/dojoengine/saya/pkgs/container/saya), you can download the SNOS program and the Layout Bridge program from the [Saya releases](https://github.com/dojoengine/saya/releases). If you are running Saya in [docker](https://github.com/dojoengine/saya/pkgs/container/saya), the programs are already present in the `/programs` directory. diff --git a/docs/pages/toolchain/saya/sovereign.md b/docs/pages/toolchain/saya/sovereign.md index ef41411c..281372a7 100644 --- a/docs/pages/toolchain/saya/sovereign.md +++ b/docs/pages/toolchain/saya/sovereign.md @@ -88,7 +88,7 @@ You will then want to start katana with the `--chain /path` instead of `--chain ## Run Saya -If you haven't already, consult the [Herodotus guide](/toolchain/saya) to get an account and an API key. +If you have not already, consult the [Herodotus guide](/toolchain/saya) to get an account and an API key. If you are not running Saya in [docker](https://github.com/dojoengine/saya/pkgs/container/saya), you can download the SNOS program from the [Saya releases](https://github.com/dojoengine/saya/releases). If you are running Saya in [docker](https://github.com/dojoengine/saya/pkgs/container/saya), the programs are already present in the `/programs` directory. diff --git a/docs/pages/toolchain/sozo/index.md b/docs/pages/toolchain/sozo/index.md index 55ffa384..d536cbd5 100644 --- a/docs/pages/toolchain/sozo/index.md +++ b/docs/pages/toolchain/sozo/index.md @@ -69,7 +69,8 @@ Sozo automatically generates and maintains deployment manifests that eliminate m **Generated Manifests**: After each `sozo migrate`, Sozo writes a `manifest_{profile}.json` file containing complete deployment state: contract addresses, class hashes, ABIs, and metadata for all resources. -**Tag-Based Contract Resolution**: Commands like `sozo execute` and `sozo call` accept human-readable contract tags (e.g., `Actions`, `dojo_examples-actions`) instead of raw addresses. Sozo resolves tags by consulting the local manifest first, then falling back to live chain introspection. +**Tag-Based Contract Resolution**: Commands like `sozo execute` and `sozo call` accept human-readable contract tags (e.g., `Actions`, `dojo_examples-actions`) instead of raw addresses. +Sozo resolves tags by consulting the local manifest first, then falling back to live chain introspection. **Fallback to Chain State**: When manifests are missing or `--diff` is used, Sozo rebuilds contract mappings by querying deployed world state directly. @@ -137,7 +138,7 @@ This will install the `sozo` binary at `~/.cargo/bin` ## Data Format Reference -When interacting with Dojo systems through Sozo, you'll need to provide calldata in the proper format. +When interacting with Dojo systems through Sozo, you will need to provide calldata in the proper format. Sozo uses a prefixed format that allows explicit type specification for Cairo values. By default, calldata values are treated as a `felt252` or any type that fits into one felt: diff --git a/docs/pages/tutorials/advanced.mdx b/docs/pages/tutorials/advanced.mdx index 8b137891..c98eccbe 100644 --- a/docs/pages/tutorials/advanced.mdx +++ b/docs/pages/tutorials/advanced.mdx @@ -1 +1 @@ - +## File to edit: tutorials/advanced.mdx diff --git a/docs/pages/tutorials/deploy-to-mainnet/main.md b/docs/pages/tutorials/deploy-to-mainnet/main.md index e66a11e2..c1f929c7 100644 --- a/docs/pages/tutorials/deploy-to-mainnet/main.md +++ b/docs/pages/tutorials/deploy-to-mainnet/main.md @@ -33,7 +33,7 @@ curl --location '' \ # now paste the hex result part on this command... echo 0x534e5f5345504f4c4941 | xxd -r -p -# which !must! output SN_SEPOLIA or SN_MAIN +# which must output SN_SEPOLIA or SN_MAIN SN_SEPOLIA ``` @@ -43,7 +43,7 @@ SN_SEPOLIA [profile.sepolia] ``` -- Create the [`dojo_sepolia.toml`](https://github.com/rsodre/512karat/blob/main/dojo/dojo_sepolia.toml) dojo config file, with the same contents of [`dojo_dev.toml`](https://github.com/rsodre/512karat/blob/main/dojo/dojo_dev.toml), except for `[env]`, in which we're going to expose the `world_address` only: +- Create the [`dojo_sepolia.toml`](https://github.com/rsodre/512karat/blob/main/dojo/dojo_sepolia.toml) dojo config file, with the same contents of [`dojo_dev.toml`](https://github.com/rsodre/512karat/blob/main/dojo/dojo_dev.toml), except for `[env]`, in which we are going to expose the `world_address` only: ```toml [env] @@ -53,11 +53,13 @@ SN_SEPOLIA # world_address = "" ``` -- It's recommended to keep the `world_address` empty, on the first deployment it will be outputed by the deployment script. Then you should expose it. +- It is recommended to keep the `world_address` empty, on the first deployment it will be outputed by the deployment script. +Then you should expose it. - Clone the [`dev`](https://github.com/rsodre/512karat/blob/main/dojo/overlays/dev/) overlays to [`sepolia`](https://github.com/rsodre/512karat/blob/main/dojo/overlays/sepolia/) -- Create `.env.sepolia` containing your RPC provider, account and private key. Make sure that account is deployed and has some [ETH](https://starknet-faucet.vercel.app) in it (0.001 is more than enough). +- Create `.env.sepolia` containing your RPC provider, account and private key. +Make sure that account is deployed and has some [ETH](https://starknet-faucet.vercel.app) in it (0.001 is more than enough). ```bash # usage: source .env.sepolia @@ -109,7 +111,7 @@ sozo -P sepolia migrate echo "Deployment completed successfully." ``` -- For this script to work don't forget to give it execution permissions: +- For this script to work do not forget to give it execution permissions: `chmod +x .sh` - This localises the env variables to the deployment script, so if for any reason the deployment is aborted, it cleans up the env variables. @@ -133,7 +135,7 @@ This will yield a different world address. Your world is deployed! -- Once the world is deployed, you need to add the world*block in the `dojo*.toml` file. +- Once the world is deployed, you need to add the world_block in the `dojo_.toml` file. ```toml rpc_url = "https://api.cartridge.gg/x/starknet/mainnet" @@ -145,9 +147,10 @@ world_block = 42069 # Here you add the block number where the world was deployed ### Torii Indexer -Now, if you're building a Dojo client, you will need a Torii service to index our world... +Now, if you are building a Dojo client, you will need a Torii service to index our world... -- Install [slot](https://github.com/cartridge-gg/slot) or update it. You can find the docs [here](https://docs.cartridge.gg/slot/getting-started). +- Install [slot](https://github.com/cartridge-gg/slot) or update it. +You can find the docs [here](https://docs.cartridge.gg/slot/getting-started). ```bash slotup @@ -170,14 +173,16 @@ rpc = "" ``` - Create Torii service with this command, replacing... - - `SERVICE_NAME` can be the name of the game/dapp. Once you create it, you own that name. + - `SERVICE_NAME` can be the name of the game/dapp. +Once you create it, you own that name. - `DOJO_VERSION`: your Dojo version (ex: `v1.0.1`) ```bash slot deployments create torii --config torii.toml --version ``` -- slot will output something like this. Save it for later, you will need the endpoints on your client. +- slot will output something like this. +Save it for later, you will need the endpoints on your client. ``` Deployment success 🚀 @@ -185,7 +190,8 @@ Deployment success 🚀 Stream logs with `slot deployments logs torii -f` ``` -- If for any reasons we need to recreate Torii, we can just delete it and run the create command again. This is safe, all your data is on-chain. +- If for any reasons we need to recreate Torii, we can just delete it and run the create command again. +This is safe, all your data is on-chain. ```bash slot deployments delete torii @@ -195,7 +201,8 @@ slot deployments delete torii - The `migrate` script is copying manifests to `/client/src/dojo/generated/`, each chain needs to use their own manifest! -- The client needs the env variable `VITE_PUBLIC_CHAIN_ID` to be set to your chain id. Configure on your sever and add it to your `.env` to access your deployment localy: +- The client needs the env variable `VITE_PUBLIC_CHAIN_ID` to be set to your chain id. +Configure on your sever and add it to your `.env` to access your deployment localy: ``` VITE_PUBLIC_CHAIN_ID=SN_SEPOLIA @@ -209,7 +216,8 @@ VITE_PUBLIC_CHAIN_ID=SN_MAIN ### Debug with Walnut -Use [Walnut](https://walnut.dev) to debug your on-chain transactions on Mainnet, Sepolia, or Slot deployments. Walnut helps you inspect transaction details, understand execution flow, and troubleshoot issues. +Use [Walnut](https://walnut.dev) to debug your on-chain transactions on Mainnet, Sepolia, or Slot deployments. +Walnut helps you inspect transaction details, understand execution flow, and troubleshoot issues. #### Step 1: Verify your Contracts @@ -219,7 +227,7 @@ To use full debugging capabilities, first verify your contracts using Walnut: sozo walnut verify ``` -You'll see output similar to: +You will see output similar to: ```console 🌰 Verifying classes with Walnut... diff --git a/docs/pages/tutorials/deploy-using-slot/main.md b/docs/pages/tutorials/deploy-using-slot/main.md index 4d1e5c4d..93bf06f4 100644 --- a/docs/pages/tutorials/deploy-using-slot/main.md +++ b/docs/pages/tutorials/deploy-using-slot/main.md @@ -7,14 +7,14 @@ description: Learn how to deploy your Dojo project using Slot, including authent # Deploy your game using Slot -Welcome to this tutorial where we'll guide you through deploying a project using the Slot. +Welcome to this tutorial where we will guide you through deploying a project using the Slot. --- Before we start, make sure you are using the latest dojo version. Run `dojoup` to have the latest version installed. -Now, let's create a new project and initialize it with sozo. +Now, let us create a new project and initialize it with sozo. ```bash sozo init dojo-starter && cd dojo-starter @@ -77,7 +77,7 @@ To build the project, run the following command: sozo build ``` -Now, let's migrate the project to our new development network: +Now, let us migrate the project to our new development network: ```bash sozo migrate diff --git a/docs/pages/tutorials/dojo-react.mdx b/docs/pages/tutorials/dojo-react.mdx index 2dbd04c4..024e7325 100644 --- a/docs/pages/tutorials/dojo-react.mdx +++ b/docs/pages/tutorials/dojo-react.mdx @@ -1 +1,278 @@ -# Dojo React +## Dojo React + +This tutorial will guide you through building a simple React application that interacts with a Dojo world. +We will create a basic counter application where users can increment and decrement a value stored on-chain. + +## Prerequisites + +Before starting this tutorial, make sure you have: + +- Node.js (version 14 or higher) +- Basic knowledge of React and TypeScript +- A Dojo world set up (you can use the example world from the Dojo Book) + +## Setting up the React Application + +First, let us create a new React application using Vite: + +```bash +npm create vite@latest dojo-react-app -- --template react-ts +cd dojo-react-app +npm install +``` + +Now, let us install the necessary Dojo dependencies: + +```bash +npm install @dojoengine/core @dojoengine/state @dojoengine/utils +``` + +## Configuring the Dojo Client + +Create a new file `src/dojo.ts` to configure your Dojo client: + +```typescript +import { DojoConfig } from "@dojoengine/core"; + +export const dojoConfig: DojoConfig = { + rpcUrl: "http://localhost:5050", + toriiUrl: "http://localhost:8080", + relayUrl: "", + worldAddress: "0x...", // Replace with your world address + masterAddress: "0x...", // Replace with your master address + masterPrivateKey: "0x...", // Replace with your master private key +}; +``` + +## Creating the Counter Component + +Let us create a counter component that interacts with our Dojo world. +First, create a file `src/Counter.tsx`: + +```tsx +import React, { useState, useEffect } from 'react'; +import { useDojoStore } from '@dojoengine/state'; +import { useDojo } from './hooks/useDojo'; + +interface CounterProps { + entityId: string; +} + +export const Counter: React.FC = ({ entityId }) => { + const [count, setCount] = useState(0); + const { account, execute } = useDojo(); + const entities = useDojoStore((state) => state.entities); + + useEffect(() => { + // Get the counter value from the store + const entity = entities[entityId]; + if (entity && entity.models.Counter) { + setCount(entity.models.Counter.value); + } + }, [entities, entityId]); + + const increment = async () => { + try { + await execute('increment', []); + console.log('Counter incremented successfully'); + } catch (error) { + console.error('Failed to increment counter:', error); + } + }; + + const decrement = async () => { + try { + await execute('decrement', []); + console.log('Counter decremented successfully'); + } catch (error) { + console.error('Failed to decrement counter:', error); + } + }; + + return ( +
+

Counter: {count}

+
+ + +
+
+ ); +}; +``` + +## Creating Custom Hooks + +Create a custom hook to manage Dojo interactions. +Create a file `src/hooks/useDojo.ts`: + +```typescript +import { useMemo } from 'react'; +import { DojoProvider } from '@dojoengine/core'; +import { BurnerManager } from '@dojoengine/create-burner'; +import { dojoConfig } from '../dojo'; + +export const useDojo = () => { + const dojoProvider = useMemo(() => { + return new DojoProvider(dojoConfig); + }, []); + + const burnerManager = useMemo(() => { + return new BurnerManager({ + masterAccount: dojoProvider.masterAccount, + accountClassHash: dojoConfig.accountClassHash, + rpcProvider: dojoProvider.provider, + }); + }, [dojoProvider]); + + const execute = async (systemCall: string, calldata: any[]) => { + const account = burnerManager.getActiveAccount(); + if (!account) { + throw new Error('No active account'); + } + + return await dojoProvider.execute(account, systemCall, calldata); + }; + + return { + dojoProvider, + burnerManager, + account: burnerManager.getActiveAccount(), + execute, + }; +}; +``` + +## Setting up the Main App Component + +Update your `src/App.tsx` file: + +```tsx +import React, { useEffect } from 'react'; +import { DojoProvider } from '@dojoengine/state'; +import { Counter } from './Counter'; +import { useDojo } from './hooks/useDojo'; +import { dojoConfig } from './dojo'; +import './App.css'; + +function App() { + const { dojoProvider } = useDojo(); + + useEffect(() => { + // Initialize the Dojo provider + dojoProvider.init().then(() => { + console.log('Dojo provider initialized'); + }).catch((error) => { + console.error('Failed to initialize Dojo provider:', error); + }); + }, [dojoProvider]); + + return ( + +
+
+

Dojo React Counter

+ +
+
+
+ ); +} + +export default App; +``` + +## Styling the Application + +Add some basic styles to `src/App.css`: + +```css +.App { + text-align: center; +} + +.App-header { + background-color: #282c34; + padding: 20px; + color: white; + min-height: 100vh; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} + +.counter { + margin: 20px 0; +} + +.counter h2 { + margin-bottom: 20px; + font-size: 2em; +} + +.counter-buttons { + display: flex; + gap: 10px; + justify-content: center; +} + +.counter-buttons button { + padding: 10px 20px; + font-size: 1em; + border: none; + border-radius: 5px; + cursor: pointer; + background-color: #61dafb; + color: black; + transition: background-color 0.3s; +} + +.counter-buttons button:hover { + background-color: #21a9c7; + color: white; +} +``` + +## Running the Application + +Before running your React application, make sure your Dojo world is running: + +```bash +# In your Dojo project directory +sozo build +katana --disable-fee +sozo migrate +torii --world 0x... # Replace with your world address +``` + +Now you can run your React application: + +```bash +# In your React app directory +npm run dev +``` + +Your application should now be running at `http://localhost:5173`. + +## Understanding the Integration + +This tutorial demonstrates several key concepts: + +1. **Configuration**: We set up the Dojo configuration with RPC and Torii URLs +2. **State Management**: We use the Dojo state management to sync with the blockchain +3. **Account Management**: We use burner accounts for easy testing +4. **System Execution**: We execute Dojo systems from React components +5. **Real-time Updates**: The UI automatically updates when the blockchain state changes + +## Next Steps + +You can extend this application by: + +- Adding more complex game logic +- Implementing user authentication +- Adding error handling and loading states +- Creating more sophisticated UI components +- Integrating with wallet providers + +For more advanced features and patterns, check out the official Dojo documentation and examples. diff --git a/docs/pages/tutorials/dojo-starter.mdx b/docs/pages/tutorials/dojo-starter.mdx index 6e2d0c0c..b32d7048 100644 --- a/docs/pages/tutorials/dojo-starter.mdx +++ b/docs/pages/tutorials/dojo-starter.mdx @@ -8,24 +8,27 @@ import { LinkCard } from "../../components/LinkCard"; # Dojo 101 Tutorial :::note -This section assumes that you have already installed the Dojo toolchain and are familiar with Cairo. If not, please refer to the [installation](/installation) section and the [Cairo book](https://book.cairo-lang.org). +This section assumes that you have already installed the Dojo toolchain and are familiar with Cairo. +If not, please refer to the [installation](/installation) section and the [Cairo book](https://book.cairo-lang.org). ::: ## Dojo in 15 minutes or less -To start, let's create a new project to run locally on your machine. +To start, let us create a new project to run locally on your machine. ```bash sozo init dojo-starter ``` -Congratulations! You now have a local Dojo project! +Congratulations! +You now have a local Dojo project! -This command creates a `dojo-starter` project in your current directory from the [Dojo starter template](https://github.com/dojoengine/dojo-starter). It's the ideal starting point for a new project and equips you with everything you need to begin hacking. +This command creates a `dojo-starter` project in your current directory from the [Dojo starter template](https://github.com/dojoengine/dojo-starter). +It is the ideal starting point for a new project and equips you with everything you need to begin hacking. ### Anatomy of a Dojo Project -Inspect the contents of the `dojo-starter` project, and you'll notice the following structure (excluding the non-Cairo files): +Inspect the contents of the `dojo-starter` project, and you will notice the following structure (excluding the non-Cairo files): ```bash ├── Scarb.toml @@ -35,7 +38,7 @@ Inspect the contents of the `dojo-starter` project, and you'll notice the follow ├── lib.cairo ├── models.cairo ├── systems - │   └── actions.cairo + │ └── actions.cairo └── tests └── test_world.cairo ``` @@ -63,13 +66,16 @@ struct Moves { Notice the `#[dojo::model]` attribute. -For a model to be recognized, we _must_ add this attribute to a Cairo struct. This tells to the Dojo compiler that this struct should be treated as a model. +For a model to be recognized, we _must_ add this attribute to a Cairo struct. +This tells to the Dojo compiler that this struct should be treated as a model. ### Understanding the `#[key]` Attribute in the Moves Model -Our Moves model includes a `player` field, which is crucial for how Dojo manages and queries data. Models act like structured database entries, managing and organizing your onchain data. Like a regular ORM - but onchain! +Our Moves model includes a `player` field, which is crucial for how Dojo manages and queries data. +Models act like structured database entries, managing and organizing your onchain data. +Like a regular ORM - but onchain! -Next, lets have a look at the `src/models/position.cairo` file. +Next, let us have a look at the `src/models/position.cairo` file. ```rust // ... @@ -95,7 +101,8 @@ struct Vec2 { // ... ``` -The `Position` model, like `Moves`, is indexed by the `player` field and includes a `Vec2` struct for x and y coordinates. Models can contain any Cairo struct that derives the [`Introspect`](/framework/models/introspection) trait, which allows the compiler to introspect the struct and generate the necessary code to interact with it. +The `Position` model, like `Moves`, is indexed by the `player` field and includes a `Vec2` struct for x and y coordinates. +Models can contain any Cairo struct that derives the [`Introspect`](/framework/models/introspection) trait, which allows the compiler to introspect the struct and generate the necessary code to interact with it.
dojo::world::WorldStorage { self.world(@"dojo_starter") } @@ -227,7 +234,8 @@ fn next_position(mut position: Position, direction: Direction) -> Position { ### Using the `world.write_model` method -Here we use the `world.write_model` method to set the `Moves` and `Position` models for the `player` entity. This method is used to update the world state with the new data. +Here we use the `world.write_model` method to set the `Moves` and `Position` models for the `player` entity. +This method is used to update the world state with the new data. ```rust let moves = Moves { @@ -251,7 +259,8 @@ world.write_model(@moves); />
-We covered a lot here in a short time. Let's recap: +We covered a lot here in a short time. +Let us recap: - Explained the anatomy of a Dojo project - Explained the importance of the `#[dojo::model]`attribute and how models are defined @@ -261,34 +270,45 @@ We covered a lot here in a short time. Let's recap: ## Deploy it locally -Enough theory! Let's build the Dojo project! In your primary terminal: +Enough theory! +Let us build the Dojo project! +In your primary terminal: ```bash sozo build ``` -That compiled the models and systems into artifacts that can be deployed. Simple as that! +That compiled the models and systems into artifacts that can be deployed. +Simple as that! -Now, let's deploy it to [Katana](/toolchain/katana)! First, we need to get Katana running. Open a second terminal and execute: +Now, let us deploy it to [Katana](/toolchain/katana)! +First, we need to get Katana running. +Open a second terminal and execute: ```bash katana --dev --dev.no-fee ``` -Success! [Katana](/toolchain/katana) should now be running locally on your machine. Now, let's inspect the world. In your primary terminal, execute: +Success! +[Katana](/toolchain/katana) should now be running locally on your machine. +Now, let us inspect the world. +In your primary terminal, execute: ```bash sozo inspect ``` -This command provides a preview of your World's state and contract addresses. It performs a read-only comparison between local and remote resources without sending any transactions. -Now, let's deploy! In your primary terminal, execute: +This command provides a preview of your World's state and contract addresses. +It performs a read-only comparison between local and remote resources without sending any transactions. +Now, let us deploy! +In your primary terminal, execute: ```bash sozo migrate ``` -This command will deploy the artifact to `Katana`. You should see terminal output similar to this: +This command will deploy the artifact to `Katana`. +You should see terminal output similar to this: ```console profile | chain_id | rpc_url @@ -303,7 +323,8 @@ Your 🌎 is now deployed at `0x06171ed98331e849d6084bf2b3e3186a7ddf35574dd68cab This establishes the world address for your project. -Let's discuss the `Scarb.toml` file in the project. This file contains environment variables that make running CLI commands in your project a breeze (read more about it [here](/framework/configuration)). +Let us discuss the `Scarb.toml` file in the project. +This file contains environment variables that make running CLI commands in your project a breeze (read more about it [here](/framework/configuration)). ```toml [scripts] @@ -312,7 +333,8 @@ spawn = "sozo execute dojo_starter-actions spawn --wait" # scarb run spawn move = "sozo execute dojo_starter-actions move -c 1 --wait" # scarb run move ``` -At the same time, make sure your file specifies the version of Dojo you have installed! In this case version `v1.0.0`. +At the same time, make sure your file specifies the version of Dojo you have installed! +In this case version `v1.0.0`. ```toml [dependencies] @@ -321,13 +343,19 @@ dojo = "1.8.0" ## Indexing -With your local world address established, let's delve into indexing. You can index the entire world. To accomplish this we have to copy your `world address` from the output of `sozo migrate`. Now Open a new terminal and input this simple command that includes your own world address: +With your local world address established, let us delve into indexing. +You can index the entire world. +To accomplish this we have to copy your `world address` from the output of `sozo migrate`. +Now Open a new terminal and input this simple command that includes your own world address: ```bash torii --world 0xb4079627ebab1cd3cf9fd075dda1ad2454a7a448bf659591f259efa2519b18 --http.cors_origins "*" ``` -Running the command mentioned above starts a [Torii](/toolchain/torii) server on your local machine. This server uses SQLite as its database and is accessible at http://0.0.0.0:8080/graphql. `Torii` will automatically organize your data into tables, making it easy for you to perform queries using GraphQL. When you run the command, you'll see terminal output that looks something like this: +Running the command mentioned above starts a [Torii](/toolchain/torii) server on your local machine. +This server uses SQLite as its database and is accessible at http://0.0.0.0:8080/graphql. +`Torii` will automatically organize your data into tables, making it easy for you to perform queries using GraphQL. +When you run the command, you will see terminal output that looks something like this: ```console 2024-06-14T04:38:33.450886Z INFO torii::relay::server: Relay peer id. peer_id=12D3KooWNJYDBVvnrWgi6QeVaQr6TZMEgJNni51UhZVGw1is4i9P @@ -365,7 +393,8 @@ You can observe that our `Moves` and `Position` models have been successfully re ### GraphQL Queries -Next, let's use the GraphQL IDE to retrieve data from all the models that have been registered. In your web browser, navigate to `http://localhost:8080/graphql`, and enter the following query: +Next, let us use the GraphQL IDE to retrieve data from all the models that have been registered. +In your web browser, navigate to `http://localhost:8080/graphql`, and enter the following query: ```graphql query { @@ -429,7 +458,8 @@ After you run the query, you will receive an output like this: } ``` -Awesome, now let's work with subscriptions to get real-time updates. Let's clean up your workspace on the GraphQL IDE and input the following subscription: +Awesome, now let us work with subscriptions to get real-time updates. +Let us clean up your workspace on the GraphQL IDE and input the following subscription: ```graphql subscription { @@ -443,15 +473,17 @@ subscription { } ``` -Once you execute the subscription, you will receive notifications whenever new entities are updated or created. For now, don't make any changes to it, and proceed to create a new entities. +Once you execute the subscription, you will receive notifications whenever new entities are updated or created. +For now, do not make any changes to it, and proceed to create a new entities. -To accomplish this, we have to execute `spawn` function from `actions` contract. In your main local terminal, run the following command: +To accomplish this, we have to execute `spawn` function from `actions` contract. +In your main local terminal, run the following command: ```bash sozo execute dojo_starter-actions spawn ``` -By running this command, you've executed the spawn system, resulting in the creation of a new entity. +By running this command, you have executed the spawn system, resulting in the creation of a new entity. Now, go back to your GraphQL IDE, and you will notice that you have received the subscription's results, which should look something like this: @@ -485,9 +517,12 @@ Now, go back to your GraphQL IDE, and you will notice that you have received the } ``` -In the GraphQL IDE, by clicking the `DOCS`-button on the right, you can open the API documentation. This documentation is auto-generated based on our schema definition and displays all API operations and data types of our schema. In order to know more about query and subscription, you can jump to [GraphQL](/toolchain/torii/graphql) section. +In the GraphQL IDE, by clicking the `DOCS`-button on the right, you can open the API documentation. +This documentation is auto-generated based on our schema definition and displays all API operations and data types of our schema. +In order to know more about query and subscription, you can jump to [GraphQL](/toolchain/torii/graphql) section. -We've covered quite a bit! Here's a recap: +We have covered quite a bit! +Here is a recap: - Built a Dojo world - Deployed the project to Katana @@ -497,7 +532,10 @@ We've covered quite a bit! Here's a recap: ### Next Steps -This overview provides a rapid end-to-end glimpse of Dojo. However, the potential of these worlds is vast! Designed to manage hundreds of systems and models, Dojo is equipped for expansive creativity. So, what will you craft next? +This overview provides a rapid end-to-end glimpse of Dojo. +However, the potential of these worlds is vast! +Designed to manage hundreds of systems and models, Dojo is equipped for expansive creativity. +So, what will you craft next?
Every square of the chess board (e.g., A1) will be treated as an entity. If a piece exists on a square position, that position will hold that piece. First, add this basic `player` model to `models/player.cairo` file. -If you are not familar with model syntax in Dojo engine, go back to this [chapter](/framework/models). +If you are not familiar with model syntax in Dojo engine, go back to this [chapter](/framework/models). ```rust use starknet::ContractAddress; @@ -201,8 +201,8 @@ It should be noted that systems function are contract methods, by implication, r Now try `sozo build` to build. -Complied? -Great! then let's move on. +Compiled? +Great! then let us move on. If not fix the issues, so that you can run the `sozo build` command successfully. ## Implement Traits for models @@ -228,7 +228,8 @@ fn is_right_piece_move(self: @Piece, next_position: Vec2) -> bool; } ``` -Try to implement this code by yourself. Otherwise +Try to implement this code by yourself. +Otherwise
Click to see full `models.cairo` code @@ -334,4 +335,4 @@ impl PieceImpl of PieceTrait { This tutorial is extracted from [here](https://github.com/dojoengine/origami/tree/main/examples/chess) Congratulations! -You've completed the basic setup for building an onchain chess game 🎉 +You have completed the basic setup for building an onchain chess game 🎉 diff --git a/docs/pages/tutorials/onchain-chess/1-action.md b/docs/pages/tutorials/onchain-chess/1-action.md index eca2a161..13c6384e 100644 --- a/docs/pages/tutorials/onchain-chess/1-action.md +++ b/docs/pages/tutorials/onchain-chess/1-action.md @@ -10,7 +10,7 @@ This chapter will address implementing `actions.cairo`, which spawns the game an ## What is `actions` contract? To play chess, you need to start game, spawn the pieces, and move around the board. -The `actions` contract has two dominant functions `spawn` function which spawns the game entity, places each piece in its proper position on the board and returns the game_id, and the `move` funtion which allows pieces to be moved around the board. +The `actions` contract has two dominant functions `spawn` function which spawns the game entity, places each piece in its proper position on the board and returns the game_id, and the `move` function which allows pieces to be moved around the board.

image diff --git a/docs/pages/tutorials/onchain-chess/3-test.md b/docs/pages/tutorials/onchain-chess/3-test.md index a8f40821..a36860bb 100644 --- a/docs/pages/tutorials/onchain-chess/3-test.md +++ b/docs/pages/tutorials/onchain-chess/3-test.md @@ -5,9 +5,9 @@ description: Learn how to write integration tests for your onchain chess game, i # 3 Test Contract -In this chapter, we'll use everything we've learned to run a full chess game scenario. +In this chapter, we will use everything we have learned to run a full chess game scenario. -Here's what we'll do in our test: +Here is what we will do in our test: 1. Call spawn to setup `white_pawn` to (0,1) and `black_pawn` to (1,6) 2. Move `white_pawn` to (0,3) @@ -92,16 +92,16 @@ mod tests { } ``` -Keep moving pieces and checking if they're in the right places. +Keep moving pieces and checking if they are in the right places. ## Congratulations! -You've made the basic contracts for a chess game using the Dojo engine! +You have made the basic contracts for a chess game using the Dojo engine! This tutorial was just the beginning. There are many ways to make the game better, like optimizing parts, adding checks, or considering special cases. If you want to do more with this chess game, try these challenges: -- Add a checkmate feature. Our game doesn't end now, so decide when it should! +- Add a checkmate feature. Our game does not end now, so decide when it should! - Include special moves like castling, En Passant Capture, or Pawn Promotion. - Make your own chess rules! You could even create your own version of the [immortal game](https://immortal.game/) diff --git a/docs/pages/tutorials/onchain-chess/README.md b/docs/pages/tutorials/onchain-chess/README.md index 32668c7b..f75c563a 100644 --- a/docs/pages/tutorials/onchain-chess/README.md +++ b/docs/pages/tutorials/onchain-chess/README.md @@ -2,15 +2,20 @@ _"I just finished reading The Dojo Book. What should I do next?"_ -The answers to this question are always "Make something!", sometimes followed by a list of cool projects. This is a great answer for some people, but others might be looking for a little more direction. +The answers to this question are always "Make something!", sometimes followed by a list of cool projects. +This is a great answer for some people, but others might be looking for a little more direction. -This guide is intended to fill the gap between heavily directed beginner tutorials and working on your projects. The primary goal here is to get you to write code. The secondary goal is to get you reading documentation. +This guide is intended to fill the gap between heavily directed beginner tutorials and working on your projects. +The primary goal here is to get you to write code. +The secondary goal is to get you reading documentation. -If you haven't read the Dojo Book yet, it is highly encouraged for you to do so before starting this project. +If you have not read the Dojo Book yet, it is highly encouraged for you to do so before starting this project. ## What are we building? -We're building an on-chain chess game contract that lets you start a new game and play chess. This guide does not cover every rules of the chess game. You will build step by step as follows: +We are building an on-chain chess game contract that lets you start a new game and play chess. +This guide does not cover every rules of the chess game. +You will build step by step as follows: 1. A system contract to spawn all the chess pieces 2. A system contract to make pieces move @@ -19,10 +24,15 @@ We're building an on-chain chess game contract that lets you start a new game an The full code of tutorial is based on [this repo](https://github.com/dojoengine/origami/tree/main/examples/chess). -If this seems too hard, don't worry! This guide is for beginners. If you know some basics about Cairo and Dojo, you're good. We won't make a full chess game with all the rules. We're keeping it simple. +If this seems too hard, do not worry! +This guide is for beginners. +If you know some basics about Cairo and Dojo, you are good. +We will not make a full chess game with all the rules. +We are keeping it simple. ## What after this guide? -We're making another guide to help design the frontend. This will make our chess game complete. +We are making another guide to help design the frontend. +This will make our chess game complete. After you finish all the four chapters, we can move on to the frontend guide. diff --git a/docs/pages/tutorials/react.mdx b/docs/pages/tutorials/react.mdx index 1d05f556..aef08c08 100644 --- a/docs/pages/tutorials/react.mdx +++ b/docs/pages/tutorials/react.mdx @@ -7,7 +7,8 @@ import { LinkCard } from "../../components/LinkCard"; ### Quickstart with React -Concise. Get started with Dojo in minutes. +Concise. +Get started with Dojo in minutes. This assumes knowledge of React and the Dojo CLI. @@ -36,7 +37,8 @@ sozo build sozo migrate ``` -From the `sozo migrate` command output, find the deployed world address. For example: +From the `sozo migrate` command output, find the deployed world address. +For example: ```log profile | chain_id | rpc_url @@ -74,11 +76,13 @@ pnpm i pnpm dev ``` -Visit `http://localhost:5173` to view the project. You should now see the project connected to the network and indexed! +Visit `http://localhost:5173` to view the project. +You should now see the project connected to the network and indexed! ### Next Steps -This should have given you a good starting point to build your first application with Dojo. Here are some next steps to take: +This should have given you a good starting point to build your first application with Dojo. +Here are some next steps to take:

Date: Mon, 30 Mar 2026 19:14:01 +0000 Subject: [PATCH 2/2] =?UTF-8?q?chore(defrag):=20phase=202b=20=E2=80=94=20t?= =?UTF-8?q?erminology?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Proper noun capitalization, hyphenation. - tutorials/advanced.mdx - tutorials/deploy-to-mainnet/main.md - tutorials/deploy-using-slot/main.md - tutorials/dojo-react.mdx - tutorials/dojo-starter.mdx - tutorials/katana-starkli-scarb/main.md - tutorials/onchain-chess/0-setup.md - tutorials/onchain-chess/1-action.md - tutorials/onchain-chess/README.md - tutorials/react.mdx --- docs/pages/client/sdk/bevy.md | 2 -- docs/pages/client/sdk/c/index.mdx | 2 +- docs/pages/client/sdk/javascript.md | 2 +- docs/pages/client/sdk/telegram.md | 2 +- docs/pages/client/sdk/unity.md | 18 +++++----- docs/pages/framework/configuration/index.md | 2 +- docs/pages/framework/models/index.md | 2 +- docs/pages/framework/models/introspection.md | 4 +-- docs/pages/framework/systems/index.md | 2 +- docs/pages/framework/upgrading/dojo-1-0.md | 22 ++++++------ docs/pages/framework/upgrading/dojo-1-7.md | 2 +- docs/pages/framework/upgrading/index.md | 34 +++++++++---------- docs/pages/framework/world/metadata.md | 10 +++--- docs/pages/framework/world/permissions.md | 4 +-- docs/pages/getting-started/index.mdx | 4 +-- docs/pages/getting-started/next-steps.mdx | 4 +-- docs/pages/libraries/alexandria/index.mdx | 20 +++++------ docs/pages/toolchain/katana/advanced.md | 2 +- docs/pages/toolchain/katana/index.md | 20 +++++------ docs/pages/toolchain/saya/persistent.md | 2 +- docs/pages/toolchain/sozo/index.md | 2 +- .../toolchain/sozo/project-management.md | 2 +- docs/pages/toolchain/torii/grpc.md | 2 +- docs/pages/toolchain/torii/index.md | 6 ++-- docs/pages/toolchain/torii/sql.md | 2 +- docs/pages/tutorials/advanced.mdx | 2 +- .../pages/tutorials/deploy-to-mainnet/main.md | 10 +++--- .../pages/tutorials/deploy-using-slot/main.md | 6 ++-- docs/pages/tutorials/dojo-react.mdx | 2 +- docs/pages/tutorials/dojo-starter.mdx | 4 +-- .../tutorials/katana-starkli-scarb/main.md | 4 +-- docs/pages/tutorials/onchain-chess/0-setup.md | 2 +- .../pages/tutorials/onchain-chess/1-action.md | 2 +- docs/pages/tutorials/onchain-chess/README.md | 2 +- docs/pages/tutorials/react.mdx | 6 ++-- 35 files changed, 106 insertions(+), 108 deletions(-) diff --git a/docs/pages/client/sdk/bevy.md b/docs/pages/client/sdk/bevy.md index 4afb6f62..cd75bbf2 100644 --- a/docs/pages/client/sdk/bevy.md +++ b/docs/pages/client/sdk/bevy.md @@ -1,5 +1,3 @@ -## File to edit: client/sdk/bevy.md - --- title: "Dojo Bevy SDK" description: "Official Bevy engine integration for building Dojo-powered games with native Rust performance" diff --git a/docs/pages/client/sdk/c/index.mdx b/docs/pages/client/sdk/c/index.mdx index 24b61a7e..07e650c7 100644 --- a/docs/pages/client/sdk/c/index.mdx +++ b/docs/pages/client/sdk/c/index.mdx @@ -23,7 +23,7 @@ Implementing in Rust provides the following advantages: - **Memory Safety**: Eliminates classes of bugs (buffer overflows, use-after-free, etc.) - **Performance**: Zero-cost abstractions compile to optimal machine code - **Concurrency**: Safe async/await and threading without data races -- **Ecosystem**: Built on battle-tested Rust libraries (tokio, serde, starknet-rs) +- **Ecosystem**: Built on battle-tested Rust libraries (tokio, serde, Starknet-rs) - **Cross-Platform**: Single codebase compiles to all target platforms ``` diff --git a/docs/pages/client/sdk/javascript.md b/docs/pages/client/sdk/javascript.md index dbabb8b0..47145ba3 100644 --- a/docs/pages/client/sdk/javascript.md +++ b/docs/pages/client/sdk/javascript.md @@ -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). ::: diff --git a/docs/pages/client/sdk/telegram.md b/docs/pages/client/sdk/telegram.md index f4fce01a..db1956e5 100644 --- a/docs/pages/client/sdk/telegram.md +++ b/docs/pages/client/sdk/telegram.md @@ -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. diff --git a/docs/pages/client/sdk/unity.md b/docs/pages/client/sdk/unity.md index c9f2808e..d1238c37 100644 --- a/docs/pages/client/sdk/unity.md +++ b/docs/pages/client/sdk/unity.md @@ -9,7 +9,7 @@ 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 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. +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 @@ -58,7 +58,7 @@ 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 @@ -66,13 +66,13 @@ To get started with the dojo.unity SDK, follow these steps: 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` @@ -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: diff --git a/docs/pages/framework/configuration/index.md b/docs/pages/framework/configuration/index.md index db17c942..37aff98a 100644 --- a/docs/pages/framework/configuration/index.md +++ b/docs/pages/framework/configuration/index.md @@ -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" diff --git a/docs/pages/framework/models/index.md b/docs/pages/framework/models/index.md index b91e2d69..054e4c42 100644 --- a/docs/pages/framework/models/index.md +++ b/docs/pages/framework/models/index.md @@ -13,7 +13,7 @@ description: Learn about Dojo models, their role in data storage, key attributes - Use the `#[dojo::model]` attribute to define them. - Models must have at least one key. - Define the key(s) using the `#[key]` attribute. -- Models are Cairo structs with automatic on-chain introspection. +- Models are Cairo structs with automatic onchain introspection. - Custom enums and types are supported if they implement [`Introspect`](./introspection). ## What are models? diff --git a/docs/pages/framework/models/introspection.md b/docs/pages/framework/models/introspection.md index 291dae83..fab07707 100644 --- a/docs/pages/framework/models/introspection.md +++ b/docs/pages/framework/models/introspection.md @@ -200,8 +200,8 @@ impl StatsIntrospect of dojo::meta::introspect::Introspect { ``` :::warning -Use `#[inline(always)]` wisely to avoid hidden bugs during the cairo to sierra compilation. -Usually it is fine to use it with dojo utils functions. +Use `#[inline(always)]` wisely to avoid hidden bugs during the Cairo to sierra compilation. +Usually it is fine to use it with Dojo utils functions. In case you are using a function you do not know the complexity of, you should avoid using it. ::: diff --git a/docs/pages/framework/systems/index.md b/docs/pages/framework/systems/index.md index 12ef581b..20a37224 100644 --- a/docs/pages/framework/systems/index.md +++ b/docs/pages/framework/systems/index.md @@ -169,7 +169,7 @@ mod game_actions { Systems are stateless functions and do not have constructors. However, Dojo contracts support a `dojo_init` function that acts as a constructor-equivalent. -The World calls `dojo_init` on each contract during `sozo migrate`, after the contract is registered. +The World calls `dojo_init` on each contract during `Sozo migrate`, after the contract is registered. ```cairo #[dojo::contract] diff --git a/docs/pages/framework/upgrading/dojo-1-0.md b/docs/pages/framework/upgrading/dojo-1-0.md index ebbecd34..b43b9014 100644 --- a/docs/pages/framework/upgrading/dojo-1-0.md +++ b/docs/pages/framework/upgrading/dojo-1-0.md @@ -18,11 +18,11 @@ Dojo is composed of 5 basic resources: - `event` (namespaced): An event also defines data, but meant to be stored offchain. - `contract` (namespaced): Where you define your business logic, and interact with the world to write/read models and emit events. A function into a contract is called a `System`, which is an entrypoint for users to interact with the world. -Every resource in the world is identified by a dojo selector, a single felt identifier obtained by hashing. +Every resource in the world is identified by a Dojo selector, a single felt identifier obtained by hashing. For human readability, namespaced resources can also be identified by what is called a `Tag`, which is a combination of the namespace and the resource name: `namespace-resource_name`. -The tag can be used to obtain the dojo selector of the resource. +The tag can be used to obtain the Dojo selector of the resource. A single resource can be registered multiple times into the world using different namespaces. @@ -35,7 +35,7 @@ There are only two permissions in Dojo: ## Interacting with the world and its data -First, when you are inside a dojo contract (define with `#[dojo::contract]`), you have to retrieve the world's instance. +First, when you are inside a Dojo contract (define with `#[dojo::contract]`), you have to retrieve the world's instance. As mentioned previously, all the resources are namespaced, so you have to specify the default namespace to use: ```rust @@ -127,9 +127,9 @@ use dojo::world::IWorldDispatcherTrait; fn system_1(ref self: ContractState) { let mut world = self.world(@"ns"); - // A dojo selector is computed from namespace and name. + // A Dojo selector is computed from namespace and name. // The namespace is already set by the `world` instance, - // so we just have to use the dojo name of the contract. + // so we just have to use the Dojo name of the contract. // Every contract has a `dojo_name` function available. let current_contract_selector = world.contract_selector( @self.dojo_name() @@ -162,7 +162,7 @@ struct MyEvent { } ``` -On the torii side, you can start it from the CLI or using a configuration file with the `historical_events` options, by providing tags of events you want to keep historical. +On the Torii side, you can start it from the CLI or using a configuration file with the `historical_events` options, by providing tags of events you want to keep historical. ```bash torii start --events.historical ns-MyEvent,ns-MyOtherEvent --world 0x00e2ea9b5dd9804d13903edf712998943b7d5d606c139dd0f13eeb8f5b84da8d @@ -195,7 +195,7 @@ Before starting to test, here is the flow that `Sozo` follows to migrate a world This is important to keep this in mind, since the testing flow must be similar to the migration flow. Now, let us move on to testing. -First, you have to use the `dojo_cairo_test` crate to use dojo utilities in your tests. +First, you have to use the `dojo_cairo_test` crate to use Dojo utilities in your tests. ```toml # Scarb.toml @@ -291,7 +291,7 @@ world.write_model_test(@m); ## Configuration -The configuration of your dojo project is now fully managed by a dojo configuration file alongside the `Scarb.toml` manifest file. +The configuration of your Dojo project is now fully managed by a Dojo configuration file alongside the `Scarb.toml` manifest file. This ease the profile management and regroup all the functionalities at the same place. You can find detailed information about the configuration file [here](/framework/configuration). @@ -424,7 +424,7 @@ sozo build --profile mainnet sozo migrate --profile mainnet ``` -During the migration, sozo will output the block at which the world has been migrated and the address of the world at the end of the migration: +During the migration, Sozo will output the block at which the world has been migrated and the address of the world at the end of the migration: ```bash 🌍 World deployed at block 821000 with txn hash: 0x038e984efa3e91e045b33d14e63c5e9f765e5a8fe2b3546fc3ab872f608e37a2 @@ -446,9 +446,9 @@ world_address = 0x00e2ea9b5dd9804d13903edf712998943b7d5d606c139dd0f13eeb8f5b84da [Dojo 1.0.0](https://github.com/dojoengine/dojo/releases/tag/v1.0.0) introduces a number of breaking changes. - Macros `set/get/delete` are currently not supported. They may be added again in the future. -- When working with contracts, the `world` is no longer automatically injected. You must use regular starknet interfaces and `self` with `ContractState`. +- When working with contracts, the `world` is no longer automatically injected. You must use regular Starknet interfaces and `self` with `ContractState`. - World's metadata are not uploaded yet, this should be added back soon. -- You must remove `[[target.dojo]]` and use `[[target.starknet-contract]]` instead, not forgetting to add the dojo world in the `build-external-contracts`. +- You must remove `[[target.dojo]]` and use `[[target.starknet-contract]]` instead, not forgetting to add the Dojo world in the `build-external-contracts`. - Overlays files and intermediate manifests that were before produced can be deleted, they are no longer used. - The `Model` API has changed, please refer to the new one [here](https://github.com/dojoengine/dojo/blob/ab081b9fb8444d84aecaba848126f8c64db45eb8/crates/dojo/core/src/model/model.cairo#L31). - Katana has a different CLI arguments, please refer to `katana --help` for more details at the moment. diff --git a/docs/pages/framework/upgrading/dojo-1-7.md b/docs/pages/framework/upgrading/dojo-1-7.md index e0db6072..1dafecbd 100644 --- a/docs/pages/framework/upgrading/dojo-1-7.md +++ b/docs/pages/framework/upgrading/dojo-1-7.md @@ -58,7 +58,7 @@ dojo_cairo_test = "=1.7.0" Also, precompiled proc macros are only available if you are using `1.7.1` or later. Therefore, if you have an issue while compiling the project, ensure that you have rust `1.90` correctly installed locally. -Starting from `1.7.1`, the dojo proc macros are pre-compiled which removes the need of having Cargo installed locally. +Starting from `1.7.1`, the Dojo proc macros are pre-compiled which removes the need of having Cargo installed locally. ::: ## Starknet 0.14.0 diff --git a/docs/pages/framework/upgrading/index.md b/docs/pages/framework/upgrading/index.md index c3031a10..54cb50fc 100644 --- a/docs/pages/framework/upgrading/index.md +++ b/docs/pages/framework/upgrading/index.md @@ -9,12 +9,12 @@ description: An overview of Dojo upgrading guides ### [Dojo 1.x](/framework/upgrading/dojo-1-0) -Dojo's first **major release** in November 2024, which stabilized the Dojo API. +**Dojo's** first **major release** in November 2024, which stabilized the **Dojo** API. -[See the Dojo 1.0.0 release notes.](https://github.com/dojoengine/dojo/releases/tag/v1.0.0) +[See the **Dojo** 1.0.0 release notes.](https://github.com/dojoengine/dojo/releases/tag/v1.0.0) :::note -It is unlikely that a new Dojo developer will need to upgrade from Dojo 0.x +It is unlikely that a new **Dojo** developer will need to upgrade from **Dojo** 0.x ::: ## Minor Releases @@ -23,51 +23,51 @@ It is unlikely that a new Dojo developer will need to upgrade from Dojo 0.x **Dojo 1.7.0 key changes:** -- Stabilizes the use of RPC 0.9 of Starknet. +- Stabilizes the use of RPC 0.9 of **Starknet**. - Introduces a new `DojoStore` trait for model serialization. -[See the Dojo 1.7.0 release notes.](https://github.com/dojoengine/dojo/releases/tag/v1.7.0) +[See the **Dojo** 1.7.0 release notes.](https://github.com/dojoengine/dojo/releases/tag/v1.7.0) ### Dojo 1.6.x **Dojo 1.6.0 key changes:** -- Stabilizes the use of RPC 0.8 of Starknet. +- Stabilizes the use of RPC 0.8 of **Starknet**. -[See the Dojo 1.6.0 release notes.](https://github.com/dojoengine/dojo/releases/tag/v1.6.0) +[See the **Dojo** 1.6.0 release notes.](https://github.com/dojoengine/dojo/releases/tag/v1.6.0) ### Dojo 1.5.x -This release marked the shift from the "monorepo" approach in which Katana and Torii were kept in the Dojo repo, to a multi-repository approach. +This release marked the shift from the "monorepo" approach in which **Katana** and **Torii** were kept in the **Dojo** repo, to a multi-repository approach. As such, this is the first release in which version compatibility became an issue. **Dojo 1.5.1 key changes:** -- Dojo lang: introspection is now correctly handling the unity type when explicitly used in enums variant (()). +- **Dojo** lang: introspection is now correctly handling the unity type when explicitly used in enums variant (()). - World: now that the syscall to get the class hash is supported by the network, using the dns correctly returns the class hash relying on the get_class_hash_at syscall. -[See the Dojo 1.5.1 release notes.](https://github.com/dojoengine/dojo/releases/tag/v1.5.1) +[See the **Dojo** 1.5.1 release notes.](https://github.com/dojoengine/dojo/releases/tag/v1.5.1) **Dojo 1.5.0 key changes:** -- Support for Cairo 2.10 (Dojo lang is still a built-in compiler plugin, no scarbs.xyz at the moment). +- Support for **Cairo** 2.10 (**Dojo** lang is still a built-in compiler plugin, no scarbs.xyz at the moment). - The world now keeps track of the ownership counter on resources. It has a new API to verify the ownership of a resource owners_count. - Signed integers are now fully supported by the introspection. -[See the Dojo 1.5.0 release notes.](https://github.com/dojoengine/dojo/releases/tag/v1.5.0) +[See the **Dojo** 1.5.0 release notes.](https://github.com/dojoengine/dojo/releases/tag/v1.5.0) ## Version Compatibility Guide -Dojo framework versions are tightly coupled with the rest of the toolchain. +**Dojo** framework versions are tightly coupled with the rest of the toolchain. Please consult this guide for release and compatibility information. -| Dojo Version | 1.5.0 | 1.5.1 | 1.6.0 | +| **Dojo** Version | 1.5.0 | 1.5.1 | 1.6.0 | | ------------ | ----- | ----- | ----- | -| Katana | | | | +| **Katana** | | | | | 1.6.3 | ❌ | ❌ | ✅ | | 1.6.2 | ❌ | ❌ | ✅ | | 1.6.1 | ❌ | ❌ | ✅ | @@ -77,7 +77,7 @@ Please consult this guide for release and compatibility information. | 1.5.2 | ✅ | ✅ | ❌ | | 1.5.1 | ✅ | ✅ | ❌ | | 1.5.0 | ✅ | ✅ | ❌ | -| Torii | | | | +| **Torii** | | | | | 1.5.9 | ❌ | ❌ | ✅ | | 1.5.8 | ❌ | ✅ | ✅ | | 1.5.7 | ❌ | ✅ | ✅ | @@ -93,4 +93,4 @@ Please consult this guide for release and compatibility information. Compatibility data drawn from [this file](https://github.com/dojoengine/dojo/blob/main/versions.json). ::: -> For Starknet-wide compatibility information, see the Starknet [version notes](https://docs.starknet.io/learn/cheatsheets/version-notes) and[ compatibility guide](https://docs.starknet.io/learn/cheatsheets/compatibility). +> For **Starknet**-wide compatibility information, see the **Starknet** [version notes](https://docs.starknet.io/learn/cheatsheets/version-notes) and[ compatibility guide](https://docs.starknet.io/learn/cheatsheets/compatibility). diff --git a/docs/pages/framework/world/metadata.md b/docs/pages/framework/world/metadata.md index 9f7afa9e..c8596f93 100644 --- a/docs/pages/framework/world/metadata.md +++ b/docs/pages/framework/world/metadata.md @@ -9,8 +9,8 @@ Dojo supports associating offchain metadata with the **world** and its **resourc This provides additional context about the world and its resources, such as their name, description, icon URI, and more. This enables external services to easily index and distribute worlds and experiences built on them. -During migration, `sozo` automatically manages metadata for you, uploading it to IPFS in `JSON` format and registering it in the world contract through the `ResourceMetadata` Dojo model. -`sozo` does this by parsing the metadata defined in the Dojo profile configuration `dojo_.toml`. +During migration, `Sozo` automatically manages metadata for you, uploading it to IPFS in `JSON` format and registering it in the world contract through the `ResourceMetadata` Dojo model. +`Sozo` does this by parsing the metadata defined in the Dojo profile configuration `dojo_.toml`. ## World Metadata @@ -34,7 +34,7 @@ discord = "https://discord.gg/FB2wR6uF" The toolchain supports the `name`, `description`, `icon_uri`, `cover_uri`, `website` and `socials` attributes by default. `*_uri` attributes can point to an asset in the repo using the `file://` schema or to remote resources using either `ipfs://` or `https://`. -For local assets, `sozo` will upload them to IPFS and replace the corresponding URIs with an IPFS URI. +For local assets, `Sozo` will upload them to IPFS and replace the corresponding URIs with an IPFS URI. Arbitrary social links can be set by adding key-value pairs under the `socials` section. For example, you could add `telegram = "https://t.me/dojoengine"`. @@ -64,7 +64,7 @@ For each type of resource, the toolchain supports the `description` and `icon_ur The `name` of the resource, retrieved from its `tag`, is also stored in the resource metadata. `*_uri` attributes can point to an asset in the repo using the `file://` schema or to remote resources using either `ipfs://` or `https://`. -For local assets, `sozo` will upload them to IPFS and replace the corresponding URIs with an IPFS URI. +For local assets, `Sozo` will upload them to IPFS and replace the corresponding URIs with an IPFS URI. ## IPFS Configuration @@ -85,7 +85,7 @@ Local assets using `file://` URIs will not be processed. ## Technical Implementation -Dojo uses the `ResourceMetadata` model to store metadata on-chain. +Dojo uses the `ResourceMetadata` model to store metadata onchain. This model is [defined in Cairo](https://github.com/dojoengine/dojo/blob/main/crates/dojo/core/src/model/metadata.cairo) as: ```cairo diff --git a/docs/pages/framework/world/permissions.md b/docs/pages/framework/world/permissions.md index 5f901c4c..afdcb77d 100644 --- a/docs/pages/framework/world/permissions.md +++ b/docs/pages/framework/world/permissions.md @@ -388,10 +388,10 @@ description = "Player position model" After migration, you can adjust permissions using the World contract API: ```bash -# Grant writer permission using sozo auth +# Grant writer permission using Sozo auth sozo auth grant writer my_game-Position,my_game-actions -# Grant owner permission using sozo auth +# Grant owner permission using Sozo auth sozo auth grant owner my_game,my_game-admin # Check writer permissions diff --git a/docs/pages/getting-started/index.mdx b/docs/pages/getting-started/index.mdx index c11d6101..ffb63e18 100644 --- a/docs/pages/getting-started/index.mdx +++ b/docs/pages/getting-started/index.mdx @@ -3,8 +3,8 @@ Welcome to Dojo! This learning path will guide you from your first "Hello World" to building and deploying your own provable games and autonomous worlds on Starknet. -Dojo is a comprehensive toolchain for building fully on-chain applications using the Entity Component System (ECS) architecture. -Whether you are new to blockchain development or an experienced smart contract developer, these tutorials will help you understand Dojo's unique approach to on-chain applications. +Dojo is a comprehensive toolchain for building fully onchain applications using the Entity Component System (ECS) architecture. +Whether you are new to blockchain development or an experienced smart contract developer, these tutorials will help you understand Dojo's unique approach to onchain applications. ## Learning Path Overview diff --git a/docs/pages/getting-started/next-steps.mdx b/docs/pages/getting-started/next-steps.mdx index e52671bd..85d90ae8 100644 --- a/docs/pages/getting-started/next-steps.mdx +++ b/docs/pages/getting-started/next-steps.mdx @@ -295,7 +295,7 @@ When you encounter challenges: Building with Dojo is a journey, not a destination. The ecosystem is rapidly evolving, with new patterns, tools, and possibilities emerging regularly. -Whether you are building the next viral on-chain game, creating innovative DeFi mechanisms, or pushing the boundaries of autonomous worlds, you now have the foundation to succeed. +Whether you are building the next viral onchain game, creating innovative DeFi mechanisms, or pushing the boundaries of autonomous worlds, you now have the foundation to succeed. **Ready to build something amazing?** @@ -303,5 +303,5 @@ Whether you are building the next viral on-chain game, creating innovative DeFi - Explore the [tutorials section](/tutorials) for your next learning challenge - Check out the ecosystem showcase for inspiration (Coming Soon) -Welcome to the future of on-chain applications. +Welcome to the future of onchain applications. Let us build something incredible together! 🚀 diff --git a/docs/pages/libraries/alexandria/index.mdx b/docs/pages/libraries/alexandria/index.mdx index 49100a65..34b3ed7c 100644 --- a/docs/pages/libraries/alexandria/index.mdx +++ b/docs/pages/libraries/alexandria/index.mdx @@ -14,13 +14,13 @@ _- George Bernard Shaw_ ## Alexandria -[Alexandria](https://github.com/keep-starknet-strange/alexandria) is a community maintained standard library for Cairo 1.0. -It is a collection of useful algorithms and data structures implemented in Cairo. +[Alexandria](https://github.com/keep-starknet-strange/alexandria) is a community maintained standard library for **Cairo** 1.0. +It is a collection of useful algorithms and data structures implemented in **Cairo**. -Alexandria provides essential building blocks for Cairo and Starknet development, covering mathematics, data structures, algorithms, and utilities that complement Dojo's game development framework. +**Alexandria** provides essential building blocks for **Cairo** and **Starknet** development, covering mathematics, data structures, algorithms, and utilities that complement **Dojo's** game development framework. :::warning -This library is built outside of the Dojo stack development. +This library is built outside of the **Dojo** stack development. There is no online documentation yet but most of the implemented features are referenced in the readme files of the crates. ::: @@ -225,12 +225,12 @@ Advanced numerical operations for scientific computing Cryptographic tree structures for efficient data verification - Binary merkle trees with Pedersen/Poseidon hashing support -- Storage proofs for Starknet state verification +- Storage proofs for **Starknet** state verification - Efficient membership and inclusion proofs ### [Storage](https://github.com/keep-starknet-strange/alexandria/tree/main/packages/storage) -On-chain data structures optimized for Starknet storage patterns +Onchain data structures optimized for **Starknet** storage patterns - Persistent lists with efficient append/prepend operations - Storage-optimized key-value structures for large datasets @@ -248,8 +248,8 @@ Low-level byte manipulation and bit operations JSON parsing and serialization for data interchange -- Deserialize JSON strings into Cairo data structures -- Serialize Cairo structs to JSON format +- Deserialize JSON strings into **Cairo** data structures +- Serialize **Cairo** structs to JSON format - Support for nested objects and arrays ### [Utils](https://github.com/keep-starknet-strange/alexandria/tree/main/packages/utils) @@ -278,11 +278,11 @@ Bitcoin protocol implementations and utilities ## Integration with Dojo -Alexandria complements Dojo's game development framework by providing: +**Alexandria** complements **Dojo's** game development framework by providing: 1. **Mathematical Foundations**: Use `alexandria_math` for game mechanics requiring number theory, cryptography, or advanced calculations 2. **Data Management**: Leverage `alexandria_data_structures` for efficient in-memory data handling in systems 3. **Cross-Chain Interoperability**: Use `alexandria_encoding` for communication with other blockchains or off-chain services 4. **Performance Optimization**: Apply `alexandria_sorting` and `alexandria_searching` for efficient data organization -While Alexandria provides general utilities, developers should also consider [Origami](/libraries/origami) for game-specific primitives and algorithms tailored to onchain game development. +While **Alexandria** provides general utilities, developers should also consider [Origami](/libraries/origami) for game-specific primitives and algorithms tailored to onchain game development. diff --git a/docs/pages/toolchain/katana/advanced.md b/docs/pages/toolchain/katana/advanced.md index ffc5d0df..056b1656 100644 --- a/docs/pages/toolchain/katana/advanced.md +++ b/docs/pages/toolchain/katana/advanced.md @@ -62,7 +62,7 @@ It allows us to: - Ensure state consistency through infrastructure-level control, not by reconciliation (shortcut that typically Sharding execution will solve) Optimistic Katana does not need to roll back any state. -Thanks to the operator whitelisting strategy, only authorized executors can modify the Starknet state of a specified world, ensuring that no conflicts arise between the local optimistic execution and the canonical on-chain result. +Thanks to the operator whitelisting strategy, only authorized executors can modify the Starknet state of a specified world, ensuring that no conflicts arise between the local optimistic execution and the canonical onchain result. This approach delivers near-instant feedback for users while maintaining trust and state consistency across the network. diff --git a/docs/pages/toolchain/katana/index.md b/docs/pages/toolchain/katana/index.md index b8f95b7e..01711fd4 100644 --- a/docs/pages/toolchain/katana/index.md +++ b/docs/pages/toolchain/katana/index.md @@ -7,7 +7,7 @@ description: A high-performance Starknet sequencer designed for rapid developmen # Katana -Katana is a **blazingly fast Starknet sequencer** built for onchain game developers and appchain builders, focusing on **rapid iteration** and **flexible deployment models**. +**Katana** is a **blazingly fast Starknet sequencer** built for onchain game developers and appchain builders, focusing on **rapid iteration** and **flexible deployment models**. :::info Unlike **miners** (who compete to solve puzzles) or **validators** (who verify blocks in consensus), a **sequencer** has singular authority over transaction ordering and block production. @@ -16,19 +16,19 @@ This enables fast finality and predictable performance, making it ideal for appc ## Architecture Overview -Katana follows a **modular, layered architecture** with key components: +**Katana** follows a **modular, layered architecture** with key components: **Backend**: Manages block processing and sequencer state coordination. **Block Producer**: Handles block creation with configurable mining strategies. -**Executor Factory**: Creates Cairo executors using Starknet's **Blockifier**. +**Executor Factory**: Creates **Cairo** executors using **Starknet's** **Blockifier**. **Storage Provider**: Abstracts database access using **Merkle Patricia Tries** via [Bonsai](https://github.com/dojoengine/bonsai-trie). **Transaction Pool**: Multi-stage validation pipeline from submission to block inclusion. -**RPC Server**: Provides standard Starknet APIs plus dev-specific endpoints. +**RPC Server**: Provides standard **Starknet** APIs plus dev-specific endpoints. **Block Explorer**: Browser-based block explorer for easily visualizing sequencer activity @@ -38,19 +38,19 @@ Katana follows a **modular, layered architecture** with key components: **State Forking**: Fork existing networks at any block for testing against live contracts. -**Multi-Settlement**: Designed for Starknet settlement (L3 model) or sovereign operation. +**Multi-Settlement**: Designed for **Starknet** settlement (L3 model) or sovereign operation. **Cairo Native**: Optional ahead-of-time compilation for significant performance gains. :::info -Cairo Native compiles Cairo programs to native machine code via MLIR and LLVM, offering large performance improvements over vanilla VM interpretation. +**Cairo Native** compiles **Cairo** programs to native machine code via MLIR and LLVM, offering large performance improvements over vanilla VM interpretation. This feature must be enabled at compile time with the `native` feature flag and creates additional dependencies. ::: ## Getting Started :::note -Katana requires glibc version 2.33 or higher. +**Katana** requires glibc version 2.33 or higher. It is not available on Ubuntu 20.04 LTS, Debian 10 Buster, CentOS 7, or below. ::: @@ -62,7 +62,7 @@ Start a local development sequencer with pre-funded accounts and instant mining: katana --dev --dev.no-fee ``` -This launches Katana in development mode with: +This launches **Katana** in development mode with: - An RPC server at `http://localhost:5050` - 10 pre-funded accounts @@ -89,7 +89,7 @@ katana --block-time 10000 --db-dir ./katana-db ## Installation -Katana can be installed via [`dojoup`](/installation), our dedicated package manager: +**Katana** can be installed via [`dojoup`](/installation), our dedicated package manager: ```bash curl -L https://install.dojoengine.org | bash @@ -104,7 +104,7 @@ This will install the `katana` binary at `~/.dojo/bin` ::: :::tip -Dojoup automatically synchronizes compatible versions of Dojo, Katana, and Torii +Dojoup automatically synchronizes compatible versions of **Dojo**, **Katana**, and **Torii** ::: ### Installing with `asdf` diff --git a/docs/pages/toolchain/saya/persistent.md b/docs/pages/toolchain/saya/persistent.md index 4ccf1382..709c040c 100644 --- a/docs/pages/toolchain/saya/persistent.md +++ b/docs/pages/toolchain/saya/persistent.md @@ -56,7 +56,7 @@ When working with Katana in provable mode, two additional parameters are require 1. `block-time`: Since every block is proven, it is recommended to use a block time instead of the default mode where a block is mined for each transaction. This prevents overwhelming the prover with too many blocks and ensures consistent proving performance. -2. `block-max-cairo-steps`: In the current implementation of Katana, the default cairo steps limit in a block is `50` million. +2. `block-max-cairo-steps`: In the current implementation of Katana, the default Cairo steps limit in a block is `50` million. For provable mode with Saya, it is recommended to use `16` million to ensure the proving step succeeds reliably. This limit exists due to Cairo VM constraints and proving complexity - larger blocks may fail to prove or timeout. diff --git a/docs/pages/toolchain/sozo/index.md b/docs/pages/toolchain/sozo/index.md index d536cbd5..bcd904ec 100644 --- a/docs/pages/toolchain/sozo/index.md +++ b/docs/pages/toolchain/sozo/index.md @@ -44,7 +44,7 @@ Sozo can automatically discover and work with any deployed Dojo world through bl **Universal Compatibility**: You can use Sozo to interact with worlds deployed by others, inspect unfamiliar world state, or recover from lost local artifacts by rebuilding complete world understanding from chain state. -**Dynamic Schema Detection**: Sozo reconstructs model schemas, system interfaces, and event definitions from on-chain registrations, enabling type-aware interactions with any world. +**Dynamic Schema Detection**: Sozo reconstructs model schemas, system interfaces, and event definitions from onchain registrations, enabling type-aware interactions with any world. ### Migration System diff --git a/docs/pages/toolchain/sozo/project-management.md b/docs/pages/toolchain/sozo/project-management.md index 0e9a290f..b5c7b97c 100644 --- a/docs/pages/toolchain/sozo/project-management.md +++ b/docs/pages/toolchain/sozo/project-management.md @@ -374,7 +374,7 @@ The simplest way to lay out your project is to have a single package where all t With this setup, running `sozo build`, `sozo test`, and `sozo migrate` will work as expected at the root of the project. :::note -If in your project you have other folders (not related to cairo), opening the project at the root is currently not supported by the cairo language server. +If in your project you have other folders (not related to Cairo), opening the project at the root is currently not supported by the Cairo language server. You must have a root `Scarb.toml` file. This issue is being worked on by the Scarb team. diff --git a/docs/pages/toolchain/torii/grpc.md b/docs/pages/toolchain/torii/grpc.md index 2f28333c..4dab7318 100644 --- a/docs/pages/toolchain/torii/grpc.md +++ b/docs/pages/toolchain/torii/grpc.md @@ -12,7 +12,7 @@ It is designed for applications requiring low latency and efficient data fetchin **Endpoint**: `http://localhost:8080` (gRPC protocol) -**Protocol Type Definitions**: [torii/proto/types](https://github.com/dojoengine/torii/blob/main/crates/proto/proto/types.proto) +**Protocol Type Definitions**: [Torii/proto/types](https://github.com/dojoengine/torii/blob/main/crates/proto/proto/types.proto) **Client Libraries**: diff --git a/docs/pages/toolchain/torii/index.md b/docs/pages/toolchain/torii/index.md index 9e668aae..1b097647 100644 --- a/docs/pages/toolchain/torii/index.md +++ b/docs/pages/toolchain/torii/index.md @@ -3,11 +3,11 @@ title: Torii description: Comprehensive indexing engine for Dojo worlds, providing real-time ECS data synchronization and multiple API interfaces for game clients. --- -![torii](/toolchain/torii-icon-word.png) +![Torii](/toolchain/torii-icon-word.png) # Torii -Torii is the official indexing engine for Dojo worlds, designed to provide real-time synchronization between on-chain game state and client applications. +Torii is the official indexing engine for Dojo worlds, designed to provide real-time synchronization between onchain game state and client applications. Built in Rust for performance and reliability, Torii automatically tracks all changes to your game's Entity Component System (ECS) data and makes it accessible through multiple API interfaces. ## Architecture Overview @@ -48,7 +48,7 @@ Torii is designed for production deployment with several performance optimizatio ### Quick Start -Torii leverages world introspection to bootstrap directly from an on-chain deployment. +Torii leverages world introspection to bootstrap directly from an onchain deployment. For local development with [Katana](/toolchain/katana) sequencer: ```bash diff --git a/docs/pages/toolchain/torii/sql.md b/docs/pages/toolchain/torii/sql.md index e2c4a931..363f086e 100644 --- a/docs/pages/toolchain/torii/sql.md +++ b/docs/pages/toolchain/torii/sql.md @@ -127,7 +127,7 @@ These tables require ERC contract configuration #### `controllers` -Cartridge controller integration +Cartridge Controller integration :::info Requires `--indexing.controllers` diff --git a/docs/pages/tutorials/advanced.mdx b/docs/pages/tutorials/advanced.mdx index c98eccbe..bec41e2a 100644 --- a/docs/pages/tutorials/advanced.mdx +++ b/docs/pages/tutorials/advanced.mdx @@ -1 +1 @@ -## File to edit: tutorials/advanced.mdx +I need to see the content of the file `tutorials/advanced.mdx` in order to normalize the terminology according to the rules. Please provide the file content. diff --git a/docs/pages/tutorials/deploy-to-mainnet/main.md b/docs/pages/tutorials/deploy-to-mainnet/main.md index c1f929c7..9b7c2283 100644 --- a/docs/pages/tutorials/deploy-to-mainnet/main.md +++ b/docs/pages/tutorials/deploy-to-mainnet/main.md @@ -10,7 +10,7 @@ The steps for Mainnet are exactly the same, just replace the chain name and ID w ### Setup -- You need a [Starknet RPC Provider](https://www.starknet.io/fullnodes-rpc-services/) to deploy contracts on-chain. +- You need a [Starknet RPC Provider](https://www.starknet.io/fullnodes-rpc-services/) to deploy contracts onchain. You can use the _Cartridge RPC provider_ for this. @@ -43,7 +43,7 @@ SN_SEPOLIA [profile.sepolia] ``` -- Create the [`dojo_sepolia.toml`](https://github.com/rsodre/512karat/blob/main/dojo/dojo_sepolia.toml) dojo config file, with the same contents of [`dojo_dev.toml`](https://github.com/rsodre/512karat/blob/main/dojo/dojo_dev.toml), except for `[env]`, in which we are going to expose the `world_address` only: +- Create the [`dojo_sepolia.toml`](https://github.com/rsodre/512karat/blob/main/dojo/dojo_sepolia.toml) Dojo config file, with the same contents of [`dojo_dev.toml`](https://github.com/rsodre/512karat/blob/main/dojo/dojo_dev.toml), except for `[env]`, in which we are going to expose the `world_address` only: ```toml [env] @@ -116,7 +116,7 @@ echo "Deployment completed successfully." - This localises the env variables to the deployment script, so if for any reason the deployment is aborted, it cleans up the env variables. -- sozo will output the rpc url, account address and deployed block. +- Sozo will output the rpc url, account address and deployed block. ```bash profile | chain_id | rpc_url @@ -191,7 +191,7 @@ Stream logs with `slot deployments logs torii -f` ``` - If for any reasons we need to recreate Torii, we can just delete it and run the create command again. -This is safe, all your data is on-chain. +This is safe, all your data is onchain. ```bash slot deployments delete torii @@ -216,7 +216,7 @@ VITE_PUBLIC_CHAIN_ID=SN_MAIN ### Debug with Walnut -Use [Walnut](https://walnut.dev) to debug your on-chain transactions on Mainnet, Sepolia, or Slot deployments. +Use [Walnut](https://walnut.dev) to debug your onchain transactions on Mainnet, Sepolia, or Slot deployments. Walnut helps you inspect transaction details, understand execution flow, and troubleshoot issues. #### Step 1: Verify your Contracts diff --git a/docs/pages/tutorials/deploy-using-slot/main.md b/docs/pages/tutorials/deploy-using-slot/main.md index 93bf06f4..3aae20d6 100644 --- a/docs/pages/tutorials/deploy-using-slot/main.md +++ b/docs/pages/tutorials/deploy-using-slot/main.md @@ -11,10 +11,10 @@ Welcome to this tutorial where we will guide you through deploying a project usi --- -Before we start, make sure you are using the latest dojo version. +Before we start, make sure you are using the latest Dojo version. Run `dojoup` to have the latest version installed. -Now, let us create a new project and initialize it with sozo. +Now, let us create a new project and initialize it with Sozo. ```bash sozo init dojo-starter && cd dojo-starter @@ -52,7 +52,7 @@ Now, you can use that and update your `Scarb.toml` file with the new RPC endpoin rpc_url = "YOUR_NEW_RPC_URL" ``` -Now, you can stream katana in a new terminal. +Now, you can stream Katana in a new terminal. Open a new terminal and run the following command: ```bash diff --git a/docs/pages/tutorials/dojo-react.mdx b/docs/pages/tutorials/dojo-react.mdx index 024e7325..afa025f6 100644 --- a/docs/pages/tutorials/dojo-react.mdx +++ b/docs/pages/tutorials/dojo-react.mdx @@ -1,7 +1,7 @@ ## Dojo React This tutorial will guide you through building a simple React application that interacts with a Dojo world. -We will create a basic counter application where users can increment and decrement a value stored on-chain. +We will create a basic counter application where users can increment and decrement a value stored onchain. ## Prerequisites diff --git a/docs/pages/tutorials/dojo-starter.mdx b/docs/pages/tutorials/dojo-starter.mdx index b32d7048..9345bd4a 100644 --- a/docs/pages/tutorials/dojo-starter.mdx +++ b/docs/pages/tutorials/dojo-starter.mdx @@ -43,7 +43,7 @@ Inspect the contents of the `dojo-starter` project, and you will notice the foll └── test_world.cairo ``` -The scarb manifest (`Scarb.toml`) is a configuration file where project dependencies, metadata and other configurations are defined. +The Scarb manifest (`Scarb.toml`) is a configuration file where project dependencies, metadata and other configurations are defined. ## Models @@ -114,7 +114,7 @@ Models can contain any Cairo struct that derives the [`Introspect`](/framework/m ## Contract Systems -A dojo contract is a Starknet contract annotated with the `#[dojo::contract]` attribute. +A Dojo contract is a Starknet contract annotated with the `#[dojo::contract]` attribute. Like any Starknet contract, it defines an interface and an implementation. Let us examine the `src/systems/actions.cairo` file. diff --git a/docs/pages/tutorials/katana-starkli-scarb/main.md b/docs/pages/tutorials/katana-starkli-scarb/main.md index bbe37e5a..42cea851 100644 --- a/docs/pages/tutorials/katana-starkli-scarb/main.md +++ b/docs/pages/tutorials/katana-starkli-scarb/main.md @@ -218,7 +218,7 @@ Place the following environment variables in a .env file within the `src/` direc ```bash export STARKNET_ACCOUNT=katana-0 #A pre-funded account on the local development network. -export STARKNET_RPC=http://0.0.0.0:5050 #To specify the network, targeting the local katana devnet. +export STARKNET_RPC=http://0.0.0.0:5050 #To specify the network, targeting the local Katana devnet. ``` Then, ensure your project acknowledges the environment variables: @@ -277,7 +277,7 @@ Contract deployed: ### Call contract (only read state) The first parameter is the contract address, the second parameter is the function to be called, and the third parameter is the function parameter. -Let us pass the address of `Katana-0` account +Let us pass the address of `katana-0` account ```bash starkli call 0x02c44f2d396fc5f9caa551e8c1d901d943a3b8cc5c433c88a1bf10b1f15fcd15 voter_can_vote 0x6162896d1d7ab204c7ccac6dd5f8e9e7c25ecd5ae4fcb4ad32e57786bb46e03 diff --git a/docs/pages/tutorials/onchain-chess/0-setup.md b/docs/pages/tutorials/onchain-chess/0-setup.md index aa3d40cb..472909cb 100644 --- a/docs/pages/tutorials/onchain-chess/0-setup.md +++ b/docs/pages/tutorials/onchain-chess/0-setup.md @@ -83,7 +83,7 @@ initializer_class_hash = "0xbeef" [tool.dojo.env] rpc_url = "http://localhost:5050/" -# Default account for katana with seed = 0 +# Default account for Katana with seed = 0 account_address = "0x6162896d1d7ab204c7ccac6dd5f8e9e7c25ecd5ae4fcb4ad32e57786bb46e03" private_key = "0x1800000000300000180000000000030000000000003006001800006600" world_address = "0x446f1f19ba951b59935df72974f8ba6060e5fbb411ca21d3e3e3812e3eb8df8" diff --git a/docs/pages/tutorials/onchain-chess/1-action.md b/docs/pages/tutorials/onchain-chess/1-action.md index 13c6384e..0e0471bc 100644 --- a/docs/pages/tutorials/onchain-chess/1-action.md +++ b/docs/pages/tutorials/onchain-chess/1-action.md @@ -22,7 +22,7 @@ The `actions` contract has two dominant functions `spawn` function which spawns In this case, `move` and `spawn` ```rust - use starknet::ContractAddress; + use Starknet::ContractAddress; use chess::models::piece::Vec2; #[dojo::interface] diff --git a/docs/pages/tutorials/onchain-chess/README.md b/docs/pages/tutorials/onchain-chess/README.md index f75c563a..ae297052 100644 --- a/docs/pages/tutorials/onchain-chess/README.md +++ b/docs/pages/tutorials/onchain-chess/README.md @@ -13,7 +13,7 @@ If you have not read the Dojo Book yet, it is highly encouraged for you to do so ## What are we building? -We are building an on-chain chess game contract that lets you start a new game and play chess. +We are building an onchain chess game contract that lets you start a new game and play chess. This guide does not cover every rules of the chess game. You will build step by step as follows: diff --git a/docs/pages/tutorials/react.mdx b/docs/pages/tutorials/react.mdx index aef08c08..43dbb6f0 100644 --- a/docs/pages/tutorials/react.mdx +++ b/docs/pages/tutorials/react.mdx @@ -22,7 +22,7 @@ Prerequisites: npx @dojoengine/create-dojo start -t example-vite-react-sdk ``` -2. Run development network with `katana` +2. Run development network with `Katana` ```bash # In new terminal @@ -52,9 +52,9 @@ For example: The world address in this case would be `0x00e2ea9b5dd9804d13903edf712998943b7d5d606c139dd0f13eeb8f5b84da8d`. -4. Run indexer with `torii` +4. Run indexer with `Torii` -Start the indexer `torii` with the world address from the last step: +Start the indexer `Torii` with the world address from the last step: ```bash # In new terminal