dojoengine / dojo.js

dojo.js - enter the dojo via js
https://dojoengine.github.io/dojo.js/
MIT License
21 stars 44 forks source link
autonomous-worlds gaming onchain-game

Dojo: The Provable Game Engine

Dojo is a community driven open-source, Provable Game Engine, providing a comprehensive toolkit for building verifiable games and autonomous worlds.

Discord Telegram CI Status

Dojo.js is the official JavaScript SDK for interacting with Dojo worlds. It is currently a work in progress (WIP), and we are actively seeking contributors.

Read the full dojo documentation


Bootstrap a dojo world like so. You will need dojo installed.

npx @dojoengine/create-dojo

Dojo.js Examples

Contributing to dojo.js

From the repository root, run the following to install all the necessary package dependencies:

pnpm i

Building Packages

Note: Before running the examples, you must build each package.

To build all packages, from the root directory, run:

pnpm run build

To watch for changes on all packages in parallel, from the root directory, run:

pnpm run build-watch

Dojo starter

To install dojo-starter submodule (which allows interactions with the examples), run:

git submodule update --init --recursive

Debugging

If you have issues on WSL, install package first then run command:

npm i @dojoengine/create-dojo -g
npx @dojoengine/create-dojo

Examples

To run the examples that have the linked packages, follow the steps below:

Terminal 1: Set up the dojo starter with specific configurations.

cd examples/dojo-starter
katana --disable-fee --allowed-origins "*"

Terminal 2: Build and migrate the dojo starter.

cd examples/dojo-starter

# Build and migrate
sozo build
sozo migrate apply
# From your frontend project directory
DOJO_MANIFEST_PATH=../relative/path/to/contracts/Scarb.toml sozo build --typescript --bindings-output=./dojo/gen

# Run Torii
torii --world 0xb4079627ebab1cd3cf9fd075dda1ad2454a7a448bf659591f259efa2519b18 --allowed-origins "*"

Terminal 3: Start the App

cd examples/<package>
pnpm install
pnpm run dev