Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yornaath/build-the-future-with-zeitgeist-workshop
A tick tack toe game using event sourcing and prediction markets. This is the code for the talk given at the Polkadot Global Series North America edition for Zeitgeist.pm.
https://github.com/yornaath/build-the-future-with-zeitgeist-workshop
dapp polkadot-js substrate web3
Last synced: 2 days ago
JSON representation
A tick tack toe game using event sourcing and prediction markets. This is the code for the talk given at the Polkadot Global Series North America edition for Zeitgeist.pm.
- Host: GitHub
- URL: https://github.com/yornaath/build-the-future-with-zeitgeist-workshop
- Owner: yornaath
- Created: 2022-05-23T10:22:05.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-07-01T14:51:11.000Z (over 2 years ago)
- Last Synced: 2024-11-21T14:52:10.269Z (2 months ago)
- Topics: dapp, polkadot-js, substrate, web3
- Language: TypeScript
- Homepage:
- Size: 11.3 MB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Build the future with the Zeitgeist SDK
#### A tick tack toe game using event sourcing and prediction markets.
This is the code for the talk given at the Polkadot Global Series North America edition for [Zeitgeist.pm](https://zeitgeist.pm/).
[Watch the code walk on Crowdcast!](https://www.crowdcast.io/e/building-the-future-with)
[Or read more details in this subsocial post.](https://app.subsocial.network/@kusamacommunity/building-an-event-sourced-game-with-zeitgeist-34280)
## Build & Run
Build the source and the run the docker containers rusing docker compose.
You only need to start the gui service, this will allso start the referee and mongodb services.```bash
yarn install
yarn build
docker compose up --build gui
```## Architecture
This application has two main components/apps. It is built loosely on event sourcing principles for aggregating game state.
### The Referee.
This is a nodejs service that runs the event source aggregator, listening to market creation events and remarks(moves) on the chain and builds the state of the games which is stores to mongodb.The referee is also the designated [oracle](https://docs.zeitgeist.pm/docs/learn/using-zeitgeist-markets#the-life-cycle-of-a-zeitgeist-prediction-market) that listens to the MarketEnded event on chain and resolves the market with the correct outcome.
The referee service also exposes a simple REST api for querying aggregated game states.
### The GUI
This is a react application for interacting with the game. It is responsible for showing the gui for the gamestates and for letting the user sign and send transactions for creating markets(new game), buying assets(betting) and making moves(remarks).
### Game Logic
The packages folder also contains a module for the core gamelogic with some tests.