> ## Documentation Index
> Fetch the complete documentation index at: https://compact-by-example.org/llms.txt
> Use this file to discover all available pages before exploring further.

# Installation & Setup

> Set up Compact development for Midnight: install the Lace wallet, the Compact compiler CLI, and the Docker proof server, then get test tokens.

## Install the Lace wallet

### 1. Download and install the Lace wallet extension

Lace is a browser extension wallet with built-in Midnight support (including mainnet). These steps use Google Chrome; Lace is also available for Brave and Firefox.

1. **Open the Google Chrome browser** - Launch Chrome on your computer.

2. **Install the Lace wallet extension** - Visit the Chrome Web Store: [Lace](https://chromewebstore.google.com/detail/lace/gafhhkghbfjjkeiendhlofajokpaflmk)

3. **Add to Chrome** - Click **Add to Chrome** and confirm by clicking **Add extension**.

4. **Pin the extension** - Pin the extension to your toolbar for easy access (recommended).

<Check>
  **Verification**: The Lace wallet icon appears in your Chrome toolbar.
</Check>

### 2. Create your wallet

1. Open Lace wallet and select **Create a new wallet**.
2. Set a password.
3. Save your seed phrase securely (never store digitally).
4. Confirm seed phrase.

### 3. Get test tokens (tNIGHT and tDUST)

1. Copy your wallet address from Lace.
2. Visit the faucet for your target network:
   * **Preprod** (recommended for development): [https://midnight-tmnight-preprod.nethermind.dev/](https://midnight-tmnight-preprod.nethermind.dev/)
   * **Preview**: [https://midnight-tmnight-preview.nethermind.dev/](https://midnight-tmnight-preview.nethermind.dev/)
3. Paste your address and request **tNIGHT**.
4. Once the tNIGHT arrives, open Lace and delegate it (**Generate tDUST**) to produce tDUST for transaction fees.

## Install Compact

### 4. Install the Compact developer CLI

The Compact developer CLI (`compact`) manages compiler versions, formatting, and project tooling. Install the latest release:

```bash theme={null}
curl --proto '=https' --tlsv1.2 -LsSf https://github.com/midnightntwrk/compact/releases/latest/download/compact-installer.sh | sh
```

The installer adds `compact` to `$HOME/.local/bin` (or your XDG bin directory) and updates your shell rc file (`~/.bashrc` or `~/.zshrc`). Compiler toolchains downloaded by `compact update` are managed under `$HOME/.compact`.

### 5. Activate the new PATH

Open a new terminal, or source your shell rc file:

```bash theme={null}
# Bash
source ~/.bashrc

# Zsh
source ~/.zshrc
```

### 6. Install a compiler and verify

The CLI is a *manager*; you still need to install a Compact compiler:

```bash theme={null}
compact self update        # ensure CLI is on the latest version
compact update             # download the latest compiler
compact --version          # prints the CLI version
compact compile --version  # prints the compiler version (e.g. 0.31.1)
```

<Check>
  **Verification**: both commands print a version. If `compact compile --version` errors with "No default compiler set," re-run `compact update`.
</Check>

## Set up the proof server

### 7. Install Docker Desktop

Download Docker for your operating system:

<CardGroup cols={3}>
  <Card title="macOS" icon="apple" href="https://docs.docker.com/desktop/install/mac-install/">
    Download Docker Desktop for Mac (Intel or Apple Silicon)
  </Card>

  {" "}

  <Card title="Windows" icon="windows" href="https://docs.docker.com/desktop/install/windows-install/">
    Download Docker Desktop for Windows (requires WSL2)
  </Card>

  <Card title="Linux" icon="linux" href="https://docs.docker.com/desktop/install/linux-install/">
    Download Docker Desktop for Linux (Ubuntu, Debian, Fedora)
  </Card>
</CardGroup>

Verify Docker:

```bash theme={null}
docker --version
```

### 8. Run the proof server

Pin a specific image tag so behavior is reproducible. Check the [proof server tags on Docker Hub](https://hub.docker.com/r/midnightntwrk/proof-server/tags) and the [compatibility matrix](https://docs.midnight.network/relnotes/support-matrix) for the current version (8.1.0 for preview/preprod at the time of writing), then run:

```bash theme={null}
docker run -p 6300:6300 midnightntwrk/proof-server:8.1.0 midnight-proof-server -v
```

The proof server is network-agnostic — it takes no network argument. The same command serves preview, preprod, or mainnet; network selection happens in your DApp and wallet configuration.

Keep this terminal open when developing. The proof server listens on `localhost:6300`.

## Install Compact VS Code extension

The extension is not on the VS Code Marketplace; it is distributed as a VSIX. Download the current VSIX from the [official VS Code plugin page](https://docs.midnight.network/compact/compilation-and-tooling/vscode-plugin).

Install in VS Code: **Extensions** → `...` → **Install from VSIX**

## Next steps

<CardGroup cols={2}>
  <Card title="Hello World" icon="hand-wave" href="/basics/hello-world">
    Build your first Compact smart contract
  </Card>

  {" "}

  <Card title="First App" icon="rocket" href="/basics/first-app">
    Create a simple counter application with validation
  </Card>

  {" "}

  <Card title="Primitive Types" icon="shapes" href="/basics/primitive-types">
    Learn about Compact's type system
  </Card>

  <Card title="Midnight Docs" icon="book" href="https://docs.midnight.network">
    Explore the official Midnight documentation
  </Card>
</CardGroup>
