# Local setup

> Get a local Privacy Pools v2 development environment running against the Sepolia testnet.

Get a local Privacy Pools v2 development environment running against the Sepolia testnet.

## Prerequisites

-   Node 18+ (Node 20 LTS recommended).
-   pnpm 10.27.0, the version pinned in the monorepo's `packageManager` field (workspaces are pnpm-flavored).
-   A Sepolia RPC endpoint (Alchemy free tier works for moderate development, though rate limits bite under cold-sync).
-   A wallet with Sepolia ETH for gas and the tokens you want to deposit.

## Clone v2-monorepo

```bash
git clone https://github.com/0xbow-io/v2-monorepo.git
cd v2-monorepo
pnpm install
```

## Build the SDK

```bash
pnpm --filter @privacy-pools-v2/sdk build
# Outputs: packages/sdk/dist/
```

## Run the sample app

The reference end-to-end integration is in `apps/sample/`:

```bash
cd apps/sample
cp .env.example .env
# Fill in RPC_URL, PRIVATE_KEY, ASP_URL, RELAYER_*

pnpm check:registerKeystore       # register auth policy + viewing key
pnpm check:deposit                # native ETH deposit
pnpm check:transferToEVMAddress   # private transfer to an EVM address
pnpm check:withdraw               # withdraw to public
pnpm check:ragequit               # emergency exit
# (run 'pnpm run' in apps/sample to list every check:* scenario)
```

## RPC notes

-   Alchemy free tier: works for low-volume dev. Cold-sync may hit rate limits.
-   Self-hosted Geth: zero rate limits, but Sepolia archive node is ~1.5TB.
-   QuickNode / Infura: paid tiers handle the cold-sync pattern fine.

## Circuits

The `packages/circuits/build/` directory ships with pre-compiled artifacts (LFS-tracked). For the sample, point `circuitArtifactsDir` at that path. For browser apps, copy a subset into `public/circuits/` and use [`FetchCircuitArtifacts`](/sdk/circuit-artifacts).

## Building your own app

The in-monorepo samples are the closest reference integrations:

-   `apps/sample`: Node/CLI end-to-end flows (deposit, transfer, withdraw, ragequit, keystore, [payment requests](/operations/payment-requests)) exposed as `check:*` scripts.
-   `apps/sample-web`: browser integration, including the `FetchCircuitArtifacts` reference implementation.
