π Click here to read the old readme
π Welcome to Not a Bird! This repository contains our submission for the Polkadot Global 2024: North America Edition.
π Not a Bird is a blockchain game, which involved crafting, trading and collectively working towards a goal so that players are rewarded. This readme contains technical information about the game, such as how to build it, and explanation of some parts of the code.
π¨βπ If you just want to learn about the game, look at the game documentation here.
πΉοΈ If you just want to start playing the game, click here to open it.
π½οΈ To see our presentation (pitched live at Polkadot Social in Austin, Texas, USA), go to this page
To build and run the game, you need to have the following dependencies installed:
substrate-contracts-node
cargo contract
Here is a quick script, which has been tested on Ubuntu 22.04
, and sets up the necessary tools for building:
#!/bin/bash
sudo apt update
sudo apt install build-essential make automake pkg-config curl git unzip zip
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
. "$HOME/.cargo/env"
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
rustup component add rust-src
cargo install --force --locked cargo-contract
nvm install 20
Note: you still have to download or build substrate-contracts-code
, you can get it from here
Now you can start building the game.
git clone https://github.com/SIOCODE-Open/not-a-bird
npm install
substrate-contracts-node
locally, so that you can deploy the contracts, and generate the contract data in the contract client libraries:In one terminal you should run:
substrate-contracts-node --dev
In another terminal you should run:
npm run deploy:contracts
npm run build
The game will be ready as a single-page application in the packages/app-game/dist
directory.
You can also run npm run serve
, which will start the build pipeline in watch mode, and serves the game locally.
If you modify the contract code, you will have to rebuild all contracts from scratch, and deploy them locally so that client libraries are re-generated.
After modifications, use this command to build all contracts:
npm run build:contracts
If you want to build only a single contract, you can use the following command:
npm run c:<contract name>
For example, if you want to build the water
contract, you can use the following command:
npm run c:water
This submission was created by the following people:
Name | Telegram | Discord |
---|---|---|
Botond | - | tthe1871 |
Marcel | - | fishmac |
Frank | frankbevr | frankbevr |