Skip to content

Kryha/boloney

Repository files navigation

Boloney! - Zero Knowledge Sandbox

Contributor Covenant

Online multiplayer game showcasing the potential of Aleo's Zero Knowledge Proof platform.

Check the companion ZK Gaming Toolkit project here. Boloney connects to the toolkit to generate proofs for the game.

Getting started

Before running the application, make sure to install the following software:

Before running Minikube, make sure Docker is running.

Run Minikube:

minikube start --cpus=max --memory=max

Enable ingress add-on:

minikube addons enable ingress

Open a new terminal tab and run:

sudo minikube tunnel

This will allow you to access the deployed applications at the address specified in the ingress configuration so keep it running in the background.

Return to the first terminal tab and run:

skaffold run

This will build the frontend and backend and deploy them on the minikube cluster.

⚠️ Occasionally you may see that the deployment fails on db connection because of how Nakama handles it, but most of the times it's actually successful since the backend pod will automatically restart and manage to connect to the db eventually. Whenever you get that kind of error, use the following commands to check the status of the backend pod, it may need to restart 2/3 times before it has a Running status.

To check the status of your pods, run:

kubectl -n boloney-local get pods

To read the logs, run:

# pod_name can be retrieved from the output of the previous command
kubectl -n boloney-local logs <pod_name> -f

If the pods are running correctly, the services should be accessible at the following addresses:

⚠️ Currently Aleo Wallet does not work with the local kubernetes frontend deployment, so prefer running it in dev mode as illustrated in the following section.

⚠️ On MacOS you may need to configure dnsmasq in order to access custom domain names. Consider following this guide and use .localhost instead of .test and .box.

Run frontend in dev mode

If you are developing the frontend application, you can run a development server:

cd frontend/
yarn dev

The development application will be available at the URL printed in the command output.

Connecting to the toolkit

In order to perform ZK actions, you need a local running instance of the ZK Gaming Toolkit. To run it, follow the instruction in the "Running locally" section. That's it!

If you wish to run the toolkit through minikube instead you need to keep in mind that it will try to perform requests to the programs deployed on the testnet. If this is your intention, open skaffold.yaml and update the following build arg:

VITE_TOOLKIT_URL: http://zk-gaming-tk.localhost

Then, open deployment/local/workloads/config/backend.yaml and add the following env variable:

- name: TOOLKIT_BASE_URL
  value: http://zk-gaming-tk.zk-gaming-tk-local.svc.cluster.local:5001

Adding files to backend/ or frontend/

Whenever adding a file (necessary for the applications' build) directly to frontend/ or backend/ root directories:

  1. Open the Dockerfile related to that deployment
  2. In the build phase, add COPY frontend/<file_name>.<ext> ./frontend/<file_name>.<ext> (write backend instead of frontend for the backend build)

About

The classical game of Liar's Dice enhanced with the usage of Zero-Knowledge Proof

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages