Taba the story
In 2017, we embarked on a journey to build a blockchain named Aeternity. We used Erlang and developed a virtual machine called Fate, along with a programming language named Sophia.
You can read more about Fate in another post.
As a fun application to test on the chain, we built a game contract.
The idea was that the game begins when a player calls the start function in the contract. Other players have until height H+1000 to place a bet. At height H+1001, players can call the contract to get a seed from the H+1000 block hash. Players can then view the game in their app, solve it, and push the number of moves and a hash of the solution to the contract. At height H+2000, a player can claim the winnings by sending in their solution. The player who first produced the shortest correct solutions wins and gets the tokens.
But since this was a bit too close to gambling we decided to never publish the contract or the game.
For the Erlang server we used the Cowboy webserver with a worker pool.Each worker handles one request. For single-player mode, we used a REST API and serialized through the database. For multiplayer mode, we used a WebSocket API and serialized in a gen_server (1/game) with state backed to the database.
Then we developed a solver in C to find solutions for the puzzles. The solver is capable of finding the optimal solution. We use this to calculate the difficulty of the puzzle.
The game is very easy to pick up and play. It is available for download for free on the App Store and Google Play. The current version of the game boasts over 19 quintillions of puzzles to solve, with new features being added regularly.
The game is hosted at Taba Quest where you can read more about it.
Or you can just download it, but don't blame me if all your free time suddenly is gone.