Zig implementation of the Ethereum peer-to-peer stack, built on top of the libp2p architecture.
Note: This project is pre-release software. Expect rapid iteration and frequent breaking API changes while we carve out the Ethereum-focused feature set.
- Transport: QUIC (lsquic-backed) is the only supported transport. TCP, WebRTC, WebTransport, and other stacks are intentionally out of scope.
- PubSub: Gossipsub v1.0 router is available today; additional Ethereum networking protocols will be layered on top in subsequent milestones.
- Platform: Zig 0.14.1 toolchain targeting modern desktop/server environments. Browser runtimes are not supported.
If you are looking for a general-purpose libp2p implementation with multiple transports and protocol stacks, this project is not a drop-in replacement.
- Zig 0.14.1
To build the project, run the following command in the root directory of the project:
zig build -Doptimize=ReleaseSafeTo run the tests, run the following command in the root directory of the project:
zig build test --summary allUpdate build.zig.zon:
zig fetch --save git+https://github.com/zen-eth/zig-libp2p.gitIn your build.zig:
const libp2p_dep = b.dependency("libp2p", .{
.target = target,
.optimize = optimize,
});
const libp2p_module = libp2p_dep.module("zig-libp2p");
root_module.addImport("libp2p", libp2p_module);