Installation¶
This guide covers how to install Zig EVM and its language bindings.
Prerequisites¶
- Zig 0.13.0 or later - Download Zig
For language bindings:
- Python 3.8+ (for Python bindings)
- Rust 1.70+ (for Rust bindings)
- Node.js 18+ (for JavaScript bindings)
Building from Source¶
Clone the Repository¶
Build the EVM¶
# Build and run the CLI demo
zig build run
# Run all tests
zig build test
# Build with optimizations
zig build -Doptimize=ReleaseFast
Build the Shared Library¶
To use Zig EVM from other languages, build the shared library:
This produces:
| Platform | Shared Library | Static Library | Header |
|---|---|---|---|
| Linux | zig-out/lib/libzigevm.so | zig-out/lib/libzigevm.a | zig-out/include/zigevm.h |
| macOS | zig-out/lib/libzigevm.dylib | zig-out/lib/libzigevm.a | zig-out/include/zigevm.h |
| Windows | zig-out/lib/zigevm.dll | zig-out/lib/zigevm.lib | zig-out/include/zigevm.h |
Language Bindings¶
Python¶
Or install after building the library:
Verify the installation:
from zigevm import EVM
evm = EVM()
print("Zig EVM Python bindings installed successfully!")
evm.destroy()
Rust¶
Add to your Cargo.toml:
Or build from source:
JavaScript / Node.js¶
Or when published to npm:
Verifying Installation¶
Run Tests¶
Run Demos¶
# Basic EVM demo
zig build run
# Parallel execution demo
zig build parallel-opt
# Performance benchmarks
zig build benchmark
Build Targets Reference¶
| Command | Description |
|---|---|
zig build run | Build and run CLI demo |
zig build test | Run unit tests |
zig build compliance | Run Ethereum compliance tests |
zig build lib | Build shared/static libraries |
zig build parallel | Run parallel execution demo |
zig build parallel-opt | Run optimized parallel demo |
zig build benchmark | Run performance benchmarks |
zig build bench | Run simple benchmarks |
zig build demo | Run benchmark demonstration |
Build Options¶
# Release build with optimizations
zig build run -Doptimize=ReleaseFast
# Cross-compile for different targets
zig build run -Dtarget=x86_64-linux
zig build run -Dtarget=aarch64-macos
zig build run -Dtarget=x86_64-windows
Next Steps¶
- Quick Start - Run your first EVM code
- Basic Usage - Learn the fundamentals