Skip to content

🐉 INSTALLATION GUIDELINE 🐉 #34

@RolandoDrRobot

Description

@RolandoDrRobot

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 ⛩️

  1. Clone the Repository

    git clone https://github.com/ByteBuildersLabs/BabyBeastsv2
    cd BabyBeastsv2/dojo
  2. Install and Update Slot

curl -L https://slot.cartridge.sh | bash

slotup
  1. Authenticate
  • Log in using the controller:
    slot auth login
  1. Create a Katana Instance
  • Replace DEPLOYMENT_NAME with your deployment name:
    slot deployments create DEPLOYMENT_NAME katana
  1. 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
  1. Start Katana Logs

    slot deployments logs DEPLOYMENT_NAME katana -f
  2. 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 ⛩️

  1. Verify Dojo Version
  • Ensure you’re using the correct version:
    dojoup -v 1.0.8
  1. Build Contracts

Compile the contracts:

sozo build
  1. Deploy the contracts
sozo migrate
  1. 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

  1. Replace placeholders with actual values
slot deployments create <PROJECT> torii --world <WORLD_ADDRESS> --rpc <URL>
  1. *Stream Torii Logs
slot deployments logs DEPLOYMENT_NAME torii -f

Step 4: Launch the Frontend 🐲

Terminal 3: Frontend Setup ⛩️

  1. Update Frontend Configuration
  • In the cartridgeConnector file, set the target value with the key contract addresses from the manifest file.
  1. Navigate to the Client Directory
cd client
  1. Install Packages
pnpm install
  1. Install mkcert to enable localhost with https
    macOS
brew install mkcert

windows

choco install mkcert -y
  1. Create https certifications on the project:
cd client
mkcert -install mkcert localhost
  1. 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
  },
},
  1. Run the Development Server
pnpm run dev
  1. Open the Application
    🐉 Visit localhost in your browser.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions