{"id":14483681,"url":"https://github.com/libp2p/js-libp2p-kad-dht","last_synced_at":"2025-08-30T04:31:56.994Z","repository":{"id":15301645,"uuid":"77858307","full_name":"libp2p/js-libp2p-kad-dht","owner":"libp2p","description":"JavaScript implementation of the DHT for libp2p","archived":true,"fork":false,"pushed_at":"2023-07-21T15:40:59.000Z","size":3881,"stargazers_count":141,"open_issues_count":40,"forks_count":60,"subscribers_count":27,"default_branch":"master","last_synced_at":"2024-09-07T15:39:26.245Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://libp2p.io","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/libp2p.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":"2017-01-02T19:57:57.000Z","updated_at":"2024-07-30T22:01:08.000Z","dependencies_parsed_at":"2024-06-18T12:36:24.868Z","dependency_job_id":"3ebfe993-7174-4a3e-9094-bd152953fbfd","html_url":"https://github.com/libp2p/js-libp2p-kad-dht","commit_stats":null,"previous_names":[],"tags_count":181,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libp2p%2Fjs-libp2p-kad-dht","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libp2p%2Fjs-libp2p-kad-dht/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libp2p%2Fjs-libp2p-kad-dht/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libp2p%2Fjs-libp2p-kad-dht/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/libp2p","download_url":"https://codeload.github.com/libp2p/js-libp2p-kad-dht/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231443791,"owners_count":18377602,"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-09-03T00:01:59.307Z","updated_at":"2024-12-27T05:30:30.874Z","avatar_url":"https://github.com/libp2p.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# 📁 Archived - this module has been merged into [js-libp2p](https://github.com/libp2p/js-libp2p/tree/master/packages/kad-dht)\n\n# @libp2p/kad-dht \u003c!-- omit in toc --\u003e\n\n[![libp2p.io](https://img.shields.io/badge/project-libp2p-yellow.svg?style=flat-square)](http://libp2p.io/)\n[![Discuss](https://img.shields.io/discourse/https/discuss.libp2p.io/posts.svg?style=flat-square)](https://discuss.libp2p.io)\n[![codecov](https://img.shields.io/codecov/c/github/libp2p/js-libp2p-kad-dht.svg?style=flat-square)](https://codecov.io/gh/libp2p/js-libp2p-kad-dht)\n[![CI](https://img.shields.io/github/actions/workflow/status/libp2p/js-libp2p-kad-dht/js-test-and-release.yml?branch=master\\\u0026style=flat-square)](https://github.com/libp2p/js-libp2p-kad-dht/actions/workflows/js-test-and-release.yml?query=branch%3Amaster)\n\n\u003e JavaScript implementation of the Kad-DHT for libp2p\n\n## Table of contents \u003c!-- omit in toc --\u003e\n\n- [Install](#install)\n  - [Browser `\u003cscript\u003e` tag](#browser-script-tag)\n  - [Use in Node.js](#use-in-nodejs)\n- [API](#api)\n  - [Custom secondary DHT in libp2p](#custom-secondary-dht-in-libp2p)\n  - [Peer Routing](#peer-routing)\n  - [Content Routing](#content-routing)\n  - [Peer Discovery](#peer-discovery)\n- [Spec](#spec)\n- [API Docs](#api-docs)\n- [License](#license)\n- [Contribution](#contribution)\n\n## Install\n\n```console\n$ npm i @libp2p/kad-dht\n```\n\n### Browser `\u003cscript\u003e` tag\n\nLoading this module through a script tag will make it's exports available as `Libp2pKadDht` in the global namespace.\n\n```html\n\u003cscript src=\"https://unpkg.com/@libp2p/kad-dht/dist/index.min.js\"\u003e\u003c/script\u003e\n```\n\n```sh\n\u003e npm i @libp2p/kad-dht\n```\n\n### Use in Node.js\n\n```js\nimport { create } from '@libp2p/kad-dht'\n```\n\n## API\n\nSee \u003chttps://libp2p.github.io/js-libp2p-kad-dht\u003e for the auto generated docs.\n\nThe libp2p-kad-dht module offers 3 APIs: Peer Routing, Content Routing and Peer Discovery.\n\n### Custom secondary DHT in libp2p\n\n```js\nimport { createLibp2pNode } from 'libp2p'\nimport { kadDHT } from '@libp2p/kad-dht'\n\nconst node = await createLibp2pNode({\n  dht: kadDHT()\n  //... other config\n})\nawait node.start()\n\nfor await (const event of node.dht.findPeer(node.peerId)) {\n  console.info(event)\n}\n```\n\nNote that you may want to supply your own peer discovery function and datastore\n\n### Peer Routing\n\n[![](https://raw.githubusercontent.com/libp2p/interface-peer-routing/master/img/badge.png)](https://github.com/libp2p/js-libp2p-interfaces/tree/master/packages/libp2p-interfaces/src/peer-routing)\n\n### Content Routing\n\n[![](https://raw.githubusercontent.com/libp2p/interface-content-routing/master/img/badge.png)](https://github.com/libp2p/js-libp2p-interfaces/tree/master/packages/libp2p-interfaces/src/content-routing)\n\n### Peer Discovery\n\n[![](https://github.com/libp2p/interface-peer-discovery/blob/master/img/badge.png?raw=true)](https://github.com/libp2p/js-libp2p-interfaces/tree/master/packages/libp2p-interfaces/src/peer-discovery)\n\n## Spec\n\njs-libp2p-kad-dht follows the [libp2p/kad-dht spec](https://github.com/libp2p/specs/tree/master/kad-dht) and implements the algorithms described in the [IPFS DHT documentation](https://docs.ipfs.io/concepts/dht/).\n\n## API Docs\n\n- \u003chttps://libp2p.github.io/js-libp2p-kad-dht\u003e\n\n## License\n\nLicensed under either of\n\n- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / \u003chttp://www.apache.org/licenses/LICENSE-2.0\u003e)\n- MIT ([LICENSE-MIT](LICENSE-MIT) / \u003chttp://opensource.org/licenses/MIT\u003e)\n\n## Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibp2p%2Fjs-libp2p-kad-dht","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flibp2p%2Fjs-libp2p-kad-dht","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibp2p%2Fjs-libp2p-kad-dht/lists"}