https://github.com/zen-eth/eth-p2p-z
Ethereum p2p implementation in Zig
https://github.com/zen-eth/eth-p2p-z
beacon-chain gossipsub lean-ethereum libp2p libp2p-muxer libp2p-pubsub libp2p-security libp2p-transport multistream quic zig zig-package ziglang
Last synced: 9 months ago
JSON representation
Ethereum p2p implementation in Zig
- Host: GitHub
- URL: https://github.com/zen-eth/eth-p2p-z
- Owner: zen-eth
- Created: 2024-12-01T03:57:41.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-10-05T08:29:37.000Z (9 months ago)
- Last Synced: 2025-10-05T10:26:07.152Z (9 months ago)
- Topics: beacon-chain, gossipsub, lean-ethereum, libp2p, libp2p-muxer, libp2p-pubsub, libp2p-security, libp2p-transport, multistream, quic, zig, zig-package, ziglang
- Language: Zig
- Homepage:
- Size: 567 KB
- Stars: 19
- Watchers: 2
- Forks: 6
- Open Issues: 31
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# zig-libp2p
Zig implementation of [libp2p](https://libp2p.io/), a modular network stack that allows you to build your own peer-to-peer applications.
**Note**: This is a work in progress and not yet ready for production use. The API may change frequently as we iterate on the design and implementation.
## Prerequisites
- Zig 0.14.1
## Building
To build the project, run the following command in the root directory of the project:
```bash
zig build -Doptimize=ReleaseSafe
```
## Running Tests
To run the tests, run the following command in the root directory of the project:
```bash
zig build test --summary all
```
# Usage
Update `build.zig.zon`:
```sh
zig fetch --save git+https://github.com/zen-eth/zig-libp2p.git
```
In your `build.zig`:
```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);
```