Skip to content

Commit

Permalink
feat: Added slot profile
Browse files Browse the repository at this point in the history
  • Loading branch information
knownasred committed Oct 2, 2024
1 parent 8b761d1 commit a40d600
Show file tree
Hide file tree
Showing 7 changed files with 92 additions and 11 deletions.
6 changes: 5 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{
"image": "mcr.microsoft.com/devcontainers/base:ubuntu-24.04"
"image": "mcr.microsoft.com/devcontainers/base:ubuntu-24.04",
"features": {
"ghcr.io/prulloac/devcontainer-features/bun:1.1.2": {},
"ghcr.io/devcontainers/features/rust:1.3.1": {}
}
}
49 changes: 49 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# This workflow will install Deno then run `deno lint` and `deno test`.
# For more information see: https://github.com/denoland/setup-deno

name: Deno

on:
push:
branches
permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Setup repo
uses: actions/checkout@v4

- id: setup-dojo
uses: runelabsxyz/setup-dojo@main
with:
version: 'v1.0.0-alpha.12'

- uses: oven-sh/setup-bun@v2
with:
bun-version: latest

- name: Install slot
run: |-
curl -L https://slot.cartridge.sh | bash
- name: Build contract
run: sozo build

- name: Test contract
run: sozo test
if: false # Set this to true when we finally have working tests

- name: Install dependencies
working-directory: ./refactor
run: bun install --frozen-lockfile
2 changes: 2 additions & 0 deletions contracts/Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ version = "0.1.0"
[cairo]
sierra-replace-ids = true

[profile.slot]

[scripts]
migrate = "sozo build && sozo migrate apply"
spawn = "./scripts/spawn.sh"
Expand Down
7 changes: 4 additions & 3 deletions contracts/dojo_dev.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ telegram = "https://t.me/dojoengine"
default = "octoguns"

[env]
rpc_url = "https://api.cartridge.gg/x/octoguns-public-alpha1/katana"
rpc_url = "http://localhost:5050/"
# Default account for katana with seed = 0
account_address = "0x9b4fea3bb27903a996426a7bd4cd33a23e1187942cf19c6f7611b4db333bee"
private_key = "0x2a79be0d524b62728aa13f63e180a18224cb6205d78473559ccb94957a23814"
account_address = "0xb3ff441a68610b30fd5e2abbf3a1548eb6ba6f3559f2862bf2dc757e5828ca"
private_key = "0x2bbf4f9fd0bbb2e60b0316c1fe0b76cf7a4d0198bd493ced9b8df2a3a24d68a"
world_address = "0x7447477a7c852c946f0b8d13ebdfe0db9e78f3de60ab799320691502b4d32a3"
21 changes: 21 additions & 0 deletions contracts/dojo_slot.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[world]
name = "Octoguns"
description = "The official Dojo Starter guide, the quickest and most streamlined way to get your Dojo Autonomous World up and running. This guide will assist you with the initial setup, from cloning the repository to deploying your world."
cover_uri = "file://assets/cover.png"
icon_uri = "file://assets/icon.png"
website = "https://github.com/dojoengine/dojo-starter"
seed = "octoguns"

[world.socials]
x = "https://x.com/ohayo_dojo"
discord = "https://discord.gg/FB2wR6uF"
github = "https://github.com/dojoengine/dojo-starter"
telegram = "https://t.me/dojoengine"

[namespace]
default = "octoguns"

[env]
rpc_url = "https://api.cartridge.gg/x/octoguns-public-alpha1/katana"
account_address = "0x9b4fea3bb27903a996426a7bd4cd33a23e1187942cf19c6f7611b4db333bee"
private_key = "0x2a79be0d524b62728aa13f63e180a18224cb6205d78473559ccb94957a23814"
9 changes: 4 additions & 5 deletions refactor/src/dojo/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@ import { BurnerManager } from '@dojoengine/create-burner'
import { getSyncEntities, getSyncEvents } from '@dojoengine/state'
export type SetupResult = Awaited<ReturnType<typeof setup>>

export async function setup({ ...config }: DojoConfig) {
export async function setup(worldAddress: string | undefined, { ...config }: DojoConfig) {
// torii client
const toriiClient = await torii.createClient({
rpcUrl: config.rpcUrl,
toriiUrl: config.toriiUrl,
relayUrl: '',
worldAddress:
'0x7447477a7c852c946f0b8d13ebdfe0db9e78f3de60ab799320691502b4d32a3' || '',
worldAddress: worldAddress ?? ''
})

// create contract components
Expand All @@ -41,8 +40,8 @@ export async function setup({ ...config }: DojoConfig) {
{
nodeUrl: config.rpcUrl,
},
'0x516d934ae97ba2b708131d9ae1a9a877ee6ef486358e43641602e413f4a28c4',
'0x70394329654e1673bd368495c64a14d29bdf0887d61ae9d5fb82678aca4572d'
config.masterAddress,
config.masterPrivateKey
),
accountClassHash: config.accountClassHash,
rpcProvider: dojoProvider.provider,
Expand Down
9 changes: 7 additions & 2 deletions refactor/src/dojoConfig.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import manifest from '../../contracts/manifests/dev/deployment/manifest.json';
import { createDojoConfig } from '@dojoengine/core';

import {PUBLIC_TORII_URL, PUBLIC_RPC_URL, PUBLIC_BURNER_ADDRESS, PUBLIC_BURNER_KEY, PUBLIC_WORLD_ADDRESS} from '$env/static/public';

export const WORLD_ADDRESS = PUBLIC_WORLD_ADDRESS;

export const dojoConfig = createDojoConfig({
toriiUrl: PUBLIC_TORII_URL,
rpcUrl: PUBLIC_RPC_URL,
manifest,
toriiUrl: 'https://api.cartridge.gg/x/octoguns-public-alpha1/torii',
rpcUrl: 'https://api.cartridge.gg/x/octoguns-public-alpha1/katana',
masterAddress: PUBLIC_BURNER_ADDRESS,
masterPrivateKey: PUBLIC_BURNER_KEY
});

export type Config = typeof dojoConfig;

0 comments on commit a40d600

Please sign in to comment.