Skip to content

Commit

Permalink
update directory structure
Browse files Browse the repository at this point in the history
  • Loading branch information
ponderingdemocritus committed Jan 20, 2024
1 parent 13db9fa commit 9fbbc9e
Show file tree
Hide file tree
Showing 358 changed files with 182 additions and 156 deletions.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ As discussed in the [World](./world.md) chapter, Autonomous Worlds (AWs) functio

Every time a `set!` is called in a `System`, the world checks if the `System` has authorization to update the model state. Only when the `System` possesses the necessary authorization, the `set!` is executed. The following diagram illustrates the authorization architecture.

![Authorization Architecture](../images/dojo-auth.png)
![Authorization Architecture](/dojo-auth.png)

### Providing Authorization

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ Here we are updating the `Moves` and `Position` models in the world state using

### The `emit!` command

The `emit!` command is used to emit custom events. These events are indexed by [Torii](../toolchain/torii/overview.md).
The `emit!` command is used to emit custom events. These events are indexed by [Torii](/toolchain/torii/overview.md).

```rust,ignore
emit!(world, Moved { address: caller, direction });
```

This will emit these values which could be captured by a client or you could query these via [Torii](../toolchain/torii/overview.md).
This will emit these values which could be captured by a client or you could query these via [Torii](/toolchain/torii/overview.md).

### The `delete!` command

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions src/cairo/events.md → dojo-book/docs/pages/cairo/events.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Events

Events play a pivotal role in decoding the dynamics of a Dojo world. Every time there's an update to a `Model`, the `World` contract emits these events. What's even more exciting is that you can craft your own custom events to fit specific needs! Moreover, thanks to [Torii](../toolchain/torii/overview.md), all these events are seamlessly indexed, ensuring easy and efficient querying.
Events play a pivotal role in decoding the dynamics of a Dojo world. Every time there's an update to a `Model`, the `World` contract emits these events. What's even more exciting is that you can craft your own custom events to fit specific needs! Moreover, thanks to [Torii](/toolchain/torii/overview.md), all these events are seamlessly indexed, ensuring easy and efficient querying.

### Model Events

Expand All @@ -26,7 +26,7 @@ struct StoreSetRecord {
}
```

This will then be captured by [Torii](../toolchain/torii/overview.md) and indexed for querying. This will allow you to then reconstruct the state of your world.
This will then be captured by [Torii](/toolchain/torii/overview.md) and indexed for querying. This will allow you to then reconstruct the state of your world.

Similarly, when a model is deleted, the `World` contract will emit an event with the following structure:

Expand Down Expand Up @@ -74,11 +74,11 @@ struct ContractUpgraded {
}
```

These events are also captured by [Torii](../toolchain/torii/overview.md) and indexed for querying.
These events are also captured by [Torii](/toolchain/torii/overview.md) and indexed for querying.

### Custom Events

Within your game, emitting custom events can be highly beneficial. Fortunately, there's a handy `emit!` command that lets you release events directly from your world. These events are indexed by [Torii](../toolchain/torii/overview.md).
Within your game, emitting custom events can be highly beneficial. Fortunately, there's a handy `emit!` command that lets you release events directly from your world. These events are indexed by [Torii](/toolchain/torii/overview.md).

Use it like so:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Hello Dojo

> This section assumes that you have already installed the Dojo toolchain and are familiar with Cairo. If not, please refer to the [Getting Started](../getting-started/quick-start.md) section.
> This section assumes that you have already installed the Dojo toolchain and are familiar with Cairo. If not, please refer to the [Getting Started](/getting-started/quick-start.md) section.
## Dojo as an ECS in 15 Minutes

Expand Down Expand Up @@ -231,19 +231,19 @@ sozo build

That compiled the models and system into an artifact that can be deployed! Simple as that!

Now, let's deploy it to [Katana](../toolchain/katana/overview.md)! First, we need to get Katana running. Open a second terminal and execute:
Now, let's deploy it to [Katana](/toolchain/katana/overview.md)! First, we need to get Katana running. Open a second terminal and execute:

```bash
katana --disable-fee
```

Success! [Katana](../toolchain/katana/overview.md) should now be running locally on your machine. Now, let's deploy! In your primary terminal, execute:
Success! [Katana](/toolchain/katana/overview.md) should now be running locally on your machine. Now, let's deploy! In your primary terminal, execute:

```bash
sozo migrate
```

This will deploy the artifact to [Katana](../toolchain/katana/overview.md). You should see terminal output similar to this:
This will deploy the artifact to [Katana](/toolchain/katana/overview.md). You should see terminal output similar to this:

```bash

Expand Down Expand Up @@ -301,7 +301,7 @@ With your local world address established, let's delve into indexing. You can in
torii --world 0x5010c31f127114c6198df8a5239e2b7a5151e1156fb43791e37e7385faa8138
```

Running the command mentioned above starts a [Torii](../toolchain/torii/overview.md) server on your local machine. This server uses SQLite as its database and is accessible at http://0.0.0.0:8080/graphql. [Torii](../toolchain/torii/overview.md) 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/overview.md) server on your local machine. This server uses SQLite as its database and is accessible at http://0.0.0.0:8080/graphql. [Torii](/toolchain/torii/overview.md) 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:

```bash
2023-10-18T06:49:48.184233Z INFO torii::server: 🚀 Torii listening at http://0.0.0.0:8080
Expand Down Expand Up @@ -418,7 +418,7 @@ Now, go back to your GraphiQL IDE, and you will notice that you have received th
}
```

In the GraphiQL 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.md) section.
In the GraphiQL 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.md) section.
We've covered quite a bit! Here's a recap:

- Built a Dojo world
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![origami](../images/origami.png)
![origami](/origami.png)

> The magic of origami is in seeing a single piece of cairo evolve into a masterpiece through careful folds.
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Systems play a pivotal role in your world's logic, directly mutating its compone

Since the whole contract is given write access to the model, it is important to be careful when defining systems. A simple way to think about it is:

![System Permissions](../images/permissions.png)
![System Permissions](/permissions.png)

### System Structure

Expand Down Expand Up @@ -153,4 +153,4 @@ mod player_actions {
}
```

> To interact with Systems read more in the [sozo](../toolchain/sozo/overview.md) docs.
> To interact with Systems read more in the [sozo](/toolchain/sozo/overview.md) docs.
File renamed without changes.
4 changes: 2 additions & 2 deletions src/cairo/world.md → dojo-book/docs/pages/cairo/world.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
> **To think about:** Consider Autonomous Worlds as sovereign blockchains residing within another blockchain - a nested blockchain, so to speak. Just as you can deploy contracts onto Ethereum to enhance its functionality, you can similarly introduce systems into the World contract to enrich its features. While anyone can contribute to the World, akin to Ethereum, authorization is required to interact with model state. There is a dedicated topic to [Authorisation](./authorization.md).
![overview](../images/world-map.png)
![overview](/world-map.png)

## The World Contract

Expand All @@ -16,7 +16,7 @@ The world contract emits all model events via the `StoreSetRecord` event. This e

### Full World API

The world exposes an interface which can be interacted with by any client. It is worth noting here that as a developer you don't deploy this world, it is deployed when you [migrate](../toolchain/sozo/overview.md) the world.
The world exposes an interface which can be interacted with by any client. It is worth noting here that as a developer you don't deploy this world, it is deployed when you [migrate](/toolchain/sozo/overview.md) the world.

```rust,ignore
// World interface
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,23 @@ This will generate a `.dll` or `.so` binary in the `target/release` directory, d

### Watch video

[![Watch the video](../../images/unity-screen-grab.png)](../../images/dojo.unity_demo.mp4)
[![Watch the video](/unity-screen-grab.png)](/dojo.unity_demo.mp4)

## Dojo Unity Concepts

Building on-chain games and worlds with Unity involves understanding several key concepts and components. Let's go over them to give you a clearer picture:

## World Manager

![world-manager](../../images/unity/world-manager.png)
![world-manager](/unity/world-manager.png)

- **Function**: The World Manager acts as the central hub for your Dojo world within Unity. It's the starting point where all entities from your Dojo world will be managed.
- **Implementation**: In your Unity scene, you'll find a `WorldManager` game object. Under this object, all entities from your Dojo world will be instantiated.
- **Customization**: The WorldManager script component comes with default values, but you have the option to modify these. Specifically, you can update the URLs for your Katana and Torii instances and set your own world address.

## Synchronization Master

![world-manager](../../images/unity/sync-master.png)
![world-manager](/unity/sync-master.png)

- **Role**: This component is crucial for managing the synchronization of entities between your Dojo world and the Unity world.
- **Features**: In the SynchronizationMaster, you can specify the maximum number of entities you want to synchronize. It also handles the synchronization of your models' components.
Expand All @@ -49,13 +49,13 @@ Building on-chain games and worlds with Unity involves understanding several key

## Models

![models](../../images/unity/models.png)
![models](/unity/models.png)

You should have a deep understanding of models in dojo if not checkout out models [here](../../cairo/models.md) before continuing.
You should have a deep understanding of models in dojo if not checkout out models [here](/cairo/models.md) before continuing.

### What are Models in Dojo?

1. **Definition**: In Dojo, [models](../../cairo/models.md) are essential state that represent various parts of [entities](../../cairo/entities.md) within your game. They are the building blocks that make up the content of your game world. Read about [ECS](../../cairo/hello-dojo.md).
1. **Definition**: In Dojo, [models](/cairo/models.md) are essential state that represent various parts of [entities](/cairo/entities.md) within your game. They are the building blocks that make up the content of your game world. Read about [ECS](/cairo/hello-dojo.md).

2. **Synchronization Role**:

Expand All @@ -64,19 +64,19 @@ You should have a deep understanding of models in dojo if not checkout out model

3. **Flexibility in Adding Models**:

- You have the freedom to add as many [models](../../cairo/models.md) as needed for your game's design and functionality.
- It's vital, however, to ensure that these [models](../../cairo/models.md) are consistent across both the Dojo and Unity. This means that for every model you have in Unity, there should be a corresponding model in your Dojo world.
- You have the freedom to add as many [models](/cairo/models.md) as needed for your game's design and functionality.
- It's vital, however, to ensure that these [models](/cairo/models.md) are consistent across both the Dojo and Unity. This means that for every model you have in Unity, there should be a corresponding model in your Dojo world.

4. **Future Developments**:

- An important aspect to note is that in future versions of the Dojo-Unity integration, the process of adding and synchronizing [models](../../cairo/models.md) will be further streamlined.
- The plan is to have these [models](../../cairo/models.md) auto-generated, which would significantly simplify the development process and reduce the manual effort required for synchronization.
- An important aspect to note is that in future versions of the Dojo-Unity integration, the process of adding and synchronizing [models](/cairo/models.md) will be further streamlined.
- The plan is to have these [models](/cairo/models.md) auto-generated, which would significantly simplify the development process and reduce the manual effort required for synchronization.

5. **Importance of Understanding Models**:
- Before diving into game development with Dojo in Unity, it’s recommended to have a solid understanding of how [models](../../cairo/models.md) work in the Dojo environment.
- Before diving into game development with Dojo in Unity, it’s recommended to have a solid understanding of how [models](/cairo/models.md) work in the Dojo environment.
- This knowledge is crucial for effectively designing and implementing game elements that interact seamlessly between the blockchain and the game's user interface.

In summary, [models](../../cairo/models.md) are the bridge between the onchain (Dojo) and off-chain (Unity) aspects of your game.
In summary, [models](/cairo/models.md) are the bridge between the onchain (Dojo) and off-chain (Unity) aspects of your game.

### Adding Models

Expand All @@ -91,7 +91,7 @@ The process to add models is:

### Entities

Via toriiClient [models](../../cairo/entities.md) are synced to Unity and are comprised of the models that you defined.
Via toriiClient [models](/cairo/entities.md) are synced to Unity and are comprised of the models that you defined.

### Starter Project

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Dojo is a thriving community of builders, artists, and deep thinkers, pushing th

## Ecosystem & Studios powered by Dojo

![dojo](../images/Built%20with.svg)
![dojo](/Built%20with.svg)

#### Realms World

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
## Local Deployment with Katana

Experience the power of rapid development with Dojo, featuring the ultra-fast local development sequencer, [Katana](../toolchain/katana/overview.md). Katana acts as an on-device Starknet, enabling thorough testing of your dojo world in a controlled environment before migrating them to the remote testnet.
Experience the power of rapid development with Dojo, featuring the ultra-fast local development sequencer, [Katana](/toolchain/katana/overview.md). Katana acts as an on-device Starknet, enabling thorough testing of your dojo world in a controlled environment before migrating them to the remote testnet.

### Easy Katana Deployments

Deploying to Katana is straightforward and efficient.

> **Pre-requisite:** Ensure you've completed the [Quick Start](../getting-started/quick-start.md) guide and have your project set up.
> **Pre-requisite:** Ensure you've completed the [Quick Start](/getting-started/quick-start.md) guide and have your project set up.
To initiate Katana from your project directory, execute:

Expand Down Expand Up @@ -38,4 +38,4 @@ Deploying your project to Katana involves a few simple steps.\
sozo migrate
```

Success! You have now migrated your world. You will be able to interact with the world using [sozo](../toolchain/sozo/overview.md).
Success! You have now migrated your world. You will be able to interact with the world using [sozo](/toolchain/sozo/overview.md).
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ world_address = "0x5b328933afdbbfd44901fd69a2764a254edbb6e992ae87cf958c70493f2d2

If you credentials are correct in the Scarb.toml then a simple migrate will deploy the world to Starknet.

### Deploy to Remote [Katana](../toolchain/katana/overview.md)
### Deploy to Remote [Katana](/toolchain/katana/overview.md)

Katanas are able to be hosted and run as remote testnets, however this is not recommended for production use.

Deploy to remote katana with slot [here](../tutorial/deploy-using-slot/main.md)
Deploy to remote katana with slot [here](/tutorial/deploy-using-slot/main.md)

### Deploy to Remote Madara

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ installed with the "Desktop Development With C++" Workloads option.

#### Building

You can either use the different [Dojoup](../toolchain/dojoup.md) flags:
You can either use the different [Dojoup](/toolchain/dojoup.md) flags:

```sh
dojoup --branch master
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Quick Start

> It is worth reading [theory](../theory/autonomous-worlds.md) to familiarize yourself with the concept of Autonomous Worlds (AWs) and the [Cairo ecosystem](../theory/cairo.md) before diving into the code.
> It is worth reading [theory](/theory/autonomous-worlds.md) to familiarize yourself with the concept of Autonomous Worlds (AWs) and the [Cairo ecosystem](/theory/cairo.md) before diving into the code.
### Install Dojoup

Expand All @@ -17,8 +17,8 @@ which will make the `dojoup` command available in your CLI.
dojoup
```

For full `dojoup` reference and debugging see [Dojoup](../toolchain/dojoup.md).
For full `dojoup` reference and debugging see [Dojoup](/toolchain/dojoup.md).

### Next steps

> Head to [Hello Dojo](../cairo/hello-dojo.md) to get create your first Dojo world.
> Head to [Hello Dojo](/cairo/hello-dojo.md) to get create your first Dojo world.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Development Setup

> This is a guide to setting up a development environment for Dojo. It is not suggested to follow this guide if you are just wanting to play with the toolchain. We strongly suggest following the [Quick Start](../getting-started/quick-start.md) guide.
> This is a guide to setting up a development environment for Dojo. It is not suggested to follow this guide if you are just wanting to play with the toolchain. We strongly suggest following the [Quick Start](/getting-started/quick-start.md) guide.
### Prerequisites

Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Binary file added dojo-book/docs/pages/images/favicon.ico
Binary file not shown.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ import { HomePage } from "vocs/components";

<HomePage.Root>
<HomePage.Logo />
<HomePage.Tagline>My Awesome Docs</HomePage.Tagline>
<HomePage.InstallPackage name="vocs" type="init" />
{/* <HomePage.Tagline>Enter the Dojo</HomePage.Tagline> */}
{/* <HomePage.InstallPackage /> */}
<HomePage.Description>
This is a description of my documentation website.
Dojo is a community driven open-source, Provable Game Engine, providing a comprehensive toolkit for building verifiable games and autonomous worlds.
</HomePage.Description>
<HomePage.Buttons>
<HomePage.Button href="/getting-started" variant="accent">
Get started
</HomePage.Button>
<HomePage.Button href="https://github.com/wevm/vocs">
<HomePage.Button href="https://github.com/dojoengine/dojo.js">
GitHub
</HomePage.Button>
</HomePage.Buttons>
Expand Down
File renamed without changes.
Loading

0 comments on commit 9fbbc9e

Please sign in to comment.