1
- # js- libp2p- kad-dht <!-- omit in toc -->
1
+ # @ libp2p/ kad-dht <!-- omit in toc -->
2
2
3
- [ ![ ] ( https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square )] ( http://ipn.io )
4
- [ ![ ] ( https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square )] ( http://ipfs.io/ )
5
- [ ![ ] ( https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square )] ( http://webchat.freenode.net/?channels=%23ipfs )
6
- [ ![ Discourse posts] ( https://img.shields.io/discourse/https/discuss.libp2p.io/posts.svg )] ( https://discuss.libp2p.io )
7
- [ ![ Build Status] ( https://github.com/libp2p/js-libp2p-kad-dht/actions/workflows/js-test-and-release.yml/badge.svg?branch=main )] ( https://github.com/libp2p/js-libp2p-kad-dht/actions/workflows/js-test-and-release.yml )
8
- [ ![ Coverage Status] ( https://coveralls.io/repos/github/libp2p/js-libp2p-kad-dht/badge.svg?branch=master )] ( https://coveralls.io/github/libp2p/js-libp2p-kad-dht?branch=master )
9
- [ ![ Dependency Status] ( https://david-dm.org/libp2p/js-libp2p-kad-dht.svg?style=flat-square )] ( https://david-dm.org/libp2p/js-libp2p-kad-dht )
10
- [ ![ Bundle Size] ( https://flat.badgen.net/bundlephobia/minzip/libp2p-kad-dht )] ( https://bundlephobia.com/result?p=libp2p-kad-dht )
11
- [ ![ js-standard-style] ( https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square )] ( https://github.com/feross/standard )
12
- [ ![ standard-readme compliant] ( https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square )] ( https://github.com/RichardLitt/standard-readme )
13
- ![ ] ( https://img.shields.io/badge/npm-%3E%3D3.0.0-orange.svg?style=flat-square )
14
- ![ ] ( https://img.shields.io/badge/Node.js-%3E%3D6.0.0-orange.svg?style=flat-square )
3
+ [ ![ libp2p.io] ( https://img.shields.io/badge/project-libp2p-yellow.svg?style=flat-square )] ( http://libp2p.io/ )
4
+ [ ![ IRC] ( https://img.shields.io/badge/freenode-%23libp2p-yellow.svg?style=flat-square )] ( http://webchat.freenode.net/?channels=%23libp2p )
5
+ [ ![ Discuss] ( https://img.shields.io/discourse/https/discuss.libp2p.io/posts.svg?style=flat-square )] ( https://discuss.libp2p.io )
6
+ [ ![ 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 )
7
+ [ ![ CI] ( https://img.shields.io/github/workflow/status/libp2p/js-libp2p-interfaces/test%20&%20maybe%20release/master?style=flat-square )] ( https://github.com/libp2p/js-libp2p-kad-dht/actions/workflows/js-test-and-release.yml )
15
8
16
- > JavaScript implementation of the Kademlia DHT for libp2p, based on [ go-libp2p-kad-dht ] ( https://github.com/libp2p/go-libp2p-kad-dht ) .
9
+ > JavaScript implementation of the Kad- DHT for libp2p
17
10
18
- ## Table of Contents <!-- omit in toc -->
11
+ ## Table of contents <!-- omit in toc -->
19
12
20
13
- [ Install] ( #install )
21
- - [ npm] ( #npm )
22
14
- [ Use in Node.js] ( #use-in-nodejs )
23
15
- [ API] ( #api )
24
16
- [ Custom secondary DHT in libp2p] ( #custom-secondary-dht-in-libp2p )
28
20
- [ Spec] ( #spec )
29
21
- [ Contribute] ( #contribute )
30
22
- [ License] ( #license )
31
- - [ Contribution] ( #contribution )
23
+ - [ Contribution] ( #contribution )
24
+
32
25
## Install
33
26
34
- ### npm
27
+ ``` console
28
+ $ npm i @libp2p/kad-dht
29
+ ```
35
30
36
31
``` sh
37
32
> npm i @libp2p/kad-dht
@@ -45,7 +40,7 @@ import { create } from '@libp2p/kad-dht'
45
40
46
41
## API
47
42
48
- See https://libp2p.github.io/js-libp2p-kad-dht for the auto generated docs.
43
+ See < https://libp2p.github.io/js-libp2p-kad-dht > for the auto generated docs.
49
44
50
45
The libp2p-kad-dht module offers 3 APIs: Peer Routing, Content Routing and Peer Discovery.
51
46
@@ -69,6 +64,7 @@ async function addDHT(libp2p) {
69
64
```
70
65
71
66
Note that you may want to supply your own peer discovery function and datastore
67
+
72
68
### Peer Routing
73
69
74
70
[ ![ ] ( 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 )
@@ -97,9 +93,9 @@ This repository falls under the IPFS [Code of Conduct](https://github.com/ipfs/c
97
93
98
94
Licensed under either of
99
95
100
- * Apache 2.0, ([ LICENSE-APACHE] ( LICENSE-APACHE ) / http://www.apache.org/licenses/LICENSE-2.0 )
101
- * MIT ([ LICENSE-MIT] ( LICENSE-MIT ) / http://opensource.org/licenses/MIT )
96
+ - Apache 2.0, ([ LICENSE-APACHE] ( LICENSE-APACHE ) / < http://www.apache.org/licenses/LICENSE-2.0 > )
97
+ - MIT ([ LICENSE-MIT] ( LICENSE-MIT ) / < http://opensource.org/licenses/MIT > )
102
98
103
- ### Contribution
99
+ ## Contribution
104
100
105
101
Unless 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.
0 commit comments