@libp2p/identify 1.0.21 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -26,7 +26,16 @@ repo and examine the changes made.
26
26
 
27
27
  Use the `identify` function to add support for the [Identify protocol](https://github.com/libp2p/specs/blob/master/identify/README.md) to libp2p.
28
28
 
29
- ## Example
29
+ This protocol allows network peers to discover the multiaddrs the current node listens on, and the protocols it supports.
30
+
31
+ A second function, `identifyPush` is also exported to add support for [identify/push](https://github.com/libp2p/specs/blob/master/identify/README.md#identifypush).
32
+
33
+ This protocol will send updates to all connected peers when the multiaddrs or protocols of the current node change.
34
+
35
+ > \[!TIP]
36
+ > For maximum network compatibility you should configure both protocols
37
+
38
+ ## Example - Enabling identify
30
39
 
31
40
  ```typescript
32
41
  import { createLibp2p } from 'libp2p'
@@ -40,6 +49,20 @@ const node = await createLibp2p({
40
49
  })
41
50
  ```
42
51
 
52
+ ## Example - Enabling identify push
53
+
54
+ ```typescript
55
+ import { createLibp2p } from 'libp2p'
56
+ import { identifyPush } from '@libp2p/identify'
57
+
58
+ const node = await createLibp2p({
59
+ // ...other options
60
+ services: {
61
+ identifyPush: identifyPush()
62
+ }
63
+ })
64
+ ```
65
+
43
66
  # Install
44
67
 
45
68
  ```console