Skip to content

Commit

Permalink
upgrading to dojo 1.0.1 and fixing deployment (not done, torii metada…
Browse files Browse the repository at this point in the history
…ta still empty)
  • Loading branch information
thiscaspar committed Nov 16, 2024
1 parent 6e97722 commit 577f339
Show file tree
Hide file tree
Showing 14 changed files with 31 additions and 28 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci-contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ jobs:
- uses: asdf-vm/actions/setup@v3
- run: |
asdf plugin add dojo https://github.com/dojoengine/asdf-dojo
asdf install dojo 1.0.0
asdf global dojo 1.0.0
asdf install dojo 1.0.1
asdf global dojo 1.0.1
cd contracts && sozo test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ contracts/out
contracts/db
contracts/target
contracts/manifest_dev.json
contracts/manifest_dev-pop.json

*.account.json
*.keystore.json
2 changes: 1 addition & 1 deletion DOJO_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.0
1.0.1
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ SHELL ["/bin/bash", "-c"]

ARG ASDF_VERSION="v0.14.1"
ARG SCARB_VERSION="2.7.0"
ARG DOJO_VERSION="1.0.0"
ARG DOJO_VERSION="1.0.1"
ARG STARKLI_VERSION="0.1.6"


Expand Down
2 changes: 1 addition & 1 deletion contracts/.tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
dojo 1.0.0
dojo 1.0.1
scarb 2.7.0
2 changes: 1 addition & 1 deletion contracts/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"cairo1.enableLanguageServer": true,
"cairo1.languageServerPath": "${userHome}/.asdf/installs/dojo/1.0.0/bin/dojo-language-server",
"cairo1.languageServerPath": "${userHome}/.asdf/installs/dojo/1.0.1/bin/dojo-language-server",
"cairo1.enableScarb": true,
"cairo1.scarbPath": "${userHome}/.asdf/installs/scarb/2.7.0/bin/scarb",
"cairo1.preferScarbLanguageServer": false
Expand Down
2 changes: 1 addition & 1 deletion contracts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Follow the asdf installation instructions.

```
asdf plugin add dojo https://github.com/dojoengine/asdf-dojo
asdf install dojo 1.0.0
asdf install dojo 1.0.1
```

### Install scarb
Expand Down
12 changes: 6 additions & 6 deletions contracts/Scarb.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,28 @@ version = 1

[[package]]
name = "dojo"
version = "1.0.0"
source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0#74280d48fa2828095331487dede59f9b2e378cd3"
version = "1.0.1"
source = "git+https://github.com/dojoengine/dojo?tag=v1.0.1#d7335e6f5c76a1dda887ec00c594c2c019b4a05f"
dependencies = [
"dojo_plugin",
]

[[package]]
name = "dojo_cairo_test"
version = "1.0.0-rc.0"
source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0#74280d48fa2828095331487dede59f9b2e378cd3"
source = "git+https://github.com/dojoengine/dojo?tag=v1.0.1#d7335e6f5c76a1dda887ec00c594c2c019b4a05f"
dependencies = [
"dojo",
]

[[package]]
name = "dojo_plugin"
version = "2.8.4"
source = "git+https://github.com/dojoengine/dojo?tag=v1.0.0#74280d48fa2828095331487dede59f9b2e378cd3"
source = "git+https://github.com/dojoengine/dojo?tag=v1.0.1#d7335e6f5c76a1dda887ec00c594c2c019b4a05f"

[[package]]
name = "pixelaw"
version = "0.5.4"
version = "0.5.6"
dependencies = [
"dojo",
"dojo_cairo_test",
Expand All @@ -33,7 +33,7 @@ dependencies = [

[[package]]
name = "pixelaw_test_helpers"
version = "0.5.4"
version = "0.5.6"
dependencies = [
"dojo",
"dojo_cairo_test",
Expand Down
4 changes: 2 additions & 2 deletions contracts/Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ edition = "2024_07"
sierra-replace-ids = true

[dependencies]
dojo = { git = "https://github.com/dojoengine/dojo", tag = "v1.0.0" }
dojo = { git = "https://github.com/dojoengine/dojo", tag = "v1.0.1" }
starknet = "2.8.4"

[dev-dependencies]
pixelaw_test_helpers = { path = "../test_helpers" }
dojo_cairo_test = { git = "https://github.com/dojoengine/dojo", tag = "v1.0.0" }
dojo_cairo_test = { git = "https://github.com/dojoengine/dojo", tag = "v1.0.1" }

[tool.fmt]
sort-module-level-items = true
Expand Down
4 changes: 2 additions & 2 deletions contracts/Scarb_deploy.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ edition = "2024_07"
sierra-replace-ids = true

[dependencies]
dojo = { git = "https://github.com/dojoengine/dojo", tag = "v1.0.0" }
dojo = { git = "https://github.com/dojoengine/dojo", tag = "v1.0.1" }
starknet = "2.8.4"

[dev-dependencies]
pixelaw_test_helpers = { path = "../test_helpers" }
dojo_cairo_test = { git = "https://github.com/dojoengine/dojo", tag = "v1.0.0" }
dojo_cairo_test = { git = "https://github.com/dojoengine/dojo", tag = "v1.0.1" }

[tool.fmt]
sort-module-level-items = true
Expand Down
6 changes: 3 additions & 3 deletions contracts/dojo_dev-pop.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ mappings = {}

[env]
rpc_url = "http://localhost:5050/"
account_address = "0x3c4dd268780ef738920c801edc3a75b6337bc17558c74795b530c0ff502486"
private_key = "0x2bbf4f9fd0bbb2e60b0316c1fe0b76cf7a4d0198bd493ced9b8df2a3a24d68a"
world_address = "0x5729e109ed70ce4f33e3164505c78476e9fec57874b69467cdf0ba51636085"
account_address = "0x127fd5f1fe78a71f8bcd1fec63e3fe2f0486b6ecd5c86a0466c3a21fa5cfcec"
private_key = "0xc5b2fcab997346f3ea1c00b002ecf6f382c5f9c9659a3894eb783c5320f912"
world_address = "0x6fcc123bc71415fb6a2bca515ceb69aa95c486c34f07b92aae29627b126bf2f"

[writers]
"pixelaw-App" = ["pixelaw-actions"]
Expand Down
6 changes: 4 additions & 2 deletions contracts/scripts/build_and_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,14 @@ start_katana

sozo_rebuild

sozo_migrate

export WORLD_ADDRESS=$(cat $MANIFEST | jq -r '.world.address')

start_torii

sozo_migrate



init_actions

if [ "$PROFILE" == "dev-pop" ]; then
Expand Down
8 changes: 4 additions & 4 deletions contracts/scripts/lib/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@ start_katana() {

# Start Katana
katana \
--genesis $GENESIS_TEMPLATE \
--invoke-max-steps 4294967295 \
--db-dir $KATANA_DB \
--http.cors_origins "*" \
--dev \
--dev.seed 0 \
--dev.no-fee \
--dev.accounts 10 \
> $KATANA_LOG 2>&1 &

# Wait for logfile to exist and not be empty
Expand All @@ -62,12 +63,11 @@ start_torii() {

pkill -f torii
local rpc_url=$(get_rpc_url)
echo "start_torii: $rpc_url"
echo "start_torii: $rpc_url $WORLD_ADDRESS"
torii \
--world $WORLD_ADDRESS \
--rpc $rpc_url \
--db-dir $TORII_DB \
--indexing.events_chunk_size 10000 \
--http.cors_origins "*" \
> $TORII_LOG 2>&1 &
}
Expand Down Expand Up @@ -125,7 +125,7 @@ sozo_migrate() {

init_actions() {
echo "init_actions"
local actions=$(jq -r '.contracts[] | select(.kind == "DojoContract") | .tag' $MANIFEST)
local actions=$(jq -r '.contracts[] | .tag' $MANIFEST)

for action in ${actions[@]}; do
sozo --manifest-path $DEPLOY_SCARB --profile $PROFILE execute --wait $action init
Expand Down
4 changes: 2 additions & 2 deletions test_helpers/Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ edition = "2024_07"
sierra-replace-ids = true

[dependencies]
dojo = { git = "https://github.com/dojoengine/dojo", tag = "v1.0.0" }
dojo_cairo_test = { git = "https://github.com/dojoengine/dojo", tag = "v1.0.0" }
dojo = { git = "https://github.com/dojoengine/dojo", tag = "v1.0.1" }
dojo_cairo_test = { git = "https://github.com/dojoengine/dojo", tag = "v1.0.1" }
starknet = "2.8.4"

[tool.fmt]
Expand Down

0 comments on commit 577f339

Please sign in to comment.