Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Start of WSL2 + unity walkthrough #327

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions readme.md → README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
## 📖 The Dojo Book
---
icon: hand-wave
---

# The Dojo Book

> Migration from rustbook to vocs in process. Make all edits and PRs into dojo-book.

Explore the world of Autonomous Worlds with Dojo, your trusted toolchain. [Dive in now](https://book.dojoengine.org/).

### Contributing
## Contributing

Embrace the open-source spirit of Dojo. As it's in its nascent phase, we welcome contributors with open arms.

Peruse our [contributing guidelines](docs/pages/misc/contributors.md). From minor wording adjustments to extensive chapters, every contribution matters!

### Setup
## Setup

1. Install Vocs dependencies

Expand Down
129 changes: 129 additions & 0 deletions SUMMARY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# Table of contents

* [The Dojo Book](README.md)
* [docs](docs/README.md)
* [pages](docs/pages/README.md)
* [FAQ](docs/pages/faq.md)
* [Getting Started](docs/pages/getting-started.md)
* [Welcome to the Dojo](docs/pages/index.md)
* [client](docs/pages/client/README.md)
* [Torii Client](docs/pages/client/torii.md)
* [sdk](docs/pages/client/sdk/README.md)
* [Dojo c](docs/pages/client/sdk/c.md)
* [js](docs/pages/client/sdk/js/README.md)
* [Common Problems](docs/pages/client/sdk/js/common-problems.md)
* [Concepts](docs/pages/client/sdk/js/concepts.md)
* [dojo.js](docs/pages/client/sdk/js/dojojs.md)
* [Dojo.js 101 example](docs/pages/client/sdk/js/example.md)
* [Examples](docs/pages/client/sdk/js/getting-started.md)
* [Dojo.js Packages](docs/pages/client/sdk/js/packages.md)
* [RECS](docs/pages/client/sdk/js/recs.md)
* [unity](docs/pages/client/sdk/unity/README.md)
* [Common problems and solutions](docs/pages/client/sdk/unity/common-problems.md)
* [Example with Dojo Starter and dojo.unity](docs/pages/client/sdk/unity/example.md)
* [Getting Started](docs/pages/client/sdk/unity/get-started.md)
* [Dojo Unity Concepts](docs/pages/client/sdk/unity/important-concepts.md)
* [Dojo.unity](docs/pages/client/sdk/unity/index.md)
* [dojo.unity](docs/pages/client/sdk/unity/unity.md)
* [community](docs/pages/community/README.md)
* [get-started](docs/pages/community/get-started.md)
* [framework](docs/pages/framework/README.md)
* [Config](docs/pages/framework/config.md)
* [Dojo Framework](docs/pages/framework/index.md)
* [Cairo Testing Cheat Codes: A Comprehensive Guide](docs/pages/framework/testing-cheat-codes.md)
* [Testing](docs/pages/framework/testing.md)
* [contracts](docs/pages/framework/contracts/README.md)
* [Events](docs/pages/framework/contracts/events.md)
* [Dojo Contract](docs/pages/framework/contracts/index.md)
* [Macros](docs/pages/framework/contracts/macros.md)
* [Metadata](docs/pages/framework/contracts/metadata.md)
* [Systems](docs/pages/framework/contracts/systems.md)
* [migration](docs/pages/framework/migration/README.md)
* [Migration Guide to 0.3.0](docs/pages/framework/migration/0.3.0.md)
* [Migration Guide to 0.4.0](docs/pages/framework/migration/0.4.0.md)
* [models](docs/pages/framework/models/README.md)
* [Entities](docs/pages/framework/models/entities.md)
* [enum](docs/pages/framework/models/enum.md)
* [index](docs/pages/framework/models/index.md)
* [Introspection](docs/pages/framework/models/introspect.md)
* [world](docs/pages/framework/world/README.md)
* [World's API](docs/pages/framework/world/api.md)
* [Authorization](docs/pages/framework/world/authorization.md)
* [Events emitted by the world](docs/pages/framework/world/events.md)
* [World Contract](docs/pages/framework/world/index.md)
* [Metadata](docs/pages/framework/world/metadata.md)
* [getting-started](docs/pages/getting-started-1/README.md)
* [Development Setup](docs/pages/getting-started/setup.md)
* [wsl](docs/pages/getting-started/wsl.md)
* [misc](docs/pages/misc/README.md)
* [Contributing to Dojo Book](docs/pages/misc/contributors.md)
* [theory](docs/pages/theory/README.md)
* [autonomous-worlds](docs/pages/theory/autonomous-worlds.md)
* [tutorial](docs/pages/tutorial/README.md)
* [Dojo starter guide](docs/pages/tutorial/dojo-starter.md)
* [deploy-using-slot](docs/pages/tutorial/deploy-using-slot/README.md)
* [Deploy your game using Slot](docs/pages/tutorial/deploy-using-slot/main.md)
* [katana-starkli-scarb](docs/pages/tutorial/katana-starkli-scarb/README.md)
* [Deploy your Cairo smart contract using Katana. Advanced Tutorial](docs/pages/tutorial/katana-starkli-scarb/main.md)
* [Building a Chess Game](docs/pages/tutorial/onchain-chess/README.md)
* [0. Setup](docs/pages/tutorial/onchain-chess/0-setup.md)
* [1. Actions](docs/pages/tutorial/onchain-chess/1-action.md)
* [2 Move function](docs/pages/tutorial/onchain-chess/2-move.md)
* [3 Test Contract](docs/pages/tutorial/onchain-chess/3-test.md)
* [toolchain](docs/pages/toolchain/README.md)
* [katana](docs/pages/toolchain/katana/README.md)
* [Execution Engines](docs/pages/toolchain/katana/execution.md)
* [Forking](docs/pages/toolchain/katana/forking.md)
* [Genesis Configuration](docs/pages/toolchain/katana/genesis.md)
* [index](docs/pages/toolchain/katana/index.md)
* [Interact with Katana on Starknet. Deploy a Cairo smart contract using Katana](docs/pages/toolchain/katana/interact.md)
* [Messaging](docs/pages/toolchain/katana/messaging.md)
* [Mining Modes](docs/pages/toolchain/katana/mining.md)
* [Settlement](docs/pages/toolchain/katana/settlement.md)
* [Storage Modes](docs/pages/toolchain/katana/storage.md)
* [Supported Transaction Types](docs/pages/toolchain/katana/transactions.md)
* [cli](docs/pages/toolchain/katana/cli/README.md)
* [katana completions](docs/pages/toolchain/katana/cli/completions.md)
* [index](docs/pages/toolchain/katana/cli/index.md)
* [katana](docs/pages/toolchain/katana/cli/katana.md)
* [db](docs/pages/toolchain/katana/cli/db/README.md)
* [index](docs/pages/toolchain/katana/cli/db/index.md)
* [katana db stats](docs/pages/toolchain/katana/cli/db/stats.md)
* [rpc](docs/pages/toolchain/katana/rpc/README.md)
* [dev Namespace](docs/pages/toolchain/katana/rpc/dev.md)
* [JSON-RPC](docs/pages/toolchain/katana/rpc/index.md)
* [katana Namespace](docs/pages/toolchain/katana/rpc/katana.md)
* [starknet Namespace](docs/pages/toolchain/katana/rpc/starknet.md)
* [torii Namespace](docs/pages/toolchain/katana/rpc/torii.md)
* [origami](docs/pages/toolchain/origami/README.md)
* [index](docs/pages/toolchain/origami/index.md)
* [slot](docs/pages/toolchain/slot/README.md)
* [index](docs/pages/toolchain/slot/index.md)
* [slot reference](docs/pages/toolchain/slot/reference.md)
* [deployment-commands](docs/pages/toolchain/slot/deployment-commands/README.md)
* [create](docs/pages/toolchain/slot/deployment-commands/create.md)
* [delete](docs/pages/toolchain/slot/deployment-commands/delete.md)
* [describe](docs/pages/toolchain/slot/deployment-commands/describe.md)
* [index](docs/pages/toolchain/slot/deployment-commands/index.md)
* [list](docs/pages/toolchain/slot/deployment-commands/list.md)
* [logs](docs/pages/toolchain/slot/deployment-commands/logs.md)
* [update](docs/pages/toolchain/slot/deployment-commands/update.md)
* [sozo](docs/pages/toolchain/sozo/README.md)
* [index](docs/pages/toolchain/sozo/index.md)
* [common-options](docs/pages/toolchain/sozo/common-options/README.md)
* [Configuration Priorities](docs/pages/toolchain/sozo/common-options/configurations.md)
* [Sozo --offline option](docs/pages/toolchain/sozo/common-options/offline.md)
* [Sozo --profile option](docs/pages/toolchain/sozo/common-options/profile.md)
* [deployment](docs/pages/toolchain/sozo/deployment/README.md)
* [Local Deployment with Katana](docs/pages/toolchain/sozo/deployment/locally.md)
* [Deployment to Remote Network](docs/pages/toolchain/sozo/deployment/remote.md)
* [project-commands](docs/pages/toolchain/sozo/project-commands/README.md)
* [sozo build](docs/pages/toolchain/sozo/project-commands/build.md)
* [sozo clean](docs/pages/toolchain/sozo/project-commands/clean.md)
* [sozo init](docs/pages/toolchain/sozo/project-commands/init.md)
* [sozo test](docs/pages/toolchain/sozo/project-commands/test.md)
* [torii](docs/pages/toolchain/torii/README.md)
* [Torii - GraphQL](docs/pages/toolchain/torii/graphql.md)
* [gRPC](docs/pages/toolchain/torii/grpc.md)
* [index](docs/pages/toolchain/torii/index.md)
* [torii reference](docs/pages/toolchain/torii/reference.md)
2 changes: 2 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# docs

2 changes: 2 additions & 0 deletions docs/pages/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# pages

2 changes: 2 additions & 0 deletions docs/pages/client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# client

2 changes: 2 additions & 0 deletions docs/pages/client/sdk/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# sdk

2 changes: 2 additions & 0 deletions docs/pages/client/sdk/js/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# js

2 changes: 2 additions & 0 deletions docs/pages/client/sdk/unity/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# unity

2 changes: 2 additions & 0 deletions docs/pages/community/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# community

2 changes: 2 additions & 0 deletions docs/pages/framework/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# framework

2 changes: 2 additions & 0 deletions docs/pages/framework/contracts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# contracts

2 changes: 2 additions & 0 deletions docs/pages/framework/migration/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# migration

2 changes: 2 additions & 0 deletions docs/pages/framework/models/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# models

2 changes: 2 additions & 0 deletions docs/pages/framework/world/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# world

2 changes: 2 additions & 0 deletions docs/pages/getting-started-1/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# getting-started

10 changes: 4 additions & 6 deletions docs/pages/getting-started.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# Getting Started

:::note
Windows it not natively supported, we suggest using [WSL](https://learn.microsoft.com/en-us/windows/wsl/install) to develop with Dojo on Windows.
:::
:::note Windows it not natively supported, we suggest using [WSL](https://learn.microsoft.com/en-us/windows/wsl/install) to develop with Dojo on Windows. :::

Let's get started building on **Dojo**! This guide will walk you through installing the Dojo toolchain and preparing your environment for development. Dojo is built around a set of development tools - [Katana](/toolchain/katana), [Torii](/toolchain/torii) and [Sozo](/toolchain/sozo).
:::Alternitively you can use our [WSL + Unity install](getting-started/wsl.md) instructions:::

<!-- TODO: Add link to the Saya page when available. -->
Let's get started building on **Dojo**! This guide will walk you through installing the Dojo toolchain and preparing your environment for development. Dojo is built around a set of development tools - [Katana](../../toolchain/katana/), [Torii](../../toolchain/torii/) and [Sozo](../../toolchain/sozo/).

## Prerequisites

Expand Down Expand Up @@ -80,4 +78,4 @@ asdf local dojo 0.7.0 # Set locally in your project directory

::::

Once you're up and running, check out the [Dojo Starter guide](/tutorial/dojo-starter)!
Once you're up and running, check out the [Dojo Starter guide](../../tutorial/dojo-starter/)!
133 changes: 133 additions & 0 deletions docs/pages/getting-started/wsl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@

**Installing Dojo with WSL2 on Windows**

1. **Enable the "Windows Subsystem for Linux" feature:**
- Open "Control Panel" -> "Programs" -> "Turn Windows features on or off".
- Enable the "Windows Subsystem for Linux" checkbox and click "OK".
- Restart your computer.

2. **Install Ubuntu:**
- Open a command prompt.
- Run the following command:
```
wsl --install -d Ubuntu
```

3. **Verify Installation (Step moved):**
- Open a command prompt.
- Run the following command:
```
wsl -l
```
- You should see "Ubuntu" listed as an installed distro.

4. **You will be prompted to create a Username and a password.**

5. **Installing rustup on Linux**

- Open your WSL2 Ubuntu terminal.
- Run the following command to install the latest stable release of Rust:
```
curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh
```
- When prompted, select the first option "1) Proceed with standard installation (default - just press enter)".
- After completion, you should see "Rust is installed now. Great!"

**Temporarily adding Cargo bin directory to PATH (Optional):**

- If you don't want to restart your terminal, you can temporarily add the 'Cargo bin directory' to your PATH environment variable.
- Run the following command in your terminal:
```bash
export PATH=$PATH:$HOME/.cargo/bin
```
- This tells the system where to search for executables like `rustc` and `cargo`.

6. **Installing git**

- At the time of writing, git v2.43.0 comes pre-installed with WSL2 Ubuntu 24.04.1 LTS.
- You can verify this by running:
```
git --version
```

7. **Installing Scarb**

- Run the following command in your terminal to install the latest stable release of Scarb:
```
curl --proto '=https' --tlsv1.2 -sSf https://docs.swmansion.com/scarb/install.sh](https://docs.swmansion.com/scarb/install.sh) | sh
```
- Follow the on-screen instructions during the installation.

**Updating your PATH for Scarb (Optional):**

- If you don't want to open a new terminal, run this command to update your PATH:
```
source /home/<Username>/.bashrc
```
- Replace `<Username>` with your actual username.

- Now you can check the installation by running:
```
scarb --version
```

8. **Installing DOJO with asdf **

- Run the following command to install asdf:
```
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.14.1
```
- Run the following commands in your terminal to configure asdf for Dojo:

```bash
echo '. "$HOME/.asdf/asdf.sh"' >> ~/.bashrc
echo '. "$HOME/.asdf/completions/asdf.bash"' >> ~/.bashrc

source ~/.bashrc # Reload the .bashrc file
```

9. **Installing dojo**

- Add the Dojo plugin to asdf and install version 1.0.0-alpha.5:

```
asdf plugin add dojo https://github.com/dojoengine/asdf-dojo
asdf install dojo 1.0.0-alpha.5
```

- Set the global version of Dojo:

```
asdf global dojo 1.0.0-alpha.5
```

10. **Verifying Installation**

- View the currently installed Dojo version:

```
asdf current dojo
```

- This should output something like:
```
> dojo 1.0.0-alpha.5 /home/<Username>/.tool-versions
```

- Alternatively, you can use the `sozo` command (provided by Dojo) to check the installed versions of Dojo, Scarb, Cairo, and Sierra:

```
sozo --version
```

**Note:**

- Replace `<Username>` in the Scarb and Dojo PATH update commands with your actual username.

[dojo](https://book.dojoengine.org/getting-started)
[wsl2](https://learn.microsoft.com/en-us/windows/wsl/install)
[scarb](https://docs.swmansion.com/scarb/download.html)
[asdf](https://asdf-vm.com/guide/getting-started.html)



2 changes: 2 additions & 0 deletions docs/pages/misc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# misc

2 changes: 2 additions & 0 deletions docs/pages/theory/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# theory

2 changes: 2 additions & 0 deletions docs/pages/toolchain/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# toolchain

2 changes: 2 additions & 0 deletions docs/pages/toolchain/katana/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# katana

2 changes: 2 additions & 0 deletions docs/pages/toolchain/katana/cli/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# cli

2 changes: 2 additions & 0 deletions docs/pages/toolchain/katana/cli/db/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# db

5 changes: 2 additions & 3 deletions docs/pages/toolchain/katana/cli/db/stats.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# `katana db stats`
# katana db stats

Dispays database tables information.

Expand All @@ -10,5 +10,4 @@ katana db stats [OPTIONS]

## Options

`-p, --path <PATH>`
&nbsp;&nbsp;&nbsp;&nbsp;Path to the database directory [default: ~/.katana/db]
`-p, --path <PATH>` Path to the database directory \[default: \~/.katana/db]
Loading