Dojo Quick Start Guide 🐲⛩️
This guide will help you set up the project in just 5 minutes.
Prerequisites
Ensure you have the following tools installed:
- Dojo version 1.0.8
- slot CLI
- pnpm package manager
Reference
For detailed instructions, refer to the Dojo Documentation.
Step 1: Backend Setup 🐲
Terminal 1: Set Up Dojo Environment ⛩️
-
Clone the Repository
git clone https://github.com/ByteBuildersLabs/BabyBeastsv2
cd BabyBeastsv2/dojo
-
Install and Update Slot
curl -L https://slot.cartridge.sh | bash
slotup
- Authenticate
- Log in using the controller:
- Create a Katana Instance
- Replace DEPLOYMENT_NAME with your deployment name:
slot deployments create DEPLOYMENT_NAME katana
- Update RPC URLs
- Search for rpc in the project files and replace its value with the new RPC URL
https://api.cartridge.gg/x/DEPLOYMENT_NAME/katana
-
Start Katana Logs
slot deployments logs DEPLOYMENT_NAME katana -f
-
Update Configuration Files
- dojoConfig.ts: Update masterAddress, masterPrivateKey, and rpcUrl with the console-displayed values
- dojo_dev.toml: Update rpc_url, account_address, and private_key with the console-displayed values
Step 2: Compile and Migrate Contracts 🐲
Terminal 2: Build and Deploy Contracts ⛩️
- Verify Dojo Version
- Ensure you’re using the correct version:
- Build Contracts
Compile the contracts:
- Deploy the contracts
- Update the Manifest File
- Locate the generated manifest_dev.json in the dojo folder (both manifest)
- Copy the addres that sozo created and paste it to the dojo folder within the client
Step 3: Set Up a Torii Instance 🐲
Create a Torii Instance
- Replace placeholders with actual values
slot deployments create <PROJECT> torii --world <WORLD_ADDRESS> --rpc <URL>
- *Stream Torii Logs
slot deployments logs DEPLOYMENT_NAME torii -f
Step 4: Launch the Frontend 🐲
Terminal 3: Frontend Setup ⛩️
- Update Frontend Configuration
- In the cartridgeConnector file, set the target value with the key contract addresses from the manifest file.
- Navigate to the Client Directory
- Install Packages
- Install mkcert to enable localhost with https
macOS
windows
- Create https certifications on the project:
cd client
mkcert -install mkcert localhost
- Go to vite.config.js and write
For macOS:
import fs from "fs";
server: {
https: {
key: fs.readFileSync('mkcert+1-key.pem'), // Path to private key file
cert: fs.readFileSync('mkcert+1.pem'), // Path to certificate file
},
},
For windows:
import fs from "fs";
server: {
https: {
key: fs.readFileSync('localhost.pem'), // Path to private key file
cert: fs.readFileSync('localhost-key.pem'), // Path to certificate file
},
},
- Run the Development Server
- Open the Application
🐉 Visit localhost in your browser.
Dojo Quick Start Guide 🐲⛩️
This guide will help you set up the project in just 5 minutes.
Prerequisites
Ensure you have the following tools installed:
Reference
For detailed instructions, refer to the Dojo Documentation.
Step 1: Backend Setup 🐲
Terminal 1: Set Up Dojo Environment ⛩️
Clone the Repository
git clone https://github.com/ByteBuildersLabs/BabyBeastsv2 cd BabyBeastsv2/dojoInstall and Update Slot
curl -L https://slot.cartridge.sh | bash slotupStart Katana Logs
Update Configuration Files
Step 2: Compile and Migrate Contracts 🐲
Terminal 2: Build and Deploy Contracts ⛩️
Compile the contracts:
Step 3: Set Up a Torii Instance 🐲
Create a Torii Instance
Step 4: Launch the Frontend 🐲
Terminal 3: Frontend Setup ⛩️
cd clientmacOS
windows
cd client mkcert -install mkcert localhostFor macOS:
For windows:
🐉 Visit localhost in your browser.