SIOCODE-Open / not-a-bird

Submission for the Polkadot Hackathon Global Series: North America Edition, 2024
0 stars 1 forks source link

Not a Bird

πŸ“– 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

Dependencies

To build and run the game, you need to have the following dependencies installed:

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

Building

Now you can start building the game.

git clone https://github.com/SIOCODE-Open/not-a-bird
npm install

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.

Modifying the backend

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

Credits

This submission was created by the following people:

Name Telegram Discord
Botond - tthe1871
Marcel - fishmac
Frank frankbevr frankbevr