Introduction
Dojo Engine is an innovative framework for creating fully on-chain games and provable applications within the Starknet ecosystem. However, due to the novelty of this technology, there are currently few practical examples and clear documentation on how to implement the various components of Dojo in a production environment.
Dojo by Example was created to fill this gap by providing detailed and well-documented examples of how to build games and applications using Dojo. This repository will serve as an accessible guide for developers of all levels, making it easier to adopt this technology.
Objective
The main objective of Dojo by Example is to provide clear and functional implementations of key elements of Dojo Engine, including:
- Dojo contracts and models.
- Actions, systems, stores and worlds within Dojo.
- Connections with the Cartridge Controller.
- Deploy to slot, sepolia and mainnet.
- Gas fees optimization for dojo contracts.
- Integrations with Dojo clients and other components of the Starknet ecosystem.
- Best practices for developing games and applications with Dojo.
Importance
Dojo Engine represents a revolution in how on-chain games and autonomous worlds are built. However, the lack of practical examples and well-structured guides makes the learning curve challenging for new developers.
Dojo by Example will facilitate this process by providing:
- Functional examples explained step by step.
- Best practices for implementing contracts, systems, and controllers.
- A reference resource for the Starknet developer community.
Purpose
The purpose of this project is to accelerate the adoption of Dojo Engine and empower developers to build robust games and applications on Starknet. This will be achieved through well-documented code examples that serve as a reference for anyone interested in developing with this technology.
Who is this for?
This guide is designed for developers with basic programming and blockchain knowledge who want to learn Dojo.
The content is structured progressively - early chapters cover Dojo fundamentals, while later chapters explore advanced topics and complex integrations.
How to use this book?
Each chapter is self-contained and focuses on a specific Dojo feature or use case. While you can jump to any topic, we recommend following the chapters in order if you're new to Dojo.
Further reading
To deepen your knowledge:
- Dojo Docs - The official Dojo documentation.
- Cairo Book - Learn more about the Cairo programming language.
- Cartridge Controller - Learn how the Controller works.
Versions
The current version of this book uses:
cairo 2.9.2
sierra 1.7.0
dojo 1.0.12
// .tool-versions: