
Embed the native ZEVM engine directly in Node.js — with a viem-compatible client, HTTP/WebSocket/IPC servers, opcode tracing, and direct Solidity imports.
pnpm add tevm viemimport { createMemoryClient, parseAbi } from 'tevm'
const client = createMemoryClient()
try {
// Deploy a minimal contract that returns 42
const deployed = await client.tevmDeploy({
bytecode: '0x600a600c600039600a6000f3602a60005260206000f3',
})
// Call it with typed ABI decoding, or use any viem public/wallet/test action
const result = await client.tevmContract({
address: deployed.createdAddress!,
abi: parseAbi(['function answer() view returns (uint256)']),
functionName: 'answer',
})
console.log(result.data) // 42n
} finally {
await client.tevmClose()
}In-Process Native Engine
Runs ZEVM, Voltaire, and Guillotine Mini over Node-API. Each client owns isolated chain state with no external daemon.
Architecture →Viem & Ethers Native
Full viem public, wallet, and Anvil test actions out of the box, plus TevmProvider for ethers v6.
Lazy Mainnet Forking
Fork any EVM RPC at a pinned block. State loads lazily on cache miss; local writes never leave your process.
Forking guide →HTTP, WebSocket & IPC
Expose any local client over HTTP, WebSocket subscriptions, or Unix IPC for browser apps and external tools.
Server guide →Direct Solidity Imports
Import .sol files as typed TypeScript modules in Vite, Rollup, esbuild, Webpack, Rspack, and Bun.
Native Tracing & MCP
Record opcode traces with debug_traceCall or give AI coding agents isolated EVM sessions via @tevm/mcp.
"If you're building a blockchain application on the web, I'm almost certain there is a use case for Tevm. It might change everything, and at worse it would most likely improve your devX."
polarzero · @0xpolarzero · More from the community →
Plain-text docs for LLMs: llms.txt · llms-full.txt
