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

# Setup

> Configure your environment for the Private Raffle program

# Setup

This guide walks through setting up the Private Raffle project.

## Prerequisites

| Tool       | Version       |
| ---------- | ------------- |
| Rust       | Latest stable |
| Solana CLI | 1.18+         |
| Anchor     | 0.31.1        |
| Node.js    | 18+           |

## Clone the Project

```bash theme={null}
git clone https://github.com/Inco-fhevm/raffle-example-solana.git
cd raffle-example-solana
```

## Install Dependencies

```bash theme={null}
yarn install
```

## Project Structure

```
private-raffle/
├── programs/
│   └── private-lottery/
│       └── src/
│           ├── lib.rs              # Program entry point
│           ├── constants.rs        # Inco Lightning program ID
│           ├── error.rs            # Custom errors
│           ├── state/
│           │   └── mod.rs          # Account structures
│           └── instructions/
│               ├── create_lottery.rs
│               ├── buy_ticket.rs
│               ├── draw_winner.rs
│               ├── check_winner.rs
│               ├── claim_prize.rs
│               └── withdraw_prize.rs
├── tests/
│   └── private-lottery.ts          # Integration tests
├── Anchor.toml
└── package.json
```

## Anchor.toml

```toml theme={null}
[toolchain]
package_manager = "yarn"

[features]
resolution = true
skip-lint = false

[programs.devnet]
private_lottery = "BoGG6xcmbV8HpsEA2qHs6pNUS5h5SfmNRvekf2g17PjB"

[provider]
cluster = "devnet"
wallet = "~/.config/solana/id.json"

[scripts]
test = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"
```

## Cargo.toml (Program)

```toml theme={null}
[package]
name = "private-lottery"
version = "0.1.0"
edition = "2021"

[lib]
crate-type = ["cdylib", "lib"]
name = "private_lottery"

[dependencies]
anchor-lang = { version = "0.31.1", features = ["init-if-needed"] }
inco-lightning = { version = "0.1.4", features = ["cpi"] }
```

## package.json

```json theme={null}
{
  "dependencies": {
    "@coral-xyz/anchor": "^0.31.1",
    "@inco/solana-sdk": "^0.0.2",
    "tweetnacl": "^1.0.3"
  },
  "devDependencies": {
    "ts-mocha": "^10.0.0",
    "typescript": "^5.7.3"
  }
}
```

## Build and Deploy

```bash theme={null}
# Build the program
anchor build

# Get your program ID
solana address -k target/deploy/private_lottery-keypair.json

# Update program ID in Anchor.toml and lib.rs
# Then rebuild
anchor build

# Deploy to devnet
anchor deploy --provider.cluster devnet
```

## Run Tests

```bash theme={null}
anchor test --provider.cluster devnet
```

## Next Steps

Learn about the [Program](/svm/tutorials/private-raffle/program) instructions and account structures.
