-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathjustfile
65 lines (47 loc) · 1.84 KB
/
justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
set positional-arguments
set export
set dotenv-load
# uncomment one of these for the environment you want to use
# set dotenv-filename := ".env.slot"
set dotenv-filename := ".env.local"
DOJO_VERSION := "0.3.15"
default:
just --list
install_dojo:
dojoup --version $DOJO_VERSION
cardgen:
sh ./scripts/gen-cards.sh
codegen:
sh ./scripts/gen-code.sh
build_contracts:
cd contracts && sozo build
test:
cd contracts && sozo test
migrate:
cd contracts && sozo migrate --rpc-url=$STARKNET_RPC_URL --account-address=$DEPLOYER_ADDRESS --private-key=$DEPLOYER_PRIVATE_KEY
# fetch the cards from the google sheet and write to cards.csv in this repo
fetch_cards:
wget "https://docs.google.com/spreadsheets/d/1sGTB4XvrHmZ_Dn9QZinwOZWRTMmCjCy_FNpdIodMlHE/gviz/tq?tqx=out:csv&sheet=cards" -O cards.csv
# Set the auth for the world contract so spellcrafter systems can interact with the required components
set_auth:
#!/usr/bin/env bash
set -euxo pipefail
WORLD_ADDRESS=$(cat ./contracts/target/dev/manifest.json | jq -r '.world.address')
GAME_ADDRESS=$(cat ./contracts/target/dev/manifest.json | jq -r '.contracts[] | select(.name == "spellcrafter_system" ).address')
COMPONENTS=("Valueingame" "Owner" "Familiar" "Occupied" )
cd contracts
for component in ${COMPONENTS[@]}; do
sozo auth writer $component $GAME_ADDRESS --world $WORLD_ADDRESS --rpc-url=$STARKNET_RPC_URL --account-address=$DEPLOYER_ADDRESS --private-key=$DEPLOYER_PRIVATE_KEY
done
# start the dev server hosting the web client
start_client:
cd client && bun install && bun run dev
# start a katana devnet
start_devnet:
katana --disable-fee --seed=0
# Requires a devnet running on STARKNET_RPC_URL
start_indexer:
#!/usr/bin/env bash
set -euxo pipefail
WORLD_ADDRESS=$(cat ./contracts/target/dev/manifest.json | jq -r '.world.address')
torii --world ${WORLD_ADDRESS} --rpc $STARKNET_RPC_URL