This is a heavily WIP attempt to allow creation of PixeLAW apps without managing the main "game" repo.
PixeLAW is built on top of Dojo. Refer to this page to get it installed.
Use this template to create a new repository or clone this repository locally.
sozo test
Run Pixelaw/core
There are multiple ways to have a local copy of PixeLAW core for development:
This is the easiest way to get PixeLAW core up and running in http://localhost:3000. There is a docker-compose file in this repository specifically for running a local image of PixeLAW core.
Running the following command will run core in a container.
docker compose up -d
Another way to go about it is by using the Docker engine by itself.
The following script will create the docker network for the container to run in:
docker network create --driver bridge pixelaw
And this will run the actual container in http://localhost:3000:
docker run -d --name pixelaw-core -p 5050:5050 -p 3000:3000 -p 8080:8080 -p 50051 --restart unless-stopped --network pixelaw oostvoort/pixelaw-core:v0.0.33
This will take the most time. This entails cloning the PixeLAW core repos and running each individual component manually. Refer to the GitHub repository for how to run it.
Whichever way you've chosen to start up PixeLAW core, it will take a while for all the core contracts to get deployed and start running. Wait until http://localhost:3000/manifests/core stops returning NOT FOUND. To check if you can start deploying your app, use the following script (this will print out "Ready for app deployment" when the core contracts have finished initialization):
scarb run ready_for_deployment
After which you can start deploying your app onto your local PixeLAW via:
sozo build
This will deploy your app to the local PixeLAW using sozo migrate.
sozo migrate --name pixelaw
This will grant writer permission to your app for any custom models made.
scarb run initialize
scarb run upload_manifest
Deploying to demo is almost the same as local development. The only difference is needing the RPC_URL of the Demo environment, the DEMO_URL (NOTE: this must end in a slash i.e. '/') of the Demo App to upload your manifest to, and the world name. Both URLs and world name can be provided by us. Please reach out through discord. Currently, sozo checks first if an environment variable was set in Scarb.toml for rpc-url. So, comment that out before beginning with the following steps.
sozo build
This will deploy your app to the local PixeLAW using sozo migrate.
sozo migrate --name <replace-this-with-provided-world-name> --rpc-url <replace-this-with-provided-rpc-url>
This will grant writer permission to your app for any custom models made.
scarb run initialize <replace-this-with-provided-rpc-url>
scarb run upload_manifest <replace-this-with-provided-demo-url>
Please check the [[tool.dojo.env]]
in your Sarb.toml
. You have to modify it correctly.
Also, please verify account_address
and private_key
.
For dojo problems, please check the version is correct.