Skip to main content
This guide provides detailed instructions for installing and setting up OnchainTestKit in your project.

System Requirements

OnchainTestKit requires the following software to be installed on your system:
  • Node.js: Version 14 or higher
  • Package Manager: npm, yarn, bun, or pnpm
  • Foundry: For running local Anvil nodes
  • Operating System: macOS, Linux, or Windows (with WSL2)

Installation Steps

Installing Foundry

OnchainTestKit uses Anvil (part of Foundry) for local blockchain nodes. Install Foundry using the official installer:
For Windows users, we recommend using WSL2 for the best experience. Foundry works natively on macOS and Linux.

Environment Configuration

Create a .env file in your project root with the following variables:
.env
Never commit .env files to version control. Add .env to your .gitignore file.

Project Structure

We recommend organizing your tests in the following structure:

Playwright Configuration

Create a playwright.config.ts file:
playwright.config.ts

Verifying Installation

Run this command to verify everything is installed correctly:

Next Steps

Now that you have OnchainTestKit installed, you’re ready to: