{"id":21664692,"url":"https://github.com/swift-libp2p/swift-libp2p-identify","last_synced_at":"2026-04-30T16:32:18.259Z","repository":{"id":122482271,"uuid":"505914275","full_name":"swift-libp2p/swift-libp2p-identify","owner":"swift-libp2p","description":"Peer Identification Protocols (Embedded)","archived":false,"fork":false,"pushed_at":"2025-03-06T22:58:06.000Z","size":149,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-20T06:22:33.949Z","etag":null,"topics":["identify","ipfs","libp2p","p2p","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/swift-libp2p.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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,"zenodo":null}},"created_at":"2022-06-21T16:06:06.000Z","updated_at":"2025-03-06T22:56:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"9c8f86c7-5c7a-41cd-9635-7ece0e4e4c86","html_url":"https://github.com/swift-libp2p/swift-libp2p-identify","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/swift-libp2p/swift-libp2p-identify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swift-libp2p%2Fswift-libp2p-identify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swift-libp2p%2Fswift-libp2p-identify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swift-libp2p%2Fswift-libp2p-identify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swift-libp2p%2Fswift-libp2p-identify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/swift-libp2p","download_url":"https://codeload.github.com/swift-libp2p/swift-libp2p-identify/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/swift-libp2p%2Fswift-libp2p-identify/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266240918,"owners_count":23898062,"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":["identify","ipfs","libp2p","p2p","swift"],"created_at":"2024-11-25T10:41:57.623Z","updated_at":"2026-04-30T16:32:18.252Z","avatar_url":"https://github.com/swift-libp2p.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Identify (Embedded)\n\n[![](https://img.shields.io/badge/made%20by-Breth-blue.svg?style=flat-square)](https://breth.app)\n[![](https://img.shields.io/badge/project-libp2p-yellow.svg?style=flat-square)](http://libp2p.io/)\n[![Swift Package Manager compatible](https://img.shields.io/badge/SPM-compatible-blue.svg?style=flat-square)](https://github.com/apple/swift-package-manager)\n![Build \u0026 Test (macos and linux)](https://github.com/swift-libp2p/swift-libp2p-identify/actions/workflows/build+test.yml/badge.svg)\n\n\u003e A core set of protocols used for `Identify`ing peers within libp2p\n\n## Table of Contents\n\n- [Overview](#overview)\n- [Install](#install)\n- [Usage](#usage)\n  - [Example](#example)\n  - [API](#api)\n- [Contributing](#contributing)\n- [Credits](#credits)\n- [License](#license)\n\n## Overview\nIdentify consists of a set of protocols used to help identify remote peers within the libp2p ecosystem. The protocols included within Identify are...\n\n- /ipfs/id \n   - This protocol exchanges Signed Peer Records used for confirming a remote Peer is who they claim to be, the addresses they're listening on and the protocols they speak.\n- /ipfs/id/push\n   - An extension of `/ipfs/id` that pushes changes to a Peers listening addresses and protocols as they update in realtime.\n- /ipfs/id/delta\n   - An extension of `/ipfs/id` that pushes `delta` (partial) Peer Records that contain changes since an initial `/ipfs/id` Peer Record exchange\n- /ipfs/ping\n   - A ping protocol that allows for quick and easy pings to libp2p Peers for measuring latency, testing liveness/connectivity, etc.\n\n#### For more details see \n- [Multiformats / Mulitbase Spec](https://github.com/multiformats/multibase/blob/master/README.md)\n\n\n## Install \n\u003e [!CAUTION]\n\u003e This package is embedded into [swift-libp2p](https://github.com/swift-libp2p/swift-libp2p) . There's no need to include this package as a dependency in your swift-libp2p project.\n\nInclude the following dependency in your Package.swift file\n```Swift\nlet package = Package(\n    ...\n    dependencies: [\n        ...\n        .package(url: \"https://github.com/swift-libp2p/swift-libp2p-identify.git\", .upToNextMinor(from: \"0.1.0\"))\n    ],\n    ...\n        .target(\n            ...\n            dependencies: [\n                ...\n                .product(name: \"LibP2PIdentify\", package: \"swift-libp2p-identify\"),\n            ]),\n    ...\n)\n```\n\n## Usage\n\u003e [!CAUTION]\n\u003e This package is embedded into [swift-libp2p](https://github.com/swift-libp2p/swift-libp2p) . There's no need to include this package as a dependency in your swift-libp2p project.\n\n```Swift\n\n/// Tell swift-libp2p to use Identify (the standard swift-libp2p implementation does this automatically)\napp.identityManager.use(.default)\n\n```\n\n\n### Example\n\n```Swift\n\n/// Manually ping a peer\napp.identify.ping(peer: peerID).map { \n    print(\"Latency: \\($0)\")\n}\n// or asynchronously\nlet ping = try await app.identify.ping(peer: peerID)\n\n/// Manually ping a multiaddr\napp.identify.ping(addr: multiaddr).map { \n    print(\"Latency: \\($0)\")\n}\n// or asynchronously\nlet ping = try await app.identify.ping(peer: multiaddr)\n\n```\n\n### API\n```Swift\n\n/// Attempts to Ping a Peer, returns the time it took to receive a response.\npublic func ping(peer: PeerID) -\u003e EventLoopFuture\u003cTimeAmount\u003e \npublic func ping(peer: PeerID) async throws -\u003e TimeAmount \n\n/// Attempts to Ping a Multiaddr, returns the time it took to receive a response.\npublic func ping(addr: Multiaddr) -\u003e EventLoopFuture\u003cTimeAmount\u003e\npublic func ping(addr: Multiaddr) async throws -\u003e TimeAmount\n\n```\n\n## Contributing\n\nContributions are welcomed! This code is very much a proof of concept. I can guarantee you there's a better / safer way to accomplish the same results. Any suggestions, improvements, or even just critiques, are welcome! \n\nLet's make this code better together! 🤝\n\n## Credits\n\n- [Identify Spec](https://github.com/libp2p/specs/blob/master/identify/README.md)\n\n## License\n\n[MIT](LICENSE) © 2022 Breth Inc.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswift-libp2p%2Fswift-libp2p-identify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswift-libp2p%2Fswift-libp2p-identify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswift-libp2p%2Fswift-libp2p-identify/lists"}