The template offers a timer-based mining system that ensures the fair distribution of points (rewards). The entire system operates within the ZKWASM virtual machine, which functions as a trustless REST service (Layer 3), providing mining results along with their cryptographic proofs to the target blockchain (Layer 1 or Layer 2).
In this system, players manage their miners (robots) by assigning them cards (activities). Each activity lasts a few minutes, and upon completion, it generates different types of resources at the cost of other resources. The player's objective is to strategically manage a team of robots, optimizing their activities to produce the maximum amount of the target resource.
Because the game requires careful, real-time management of miners, it effectively mitigates "Sybil Attacks," as it is challenging for attackers to respond efficiently to the complex and dynamic scenarios necessary to optimize production.
For fresh environment, run source script/environment_linux.sh
for Linux.
If you see some error messages, need manually install the error module in your OS.
- Start Redis
redis-server
- Mongodb
mongod --dbpath $DB_FOLDER
- Start Merkle DB Service: Since the whole game sever is supposed to be checked in ZKWASM, we need to provide a Merkle backend to generate the witness for it. Here we use the ZKWAM-MINI-ROLLUP at [email protected]:DelphinusLab/zkwasm-mini-rollup.git.
To run the Merkle DB Service, use can clone the zkwasm mini rollup repo:
git clone [email protected]:DelphinusLab/zkwasm-mini-rollup.git
and then in ./dbservice
, run bash run.sh
- Clone this repo:
git clone https://github.com/riddles-are-us/zkwasm-automata
-
Install ZKWASM-MINI-ROLLUP reset server
-
Install zkwasm-ts-server In
./ts
, run:
npm install
- Build WASM image: In './', run:
make
- Run WASM service:
node ts/node_modules/zkwasm-ts-server/src/service.js
A demo frontend can be find at https://github.com/riddles-are-us/frontend-automata