Getting Started with RACE Protocol - RACE-Game/race GitHub Wiki

1. Install Nix

Nix is a package manager for reproducible dev environments. Install it on macOS by opening Terminal and running:

sh <(curl -L https://nixos.org/nix/install)

This will download and install Nix on your machine. For other platforms, see the NixOS download page

2. Enable Nix Flakes

RACE uses Nix flakes to manage dependencies across all its crates. Enable flakes by creating a Nix config file:

mkdir -p ~/.config/nix

echo "experimental-features = nix-command flakes" >> ~/.config/nix/nix.conf

This adds the nix-command and flakes experimental features to your Nix config After this, you can use nix develop and other flake-based commands.

3. Clone RACE Protocol

Get the RACE Protocol source code from GitHub:

git clone https://github.com/RACE-Game/race.git

cd race

This creates a race folder and moves you into it.

4. Enter the Dev Environment

Inside the race repo, run:

nix develop

This will drop you into a shell with all the needed tools (Rust compiler, Node.js, etc.) provided by Nix. Your prompt may change to indicate you’re in a Nix shell.

5. Build the JS SDK

Next, build the RACE JavaScript SDK. From the root of the race repo, do:

cd js

npm i -ws

just sdk

Here, npm i -ws installs all workspace dependencies in the js folder, and just sdk runs the build script for the SDK. (The just tool is a command runner defined in the RACE repo.)

6. (Optional) Build All Components

If you want to compile everything (Rust libraries, RACE transactor/validator servers, facade chain for local development, CLI tools, etc.), you can run:

just build

This will build the latest version of all RACE components in one go. It’s optional if you only need the SDK, but useful for contributing or development. That’s it! You now have a Nix-powered development environment and the RACE Protocol SDK built. You can begin exploring the code or integrating RACE into your Solana game.

RACE Protocol documentation

If you experience any issues or have questions, just ask in for support in RACE Discord | #builders channel

Good luck, and happy building!