> For the complete documentation index, see [llms.txt](https://valargroup.gitbook.io/shielded-vote-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://valargroup.gitbook.io/shielded-vote-docs/chain/building-from-source.md).

# Building from Source

This page describes how to build the `zallyd` chain binary from source.

## Prerequisites

| Tool        | Minimum version | Notes                                                             |
| ----------- | --------------- | ----------------------------------------------------------------- |
| Go          | 1.24+           | [go.dev/dl](https://go.dev/dl/)                                   |
| Rust        | stable 1.83+    | [rustup.rs](https://rustup.rs/) — used by the Halo2/RedPallas FFI |
| C toolchain | clang or gcc    | Required for CGO (links the Rust static library)                  |
| Git         | any recent      | For cloning                                                       |

## Tool Versions with mise

The repo includes a `mise.toml` that pins Go 1.24.0 and Node 22. If you use [mise](https://mise.jdx.dev/), run:

```bash
mise install
```

This ensures you have the correct Go and Node versions. Rust is **not** managed by mise — each submodule pins its own Rust toolchain via `rust-toolchain.toml`, and rustup handles it automatically.

## Clone and Build

```bash
git clone https://github.com/z-cale/zally.git
cd zally/sdk
make install-ffi
```

This compiles the Rust circuit library, builds `zallyd` with the `halo2` and `redpallas` build tags, and installs the binary to `$GOBIN` (defaults to `~/go/bin`).

## `make install-ffi` vs `make install`

* **`make install-ffi`** — Builds with halo2 and redpallas support enabled. The embedded helper server (which generates ZK proofs for delegated vote submissions) is **functional**. **Always use this for local testing and production.**
* **`make install`** — Builds without halo2/redpallas. The helper server is disabled and votes submitted from the iOS app will fail with HTTP 503 "helper unavailable". Only useful for quick Go-only iteration when you know you won't need ZK proof generation.

## Verify

```bash
zallyd version
```

If the binary was built with `install-ffi`, the version output includes `halo2,redpallas` in the build tags.

## Next Steps

* [Setting Up a Validator](https://github.com/z-cale/shielded-vote-book/blob/main/chain/shielded_vote_book/chain/setting-up-a-validator.md) — join the network
* [Chain API](https://github.com/z-cale/shielded-vote-book/blob/main/chain/shielded_vote_book/chain/chain-api.md) — interact with the chain REST API
