Skip to content

Installation

Prerequisites

Rust Toolchain (Protocol Node)

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"
rustup default stable

Required: Rust 1.75+ (check with rustc --version)

Node.js (SDK, Wallet, Explorer)

# Via nvm (recommended)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash
nvm install 22
nvm use 22

Required: Node.js 22+

Flutter (Mobile Wallet)

# macOS
brew install --cask flutter

# Linux
snap install flutter --classic

Required: Flutter SDK 3.12+

Build the Protocol

cd citizen-protocol
cargo check        # Verify compilation
cargo build --release

The node binary will be at target/release/citizen-node.

Install the TypeScript SDK

cd sdk/typescript
npm install
npm run build

Set Up a Wallet

Choose your surface:

cd wallet/mobile
flutter pub get
flutter run
cd wallet/browser
npm install
npm run build
# Load dist/ as unpacked extension in Chrome/Firefox
cd wallet/desktop
npm install
npm run tauri dev
cd citizen-protocol
cargo build --release -p citizen-wallet-cli
./target/release/citizen-wallet-cli

Verify Your Installation

# Protocol compiles
cd citizen-protocol && cargo test

# SDK builds
cd sdk/typescript && npm test

# Explorer builds
cd explorer/frontend && npm install && npm run build

Troubleshooting

Rust: error: linker 'cc' not found

Install a C compiler:

sudo apt install build-essential
xcode-select --install
sudo dnf install gcc

Node.js: npm ERR! ERESOLVE

Use legacy peer deps resolution:

npm install --legacy-peer-deps

Flutter: Flutter SDK not found

Ensure Flutter is in your PATH:

export PATH="$PATH:/path/to/flutter/bin"