Dojo Phaser Template

Getting Started

Contracts

  1. Check versions of Scarb and Dojo and Cairo
sozo --version
sozo 0.7.0-alpha.5
scarb: 2.6.3
cairo: 2.6.3
sierra: 1.5.0

scarb --version
scarb 2.6.3 (e6f921dfd 2024-03-13)
cairo: 2.6.3 (https://crates.io/crates/cairo-lang-compiler/2.6.3)
sierra: 1.5.0
  1. Run Katana on http://0.0.0.0:5050
katana --disable-fee --allowed-origins "*"
  1. Apply migrations
scarb run migrate
  1. Run indexer on http://0.0.0.0:8080
torii --world 0x009f1c624eea5ad97ea4bee805b2c46d4db96c8bee88a061a1905e67e5683cc1 --allowed-origins "*"
  1. Run spawn
scarb run spawn
  1. Run move
scarb run move

Frontend

  1. Install dependencies
pnpm install
  1. Run the frontend
pnpm run dev

Trouble Shooting

  • When I change dir name dojo-starter to contracts
    • I should've rename dojo-starter to contracts in source files
    • Then remove contracts/manifests and sozo migrate plan to re-generate them
    • Then in the client dir, run pn components to re-generate clientComponents
  • When using alpha verison of Dojo, Language Server may not work correctly
    • Downgrade to beta version of Dojo