nu-p2p/CLAUDE.md
Mukan Erkin 9cd556a439 feat(nu-p2p): initial Faz 0 scaffold
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-24 00:00:26 +03:00

35 lines
854 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# nu-p2p — CLAUDE.md
P2P ağ katmanı. `nu-node`'dan ayrı tutulur — test ederken network mock'lanabilir.
## Stack
- `libp2p 0.54` — Gossipsub, Kademlia DHT, Identify, Ping
- Tokio async runtime
## Modüller
| Dosya | Sorumluluk |
|-------|-----------|
| `behaviour.rs` | libp2p `NetworkBehaviour` kompozisyonu |
| `messages.rs` | Gossip topic sabitleri + mesaj tipleri |
| `peer.rs` | PeerRegistry (max 50 bağlantı) |
| `config.rs` | Listen addr, bootstrap peers, max peers |
## Gossip Topics
```
nu/blocks/1 → BlockAnnounce, BlockRequest, BlockResponse
nu/txs/1 → TxGossip
nu/votes/1 → VoteAnnounce
nu/validators/1 → ValidatorHeartbeat
```
## Geliştirme
```bash
cargo run --bin nu-p2p
# Faz 1: iki node arası gossip testi
RUST_LOG=debug cargo run --bin nu-p2p -- --bootstrap /ip4/127.0.0.1/tcp/30333
```