Skip to content

Latest commit

 

History

History
69 lines (42 loc) · 2.71 KB

DEVELOPMENT.md

File metadata and controls

69 lines (42 loc) · 2.71 KB

Development Setup

This guide outlines the steps to set up a development environment for Dojo. If you just want to play with the toolchain, we recommend following the Quick Start guide instead.

Prerequisites

Setup

1. Clone the repository

git clone https://github.com/dojoengine/dojo.git

2. Install Rust and dependencies

Install Rust and run the test suite to confirm your setup:

rustup override set stable && rustup update && cargo test

Note: Depending on your Linux distribution, you may need to install additional dependencies.

3. Install Scarb package manager

Install the Scarb.

4. Add the Cairo 1.0 VSCode extension

Install the Cairo 1.0 extension for Visual Studio Code.

Testing

Before you submit your pull request, you should run the test suite locally to make sure your changes haven't broken anything.

To run the test, you can execute the same command that will be exected on the CI by checking the .github/workflows/ci.yml file.

# Run all the tests excluding Katana (due to SiR dependency, they may be run independently)
cargo nextest run --all-features --workspace --exclude katana

# To limit the resources, you can run the tests only on a package:
cargo nextest run --all-features -p sozo-ops

If you have to modify dojo-core or dojo-lang crates you must:

# First spin up a **fresh** Katana instance on default port.
cargo run --bin katana

# Then execute the script that will rebuild them.
bash scripts/rebuild_test_artifacts.sh

Additionally, when you push your changes, the built-in Continuous Integration (CI) will also run all the tests on the pushed code. You can see the result of these tests in the GitHub interface of your pull request. If the tests fail, you'll need to revise your code and push it again.

The CI uses a devcontainer to have all the dependencies installed and to run the tests. You can find more information about the devcontainer in the .devcontainer.json file and see the latest releases on GitHub package.

Releasing

Propose a new release by manually triggering the release-dispatch github action. The version value can be an semver or a level: [patch, minor, major].

Once run, the workflow will create a PR with the versioned repo which will trigger the release flow and the creation of a draft release on merge.