Skip to main content

Installation

This guide provides detailed instructions for setting up your FHEVM development environment.

System requirements

Required software

RequirementMinimum versionRecommended
Node.js20+Latest LTS
npm / pnpm10+ / 9+Latest
Git2.40+Latest
Solidity knowledgeIntermediate-
Hardhat or FoundryLatestHardhat 2.28+

Operating systems

  • macOS 12+ (Monterey or later)
  • Linux (Ubuntu 20.04+, Debian 11+, or equivalent)
  • Windows 10/11 with WSL2 (Ubuntu 20.04+ recommended)
Native Windows is not recommended. Use WSL2 with Ubuntu for best compatibility.

Step-by-step installation

1. Install Node.js

brew install node@20
Verify installation:
node --version  # Should output v20.x.x or higher
npm --version   # Should output 10.x.x or higher

2. Install Git

brew install git
Verify installation:
git --version  # Should output 2.40+ or higher

3. Clone the repository

git clone https://github.com/Himess/fhevm-bootcamp.git
cd fhevm-bootcamp

4. Install dependencies

npm install
This installs all required packages: Core dependencies:
  • @fhevm/solidity (v0.10.0) - FHE Solidity library
  • @fhevm/mock-utils (v0.4.0) - Testing utilities
Development dependencies:
  • @fhevm/hardhat-plugin (v0.4.0) - Hardhat integration
  • hardhat (v2.28.5) - Development framework
  • @nomicfoundation/hardhat-ethers - Ethers.js integration
  • @typechain/hardhat - TypeScript bindings generator
  • hardhat-gas-reporter - Gas usage analysis
The postinstall script will automatically patch the fhEVM plugin. This is normal.

5. Compile contracts

npx hardhat compile
Expected output:
Generating typings for: 35 artifacts in dir: types for target: ethers-v6
Successfully generated 70 typings!
Compiled 35 Solidity files successfully
This compiles all 35 contracts and generates TypeScript type bindings.

6. Run tests

npm test
Expected output:
  SimpleStorage
    ✓ should store and retrieve a value
    ✓ should emit ValueChanged event

  BasicToken
    ✓ should have correct initial supply
    ✓ should transfer tokens

  ...

  328 passing (Xs)
All 328 tests run locally in mock FHE mode. No testnet connection is needed.

Environment configuration

Local development

For local development, no environment configuration is needed. The Hardhat network runs in mock FHE mode by default.

Sepolia testnet deployment

1

Create environment file

cp .env.example .env
2

Add your private key

Edit .env and add your private key:
.env
PRIVATE_KEY=your_private_key_without_0x_prefix
SEPOLIA_RPC_URL=https://ethereum-sepolia-rpc.publicnode.com
Never commit your .env file or share your private key. The .gitignore file is configured to exclude .env.
3

Get Sepolia ETH

You need Sepolia ETH to deploy contracts. Get some from:
4

Test deployment

npm run deploy:sepolia
This will deploy all contracts to Sepolia testnet.

Project structure

After installation, your project structure will look like this:
fhevm-bootcamp/
├── contracts/              # 35 Solidity contracts
│   ├── SimpleStorage.sol   # Module 00
│   ├── HelloFHEVM.sol      # Module 02
│   ├── ConfidentialERC20.sol
│   └── ...
├── test/                   # 35 test files (328 tests)
├── modules/                # 20 learning modules
│   ├── 00-prerequisites/
│   ├── 01-intro-to-fhe/
│   └── ...
├── curriculum/
│   ├── SYLLABUS.md
│   ├── LEARNING_PATHS.md
│   └── HOMEWORK.md
├── resources/
│   ├── CHEATSHEET.md
│   ├── COMMON_PITFALLS.md
│   ├── GAS_GUIDE.md
│   └── SECURITY_CHECKLIST.md
├── exercises/              # Starter templates
├── solutions/              # Complete solutions
├── scripts/
│   ├── deploy-all.ts
│   └── deploy-sepolia.ts
├── hardhat.config.ts
├── package.json
└── tsconfig.json

Docker installation (alternative)

If you prefer a containerized environment:

Prerequisites

  • Docker Desktop 4.0+ (macOS/Windows)
  • Docker Engine 20.10+ (Linux)
  • Docker Compose 2.0+

Setup

1

Clone repository

git clone https://github.com/Himess/fhevm-bootcamp.git
cd fhevm-bootcamp
2

Run tests

docker compose up
This will:
  1. Build the Docker image
  2. Install all dependencies
  3. Compile contracts
  4. Run all 328 tests
3

Interactive shell

For interactive development:
docker compose run --rm bootcamp sh
Inside the container:
npx hardhat compile
npm test
npm run deploy:local

Verify installation

Run this checklist to verify your installation is complete:
1

Node.js version

node --version
Should output v20.x.x or higher
2

Dependencies installed

npm list @fhevm/solidity @fhevm/hardhat-plugin
Should show both packages installed
3

Contracts compiled

ls -la artifacts/contracts/
Should show compiled contract artifacts
4

Tests passing

npm test
Should show “328 passing”
5

TypeScript types generated

ls -la types/
Should show generated TypeScript types
If all checks pass, your installation is complete and you’re ready to start the bootcamp!

IDE setup

1

Install VS Code

Download from code.visualstudio.com
2

Install recommended extensions

3

Open project

code .

IntelliJ IDEA / WebStorm

1

Install Solidity plugin

Go to Settings → Plugins → Search for “Solidity” → Install
2

Enable Prettier

Go to Settings → Languages & Frameworks → JavaScript → Prettier Enable “On save” formatting
3

Open project

File → Open → Select fhevm-bootcamp directory

Troubleshooting

Node.js version issues

If you have an older Node.js version, use nvm to manage versions:
# Install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash

# Install Node.js 20
nvm install 20
nvm use 20

Compilation errors

If compilation fails:
# Clean and rebuild
npm run clean
npm run compile

Missing dependencies

If you see “Cannot find module” errors:
# Reinstall dependencies
rm -rf node_modules package-lock.json
npm install

Permission errors (Linux/macOS)

If you get EACCES errors:
# Fix npm permissions
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
source ~/.bashrc

WSL2 performance issues

For better performance on WSL2:
  1. Store the project in the Linux filesystem (~/projects), not Windows (/mnt/c/)
  2. Run wsl --update to get the latest WSL2 version
  3. Allocate more memory to WSL2 in .wslconfig:
.wslconfig
[wsl2]
memory=8GB
processors=4

Next steps

Quick start

Get up and running in 10 minutes

Curriculum overview

Explore the 4-week program structure

Additional resources

If you encounter issues not covered here, please report them on the GitHub repository.

Build docs developers (and LLMs) love