| Crates.io | iroh-gossip-discovery |
| lib.rs | iroh-gossip-discovery |
| version | 0.6.0 |
| created_at | 2025-06-04 03:07:42.928628+00 |
| updated_at | 2025-07-03 21:25:53.59094+00 |
| description | Discover iroh nodes via iroh-gossip |
| homepage | https://github.com/therishidesai/iroh-gossip-discovery |
| repository | https://github.com/therishidesai/iroh-gossip-discovery |
| max_upload_size | |
| id | 1699768 |
| size | 168,642 |
A Rust library implementing gossip-based peer discovery for peer-to-peer networks using the Iroh ecosystem. This library provides automatic peer discovery and address book management through gossip protocols, enabling resilient P2P network formation.
tracing for comprehensive observabilityThe library consists of three main components:
GossipDiscoveryBuilder: Factory for creating gossip discovery instances with configurable optionsGossipDiscoverySender: Handles broadcasting node information and managing peer connectionsGossipDiscoveryReceiver: Processes incoming gossip messages and maintains the neighbor mapNode: Represents a network node with name, ID, and counterNodeInfo: Internal structure tracking node information with timestamps for expirationThe library integrates with Iroh's gossip protocol by:
The library includes a comprehensive example demonstrating peer discovery:
# Start first node (seed)
cargo run --example address_book_demo alice
# Connect additional nodes (use alice's node ID from output)
cargo run --example address_book_demo bob <alice_node_id>
cargo run --example address_book_demo charlie <alice_node_id>
This project uses Nix for reproducible development environments:
# Enter development shell
nix develop
# Build the project
cargo build
# Check code formatting
cargo fmt
# Run linter
cargo clippy
The project includes automated testing for network convergence:
# Test with default settings (5 nodes, 30 seconds)
nix run .#test-network
# Test with custom parameters
nix run .#test-network 10 60 # 10 nodes, 60 seconds
The test script will: