Skip to content
/ p_war Public

To host game events on PixeLAW to create engaging experiences for users and developers. One of the core values of PixeLAW is the ability to add rules, proving that new experiences can be created through simple games with the addition of rules.

License

Notifications You must be signed in to change notification settings

pixelaw/p_war

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dojo logo

discord

p/war

Contracts written in Cairo using Dojo to showcase a Pixel World with app interoperability. Its interoperability is made possible with core actions. Apps are any other contracts that are deployed to the Pixel World.

Prerequisites

Install asdf

Follow the asdf installation instructions.

Install dojo

asdf plugin add dojo https://github.com/dojoengine/asdf-dojo
asdf install dojo 1.0.0-alpha.11

Install scarb

asdf plugin add scarb
asdf install scarb 2.7.0

And after moving into contracts directory, the versions for these libs are set in the .tool-versions file.

Running Locally

If you use vscode, you can start katana and torii just press ⌘ + ⇧ + B in your vscode. This can be executed by selecting commands here: image

If you use these shortcut, please check out if the contract was deployed.

otherwise,

Terminal one (Make sure this is running)

# Run Katana
katana --disable-fee --allowed-origins "*" --db-dir katana

Terminal two

# Build the example
sozo build

# Migrate the example
sozo migrate apply

# Start Torii
torii --world 0x263ae44e5414519a5c5a135cccaf3d9d7ee196d37e8de47a178da91f3de9b34 --allowed-origins "*"

How to deploy

you can deploy your app to our katana testnet by running the following commands:

# Deploy the pixelaw app
sozo build -P release
sozo migrate apply -P release

Setup Client

After finishing setup a contract side, you can run the client locally by following commands:

cd ./client
bun install
bun run dev

Troubleshooting

If you want to use latest dojo version, you need to clone core by yourself and modify the path in Scarb.toml file.

  1. Clone core repo
git clone https://github.com/pixelaw/core
  1. Modify the path in Scarb.toml file
pixelaw = { path = "../pixelaw/core/contracts" }
  1. Modify version in Scarb.toml file in core repo
dojo = { git = "https://github.com/dojoengine/dojo", tag = "v1.0.0-alpha.11" }
  1. Build and run core
cd contracts
sozo build
sozo migrate apply

About

To host game events on PixeLAW to create engaging experiences for users and developers. One of the core values of PixeLAW is the ability to add rules, proving that new experiences can be created through simple games with the addition of rules.

Resources

License

Stars

Watchers

Forks

Packages