Prool is a TypeScript-first library designed to provide programmatic HTTP testing instances for various Ethereum components. It enables developers to spin up local execution nodes (like Anvil and Tempo) and ERC-4337 bundler nodes (like Alto) within testing environments such as Vitest. The library is currently at version `0.2.4` and maintains an active release cadence with frequent patch and minor updates. A key differentiator is its focus on streamlining the setup and teardown of these instances for reliable, isolated tests, abstracting away the complexities of managing external processes or Docker containers. Users can utilize pre-configured instances or define custom ones to suit specific testing needs, requiring Node.js >=22. It integrates with `testcontainers` for containerized instances.
npm install proolVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to create and manage an Anvil execution node instance using Prool, including starting and stopping the server, and noting required external dependencies.
Change your import from `import { Instance } from 'prool'` to `import { Instance } from 'prool/testcontainers'` and update `Instance.tempoDocker` to `Instance.tempo`.If you were using these instances, you will need to migrate to alternative solutions or define a custom instance using `Instance.define` if the underlying service is still supported elsewhere.
Ensure your Node.js environment is updated to version 22 or later. You can use a version manager like `nvm` to switch Node.js versions: `nvm install 22 && nvm use 22`.
Upgrade Prool to `v0.2.4` or newer. This version fixes the issue by ensuring containers bind to `127.0.0.1` with dynamically mapped exposed ports.
Install Foundry (for Anvil) via `curl -L https://foundry.paradigm.xyz | bash` or Tempo CLI (for Tempo) via `curl -L https://tempo.xyz/install | bash`.
Update your import statement to `import { Instance } from 'prool/testcontainers'` and change `Instance.tempoDocker` to `Instance.tempo`.Switch to ESM `import` statements: `import { Server } from 'prool'` instead of `const { Server } = require('prool')`.Upgrade Prool to `v0.2.4` or newer to leverage the fix for macOS host networking. Ensure Docker Desktop is running and healthy.
Install Foundry globally by running `curl -L https://foundry.paradigm.xyz | bash` and ensure it's added to your shell's PATH.