Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐉 INSTALLATION GUIDELINE 🐉 #34

Closed
RolandoDrRobot opened this issue Jan 15, 2025 · 0 comments
Closed

🐉 INSTALLATION GUIDELINE 🐉 #34

RolandoDrRobot opened this issue Jan 15, 2025 · 0 comments
Labels
documentation Improvements or additions to documentation

Comments

@RolandoDrRobot
Copy link
Contributor

RolandoDrRobot commented Jan 15, 2025

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.
@RolandoDrRobot RolandoDrRobot self-assigned this Jan 15, 2025
@RolandoDrRobot RolandoDrRobot added the documentation Improvements or additions to documentation label Jan 15, 2025
@juandiegocv27 juandiegocv27 pinned this issue Jan 15, 2025
@juandiegocv27 juandiegocv27 changed the title Installation guideline 🐉 INSTALLATION GUIDELINE 🐉 Jan 15, 2025
@ByteBuildersLabs ByteBuildersLabs locked as spam and limited conversation to collaborators Jan 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants