Contracts, client libraries, and plugins for the on-chain Downstream game.
See the docs
Building with Docker
If you only need a local copy of the game built (without development helpers like hot reloading etc), then the easist way is to provision using Docker Compose.
You need to build the unity map project first:
make map
Then to build and start the client and supporting services run:
docker compose up --build
Client will be available at locahost:3000
Building from Source (For Development) - macOS/Linux
If you are working on the client, then you will need to build everything yourself.
You will need the following tools installed:
- Javascript toolchain (node lts/gallium)
- Go toolchain (go v1.19)
- Solidity toolchain (foundry)
- Ethereum binaries (abigen)
- Git (The in-house frontend is Fork)
- Git-LFS
- Unity Editor (2021.3.13f1)
- Unity WebGL submodule
Make sure LFS is initialised and then clone this repository:
git lfs version
git clone --recurse-submodules https://github.com/playmint/ds.git
build and start the client and supporting services in development mode run:
make dev
Client will be available at localhost:3000
Building from Source (For Development) - Windows
This guide provides a detailed, step-by-step process for Windows users who are setting up a development environment for the client.
These are the tools you will be installing:
- OS Tools:
- Git
- Unity Editor 2021.3.13f1
- Unity WebGL submodule
- Terminal Tools (Using WSL):
- make
- gcc
- node
- go (version go1.19.13 - similar versions may be fine)
- forge (version 0.2.0)
- solc (version 0.8.15 to 0.8.21)
Please refer to the instructions below for setup guidance.
- Install Unity Hub
- Install Unity Editor version 2021.3.13f1 via Unity LTS archive
- Use
"C:\Program Files\Unity\Hub\Editor\2021.3.13f1"
as your install path (be sure to change the default path and folder name) - Install WebGL submodule
- Use
- Install Git: Visit Git SCM for download and installation.
- Clone the Repository: Use the following command, (do not clone within WSL):
git clone --recurse-submodules https://github.com/playmint/ds
- Install WSL: Follow the guide at Microsoft WSL Install. Note that enabling virtualization might vary based on your CPU model.
- Initial Setup in PowerShell:
- Run
wsl --install
. - Restart your PC.
- Upon reboot, follow the on-screen instructions to complete Ubuntu setup.
- Create a username and password as per Microsoft's best practices.
- Run
- Switch to WSL1: The default WSL2 can be changed to WSL1, which works better for our purposes.
- In PowerShell, run
wsl --list --verbose
to find your Ubuntu distribution name. - Switch to WSL1 with
wsl --set-version [distribution name] 1
. Example:wsl --set-version Ubuntu 1
.
- In PowerShell, run
-
Access WSL: Use
wsl
command in PowerShell or open the Ubuntu application. -
Install gcc & make: (From now on we should be in WSL)
sudo apt update sudo apt install build-essential
-
Install Node:
-
Recommended to use nvm (nvm install script).
-
Run the following commands:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
Navigate to the
ds
directory and runnvm install
.e.g. $
cd /mnt/d/playmint/ds
(Where you cloned the ds repository) - Take note of /mnt/ as the path will look different to the normal Windows path
-
-
Install Go:
- Download go1.19.13.linux-amd64.tar.gz from Go Downloads.
- Follow installation instructions at Go Install Guide under the Linux section.
-
Install solc:
sudo add-apt-repository ppa:ethereum/ethereum sudo apt-get update sudo apt-get install solc sudo apt-get install abigen
-
Install Foundry (forge and anvil):
- Follow instructions at Foundry Installation:
curl -L https://foundry.paradigm.xyz | bash foundryup
- Follow instructions at Foundry Installation:
- Set environment variable:
NODE_OPTIONS=--max-old-space-size=4096
- Restart your machine.
- Update Node packages:
npm update -g
- Update Node packages:
npm cache clean -f
- In the ds directory, run
make dev
- In your browser, open
http://localhost:3000/
Building from source (for production)
Github Actions will build production ready Docker images on merge to main
available: ghcr.io/playmint/ds
To build the image yourself run:
docker build -t ghcr.io/playmint/ds:latest .