5. Building Block View
5.1. Battle Cron and API
While originally built for only chimp battle simulation and generation, the battle repository over time has grown in to a multi-purpose cron job and API powering adventures, metadata, bandanas, as well as battles. It has become the workhorse of the ecosystem and everything else we built depends upon it. Despite growing in to something that does so much more, we still affectionately call it the battle system.
5.1.1. Blackbox
The dojo uses the battle API for all internal data including battles, adventures, bandanas, chimpvolutions, snapshots, etc. |
|
Retrieves image IPFS location. |
|
Retrieves check-a-chimp details. |
|
Exposes details about staked chimps. |
|
Hal |
Delivers chimpvolution details to be written to the database. |
5.1.2. Whitebox
Cron |
A daily job that runs between 00:00 and 01:00 UTC. It is responsible for taking a snapshot of all current holders, updating XP, running battle or adventure simulations, updating chimpvolved chimps and similar tasks. |
Battle Generator |
Monitors a queue for battle requests, generates the battle using ffmpeg, and upload the video to blob storage. |
A REST API that exposes data about battles, adventures, chimps, holders, and more. |
|
Queue storage for battle requests and chimpvolution updates, and blob storage for battle videos. |
|
Database |
A Mongo database that stores snapshots, battles, adventures, chimpvolutions, and more off-chain data. |
5.2. Dojo
The dojo is the main application that holders interact with. It is written in Vue.js and is a SPA (Single Page Application).
5.3. Manifold
Manifold wrote all the Solidity smart contracts that power the system. While normally an external system is not dived in to in detail, the Manifold contracts are the core of the ecosystem and are worth understanding the relationships between the contracts and their neighbors.