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.
Before running the application, make sure to install the following software:
- Node.js version 18.16.0 LTS
- Yarn
- Docker
- kubectl
- Minikube - perform only the first step, titled "Installation"
- Skaffold
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 aRunning
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:
- Frontend: http://frontend.localhost
- Nakama dashboard: http://backend.localhost
- Nakama API: http://api.localhost
⚠️ 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 configurednsmasq
in order to access custom domain names. Consider following this guide and use.localhost
instead of.test
and.box
.
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.
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
Whenever adding a file (necessary for the applications' build) directly to frontend/
or backend/
root directories:
- Open the
Dockerfile
related to that deployment - In the build phase, add
COPY frontend/<file_name>.<ext> ./frontend/<file_name>.<ext>
(writebackend
instead offrontend
for the backend build)