What is Tevm Node?
Tevm Node is a full Ethereum execution environment that runs natively in JavaScript. It provides the complete functionality of an Ethereum node without requiring any blockchain client installation.
Conceptually, it works very similar to Anvil and Hardhat but with more powerful TypeScript native interop.
What Makes Tevm Unique?
Unlike traditional development environments like Hardhat or Anvil, Tevm Node offers several distinct advantages:
- Cross-Platform Compatibility — The same code works everywhere JavaScript runs, with zero native dependencies including your applications in the browser
- Fine-grained EVM Control — Access the execution environment at any level of detail, from high-level transactions to individual EVM opcodes
- Enhanced User Experience — Enable advanced features like instantaneous gas estimation, optimistic UI updates, and sophisticated transaction simulation
- Type-safe Interactions — Full TypeScript support throughout the entire API surface powered by
abitype
- Direct Solidity Imports — The powerful ability to write solidity code that interops with your TypeScript code in a typesafe way via the Tevm Bundler
Universal JavaScript Compatibility
Tevm's key innovation is bringing the Ethereum execution environment to every JavaScript runtime:
Node.js
For local development, testing, and CI/CD pipelines
Browser
For advanced dApps with offline capability and real-time simulation
Any JS Runtime
Works in Deno, Bun, Edge Functions, or any modern JavaScript environment
Integration With Popular Libraries
Tevm works with the libraries you already know and love including viem
wagmi
and ethers
:
import { createMemoryClient, http } from "tevm";
const client = createMemoryClient();
// Use standard viem actions
const balance = await client.getBalance({ address: "0x..." });
const blockNumber = await client.getBlockNumber();
// Plus Tevm-specific actions
await client.tevmMine({ blocks: 1 });
await client.tevmSetAccount({
address: "0x...",
balance: 100000000000000000n, // 0.1 ETH
});
How Tevm Compares
Feature | Tevm | Anvil | Hardhat | Ganache |
---|---|---|---|---|
Language | JavaScript/Wasm | Rust | JavaScript/Rust | JavaScript |
Browser Compatible | ✅ | ❌ | ❌ | ❌ |
Minimal Dependencies | ✅ | ✅ | ❌ | ❌ |
Mainnet Forking | ✅ | ✅ | ✅ | ✅ |
EVM Event Hooks | ✅ | ❌ | ❌ | ❌ |
Custom Precompiles | ✅ | ✅ | ❌ | ❌ |
viem Integration | Native | Some | Minimal | Minimal |
ethers Integration | Native | Minimal | Minimal | Some |
Debugging | Advanced | Advanced | Advanced | Basic |
TypeScript Support | Full | Limited | Full | Full |
Serverless Compatible | ✅ | ❌ | ❌ | ✅ |
Optimized forking performance | ✅ | ❌ | ❌ | ❌ |
Library Compatibility
Library | Support Level | Notes |
---|---|---|
viem | Native | First-class native integration with all viem features |
ethers.js | Full | Both v5 and v6 via EIP-1193 provider |
web3.js | Full | Via EIP-1193 provider |
wagmi | Full | Works as a wagmi connector |
thirdweb | Full | Compatible with thirdweb's SDK |
Ponder | Full | Can be used to do advanced tracing in ponder handlers and import contracts into ponder config |
ethereumjs | Native | Implements the same interfaces as Ethereumjs. Ethereumjs users can take advantage of Tevm StateManager to get Tevm like features such as forking in ethereumjs |
Any EIP-1193 library | Full | Standard provider interface |