{"id":19358357,"url":"https://github.com/paritytech/litep2p","last_synced_at":"2025-04-05T23:11:22.043Z","repository":{"id":165326615,"uuid":"614359210","full_name":"paritytech/litep2p","owner":"paritytech","description":"Peer-to-peer networking library","archived":false,"fork":false,"pushed_at":"2025-03-18T16:15:34.000Z","size":12571,"stargazers_count":97,"open_issues_count":99,"forks_count":13,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-03-29T22:09:31.157Z","etag":null,"topics":["libp2p","networking","peer-to-peer","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paritytech.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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":"2023-03-15T12:35:06.000Z","updated_at":"2025-03-25T23:57:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"dba475ca-34a6-4dd2-a747-26a6d851328a","html_url":"https://github.com/paritytech/litep2p","commit_stats":{"total_commits":1024,"total_committers":9,"mean_commits":"113.77777777777777","dds":0.146484375,"last_synced_commit":"ed801e4d1e7ec6fe64bce097535927e5305f97f4"},"previous_names":["paritytech/litep2p"],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paritytech%2Flitep2p","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paritytech%2Flitep2p/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paritytech%2Flitep2p/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paritytech%2Flitep2p/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paritytech","download_url":"https://codeload.github.com/paritytech/litep2p/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247411236,"owners_count":20934653,"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":["libp2p","networking","peer-to-peer","rust"],"created_at":"2024-11-10T07:11:22.733Z","updated_at":"2025-04-05T23:11:22.004Z","avatar_url":"https://github.com/paritytech.png","language":"Rust","funding_links":[],"categories":["Implementations"],"sub_categories":[],"readme":"# litep2p\n\n[![License](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE) [![Crates.io](https://img.shields.io/crates/v/litep2p.svg)](https://crates.io/crates/litep2p) [![docs.rs](https://img.shields.io/docsrs/litep2p.svg)](https://docs.rs/litep2p/latest/litep2p/)\n\n`litep2p` is a [`libp2p`](https://libp2p.io/)-compatible *peer-to-peer (P2P)* networking library\n\n## Features\n\n* Supported protocols:\n  * `/ipfs/ping/1.0.0`\n  * `/ipfs/identify/1.0.0`\n  * `/ipfs/kad/1.0.0`\n  * `/ipfs/bitswap/1.2.0`\n  * Multicast DNS\n  * Notification protocol\n  * Request-response protocol\n  * API for creating custom protocols \n* Supported transports:\n  * TCP\n  * QUIC\n  * WebRTC\n  * WebSocket (WS + WSS)\n\n## Usage\n\n`litep2p` has taken a different approach with API design and as such is not a drop-in replacement for [`rust-libp2p`](https://github.com/libp2p/rust-libp2p/). Below is a sample usage of the library:\n\n```rust\nuse futures::StreamExt;\nuse litep2p::{\n    config::ConfigBuilder,\n    protocol::{libp2p::ping, request_response::ConfigBuilder as RequestResponseConfigBuilder},\n    transport::{quic::config::Config as QuicConfig, tcp::config::Config as TcpConfig},\n    Litep2p, ProtocolName,\n};\n\n// simple example which enables `/ipfs/ping/1.0.0` and `/request/1` protocols\n// and TCP and QUIC transports and starts polling events\n#[tokio::main]\nasync fn main() {\n    // enable IPFS PING protocol\n    let (ping_config, mut ping_event_stream) = ping::Config::default();\n\n    // enable `/request/1` request-response protocol\n    let (req_resp_config, mut req_resp_handle) =\n        RequestResponseConfigBuilder::new(ProtocolName::Static(\"/request/1\"))\n            .with_max_size(1024)\n            .build();\n\n    // build `Litep2pConfig` object\n    let config = ConfigBuilder::new()\n        .with_tcp(TcpConfig {\n            listen_addresses: vec![\n                \"/ip6/::1/tcp/0\".parse().expect(\"valid address\"),\n                \"/ip4/127.0.0.1/tcp/0\".parse().expect(\"valid address\"),\n            ],\n            ..Default::default()\n        })\n        .with_quic(QuicConfig {\n            listen_addresses: vec![\"/ip4/127.0.0.1/udp/0/quic-v1\"\n                .parse()\n                .expect(\"valid address\")],\n            ..Default::default()\n        })\n        .with_libp2p_ping(ping_config)\n        .with_request_response_protocol(req_resp_config)\n        .build();\n\n    // build `Litep2p` object\n    let mut litep2p = Litep2p::new(config).unwrap();\n\n    loop {\n        tokio::select! {\n            _event = litep2p.next_event() =\u003e {},\n            _event = req_resp_handle.next() =\u003e {},\n            _event = ping_event_stream.next() =\u003e {},\n        }\n    }\n}\n```\n\nSee[`examples`](https://github.com/altonen/litep2p/tree/master/examples) for more details on how to use the library\n\n## Copying\n\nMIT license\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparitytech%2Flitep2p","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparitytech%2Flitep2p","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparitytech%2Flitep2p/lists"}