Skip to main content

Quickstart

Get Knight Shield running locally in under 10 minutes.

Prerequisites

  • Node.js v22+
  • pnpm v9+
  • compactc v0.29.0 (Midnight Compact compiler)
  • Docker and Docker Compose (for local Midnight network)
  • Xcode / Android Studio (for mobile development)

1. Clone and Install

git clone https://github.com/knight-shield-wallet.git
cd knight-shield
pnpm install

2. Start Local Midnight Network

docker compose up -d

This starts three services:

  • midnight-node on port 9944 — local Midnight node
  • indexer on port 8088 — block indexer
  • proof-server on port 6300 — ZK proof generation

Wait for all services to be healthy:

docker compose ps

3. Compile Smart Contracts

pnpm compile:contracts

This runs compactc on all 5 .compact files in packages/contracts/ and outputs JS bindings, ZK proving keys, and ZKIR to build/.

4. Build All Packages

pnpm build

Turbo builds core, relay-server, and docs in dependency order.

5. Start the Relay Server

cd packages/relay-server
node dist/server.js

The relay server starts on port 8443 (default) and proxies WebSocket connections to the local Midnight node.

6. Run the Mobile App

cd packages/mobile

# iOS
npx react-native run-ios

# Android
npx react-native run-android

The app connects to the relay server and Midnight node automatically when configured for the standalone network.

7. Verify Everything Works

  1. The mobile app should show the Dashboard screen with a balance of 0
  2. Navigate to GhostCloak and enable it — the relay session should connect
  3. Navigate to GhostShard and create shards — you should see 5 shard entries
  4. Check the relay server logs for session activity

Next Steps