{"id":21038683,"url":"https://github.com/n0-computer/iroh-gossip","last_synced_at":"2025-04-09T14:06:10.209Z","repository":{"id":259411023,"uuid":"876220972","full_name":"n0-computer/iroh-gossip","owner":"n0-computer","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-02T07:19:18.000Z","size":3977,"stargazers_count":30,"open_issues_count":8,"forks_count":6,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-04-02T08:25:59.590Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/n0-computer.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":"code_of_conduct.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-21T15:44:57.000Z","updated_at":"2025-04-02T07:19:18.000Z","dependencies_parsed_at":"2024-12-05T14:18:26.489Z","dependency_job_id":"d6966eb2-9b95-4f4a-889c-498e58b89cab","html_url":"https://github.com/n0-computer/iroh-gossip","commit_stats":null,"previous_names":["n0-computer/iroh-gossip"],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n0-computer%2Firoh-gossip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n0-computer%2Firoh-gossip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n0-computer%2Firoh-gossip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/n0-computer%2Firoh-gossip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/n0-computer","download_url":"https://codeload.github.com/n0-computer/iroh-gossip/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248054230,"owners_count":21039952,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-19T13:34:11.700Z","updated_at":"2025-04-09T14:06:10.157Z","avatar_url":"https://github.com/n0-computer.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# iroh-gossip\n\nThis crate implements the `iroh-gossip` protocol.\nIt is based on *epidemic broadcast trees* to disseminate messages among a swarm of peers interested in a *topic*. \nThe implementation is based on the papers [HyParView](https://asc.di.fct.unl.pt/~jleitao/pdf/dsn07-leitao.pdf) and [PlumTree](https://asc.di.fct.unl.pt/~jleitao/pdf/srds07-leitao.pdf).\n\nThe crate is made up from two modules:\nThe `proto` module is the protocol implementation, as a state machine without any IO.\nThe `net` module connects the protocol to the networking stack from `iroh-net`.\n\nThe `net` module is optional behind the `net` feature flag (enabled by default).\n\n# Getting Started\n\nThe `iroh-gossip` protocol was designed to be used in conjunction with `iroh`. [Iroh](https://docs.rs/iroh) is a networking library for making direct connections, these connections are how gossip messages are sent.\n\nIroh provides a [`Router`](https://docs.rs/iroh/latest/iroh/protocol/struct.Router.html) that takes an [`Endpoint`](https://docs.rs/iroh/latest/iroh/endpoint/struct.Endpoint.html) and any protocols needed for the application. Similar to a router in webserver library, it runs a loop accepting incoming connections and routes them to the specific protocol handler, based on `ALPN`.\n\nHere is a basic example of how to set up `iroh-gossip` with `iroh`:\n```rust\nuse iroh::{protocol::Router, Endpoint};\nuse iroh_gossip::{net::Gossip, ALPN};\n\n#[tokio::main]\nasync fn main() -\u003e anyhow::Result\u003c()\u003e {\n    // create an iroh endpoint that includes the standard discovery mechanisms\n    // we've built at number0\n    let endpoint = Endpoint::builder().discovery_n0().bind().await?;\n\n    // build gossip protocol\n    let gossip = Gossip::builder().spawn(endpoint.clone()).await?;\n\n    // setup router\n    let router = Router::builder(endpoint.clone())\n        .accept(ALPN, gossip.clone())\n        .spawn()\n        .await?;\n    // do fun stuff with the gossip protocol\n    router.shutdown().await?;\n    Ok(())\n}\n```\n\n# License\n\nThis project is licensed under either of\n\n * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or\n   \u003chttp://www.apache.org/licenses/LICENSE-2.0\u003e)\n * MIT license ([LICENSE-MIT](LICENSE-MIT) or\n   \u003chttp://opensource.org/licenses/MIT\u003e)\n\nat your option.\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in this project by you, as defined in the Apache-2.0 license,\nshall be dual licensed as above, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn0-computer%2Firoh-gossip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fn0-computer%2Firoh-gossip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fn0-computer%2Firoh-gossip/lists"}