Skip to content

pixelaw/app_template

Repository files navigation

Dojo logo

discord

PixeLAW App Template

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.

Getting started

The easiest way is to use the VSCode DevContainer, all tools will be installed already. Keep reading for this approach. You can also install all tools in your local environment, see Local Environment. This README is all about using the Devcontainer (recommended)

1. Devcontainer

Open this folder in VSCode, and build/run the devcontainer. You will see a series of commands executed in the terminal, which you can close when done. After that you have a fully configured environment with Katana, Torii and the Pixelaw server running. Use klog, tlog and slog to see the logs for each.

2. Accounts

When doing local development, you'll use the build-in Katana accounts which have been preconfigured.

When ready to deploy to Sepolia testnet, you'll have to create and fund an account, and install the keystore file in your project. You can use the scripts/account_from_key.sh for this.

3. Build/Deployment

All normal Dojo tooling is available, see the Dojo Documentation

3.1 Build

This will compile the Cairo contracts in /src

sozo build

3.2 Deployment

Deploy (migrate) the contracts

sozo migrate

4. Maintenance

The idea is that you'll copy this template and create your own PixeLAW app with it. So eventually the versions of Core, Dojo may get outdated.

4.1 Upgrade Dojo

To upgrade Dojo, you have to upgrade Pixelaw Core (see below)

4.2 Upgrade Core

The easiest is to do a full-text search/replace on the Core version number (for example 0.5.11) and replace it with the new version. Then it's easiest to

  1. Delete the /target/ folder
  2. Delete the Scarb.lock file
  3. Full Rebuild using sozo build
  4. Fix any compile issues
  5. Run (integration) tests with sozo test
  6. Fix any test issues
  7. If applicable: Upgrade your live code using sozo migrate --profile sepolia

About

Template for creating a new PixeLAW app

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published