Skip to content

Latest commit

 

History

History
141 lines (111 loc) · 4.58 KB

README.md

File metadata and controls

141 lines (111 loc) · 4.58 KB

Treasure Hunt

This is an implementation of Treasure Hunter, forking from paint application. We used app_template.

Rule

  • Player can play as paint app.
  • However, player might hit a star when he/she is lucky. (1/1024)
  • The star will apear in the pixel as emoji.

TODO

  • Comment out LastAttempt features to defend from bots.

PixeLAW App template

This is a heavily WIP attempt to allow creation of PixeLAW apps without managing the main "game" repo.

Prerequisites

Dojo

PixeLAW is built on top of Dojo. Refer to this page to get it installed.

Getting started

Clone this repository

Via Sozo

Run sozo init. This will initialize the project by cloning the repo.

sozo init <replace-with-project-file-path> pixelaw/app_template

Via GitHub

Use this template to create a new repository or clone this repository locally.

Run this code

Run the tests made for this app

sozo test

Local Development

There are multiple ways to have a local copy of PixeLAW core for development:

Using Docker Compose (Recommended)

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.

Prerequisites
  1. Docker
  2. Docker Compose plugin

Running the following command will run core in a container.

docker compose up -d
Using Docker

Another way to go about it is by using the Docker engine by itself.

  1. Docker

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.6
Manually

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:

Building your contracts

sozo build

Deploying your contracts

This will deploy your app to the local PixeLAW using sozo migrate.

sozo migrate --name pixelaw

Initializing your contracts

This will grant writer permission to your app for any custom models made.

scarb run initialize

Uploading your manifest

scarb run upload_manifest

Deploying to Demo

Deploying to demo is almost the same as local development. The only difference is needing the RPC_URL of the Demo environment as well as the DEMO_URL (NOTE: this must end in a slash i.e. '/') of the Demo App to upload your manifest to. Both URLs can be provided by us. Please reach out through discord.

Build your contracts

sozo build

Deploy your contracts

This will deploy your app to the local PixeLAW using sozo migrate.

sozo migrate --name pixelaw --rpc-url <replace-this-with-provided-rpc-url>

Initializing your contracts

This will grant writer permission to your app for any custom models made.

scarb run initialize <replace-this-with-provided-rpc-url>

Uploading your manifest

scarb run upload_manifest <replace-this-with-provided-demo-url>

Current issues

The following is a current unresolved issue in Dojo.

  • test myapp::tests::tests::test_myapp_actions ... fail (gas usage est.: 1044740) failures: myapp::tests::tests::test_myapp_actions - panicked with [6445855526543742234424738320591137923774065490617582916 ('CLASS_HASH_NOT_DECLARED'), 23583600924385842957889778338389964899652 ('ENTRYPOINT_FAILED'), 23583600924385842957889778338389964899652 ('ENTRYPOINT_FAILED'), ]