libp2p 0.44.0 → 0.45.0-08d4c261

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.
Files changed (238) hide show
  1. package/dist/index.min.js +32 -32
  2. package/dist/src/address-manager/index.d.ts +9 -5
  3. package/dist/src/address-manager/index.d.ts.map +1 -1
  4. package/dist/src/address-manager/index.js +44 -7
  5. package/dist/src/address-manager/index.js.map +1 -1
  6. package/dist/src/address-manager/utils.d.ts +2 -0
  7. package/dist/src/address-manager/utils.d.ts.map +1 -0
  8. package/dist/src/address-manager/utils.js +12 -0
  9. package/dist/src/address-manager/utils.js.map +1 -0
  10. package/dist/src/autonat/constants.d.ts +16 -2
  11. package/dist/src/autonat/constants.d.ts.map +1 -1
  12. package/dist/src/autonat/constants.js +16 -2
  13. package/dist/src/autonat/constants.js.map +1 -1
  14. package/dist/src/autonat/index.d.ts +12 -33
  15. package/dist/src/autonat/index.d.ts.map +1 -1
  16. package/dist/src/autonat/index.js +48 -33
  17. package/dist/src/autonat/index.js.map +1 -1
  18. package/dist/src/circuit-relay/index.d.ts +1 -1
  19. package/dist/src/circuit-relay/index.d.ts.map +1 -1
  20. package/dist/src/circuit-relay/server/advert-service.d.ts +2 -2
  21. package/dist/src/circuit-relay/server/advert-service.d.ts.map +1 -1
  22. package/dist/src/circuit-relay/server/advert-service.js +8 -4
  23. package/dist/src/circuit-relay/server/advert-service.js.map +1 -1
  24. package/dist/src/circuit-relay/server/index.d.ts +8 -8
  25. package/dist/src/circuit-relay/server/index.d.ts.map +1 -1
  26. package/dist/src/circuit-relay/server/index.js +32 -12
  27. package/dist/src/circuit-relay/server/index.js.map +1 -1
  28. package/dist/src/circuit-relay/server/reservation-store.d.ts +5 -5
  29. package/dist/src/circuit-relay/server/reservation-store.d.ts.map +1 -1
  30. package/dist/src/circuit-relay/server/reservation-store.js +10 -3
  31. package/dist/src/circuit-relay/server/reservation-store.js.map +1 -1
  32. package/dist/src/circuit-relay/server/reservation-voucher.d.ts.map +1 -1
  33. package/dist/src/circuit-relay/server/reservation-voucher.js +5 -2
  34. package/dist/src/circuit-relay/server/reservation-voucher.js.map +1 -1
  35. package/dist/src/circuit-relay/transport/discovery.d.ts +4 -4
  36. package/dist/src/circuit-relay/transport/discovery.d.ts.map +1 -1
  37. package/dist/src/circuit-relay/transport/discovery.js +13 -5
  38. package/dist/src/circuit-relay/transport/discovery.js.map +1 -1
  39. package/dist/src/circuit-relay/transport/index.d.ts +10 -8
  40. package/dist/src/circuit-relay/transport/index.d.ts.map +1 -1
  41. package/dist/src/circuit-relay/transport/index.js +26 -18
  42. package/dist/src/circuit-relay/transport/index.js.map +1 -1
  43. package/dist/src/circuit-relay/transport/listener.d.ts +1 -1
  44. package/dist/src/circuit-relay/transport/listener.d.ts.map +1 -1
  45. package/dist/src/circuit-relay/transport/listener.js +43 -43
  46. package/dist/src/circuit-relay/transport/listener.js.map +1 -1
  47. package/dist/src/circuit-relay/transport/reservation-store.d.ts +8 -7
  48. package/dist/src/circuit-relay/transport/reservation-store.d.ts.map +1 -1
  49. package/dist/src/circuit-relay/transport/reservation-store.js +65 -52
  50. package/dist/src/circuit-relay/transport/reservation-store.js.map +1 -1
  51. package/dist/src/circuit-relay/utils.d.ts.map +1 -1
  52. package/dist/src/circuit-relay/utils.js +3 -3
  53. package/dist/src/circuit-relay/utils.js.map +1 -1
  54. package/dist/src/components.d.ts +10 -67
  55. package/dist/src/components.d.ts.map +1 -1
  56. package/dist/src/components.js +61 -165
  57. package/dist/src/components.js.map +1 -1
  58. package/dist/src/config/connection-gater.browser.d.ts +8 -0
  59. package/dist/src/config/connection-gater.browser.d.ts.map +1 -0
  60. package/dist/src/config/connection-gater.browser.js +27 -0
  61. package/dist/src/config/connection-gater.browser.js.map +1 -0
  62. package/dist/src/config/connection-gater.d.ts +6 -0
  63. package/dist/src/config/connection-gater.d.ts.map +1 -0
  64. package/dist/src/config/connection-gater.js +18 -0
  65. package/dist/src/config/connection-gater.js.map +1 -0
  66. package/dist/src/config.d.ts +2 -1
  67. package/dist/src/config.d.ts.map +1 -1
  68. package/dist/src/config.js +4 -66
  69. package/dist/src/config.js.map +1 -1
  70. package/dist/src/connection/index.d.ts +3 -3
  71. package/dist/src/connection/index.d.ts.map +1 -1
  72. package/dist/src/connection/index.js +38 -8
  73. package/dist/src/connection/index.js.map +1 -1
  74. package/dist/src/connection-manager/auto-dial.d.ts +4 -1
  75. package/dist/src/connection-manager/auto-dial.d.ts.map +1 -1
  76. package/dist/src/connection-manager/auto-dial.js +44 -13
  77. package/dist/src/connection-manager/auto-dial.js.map +1 -1
  78. package/dist/src/connection-manager/connection-pruner.d.ts +4 -0
  79. package/dist/src/connection-manager/connection-pruner.d.ts.map +1 -1
  80. package/dist/src/connection-manager/connection-pruner.js +28 -8
  81. package/dist/src/connection-manager/connection-pruner.js.map +1 -1
  82. package/dist/src/connection-manager/dial-queue.d.ts +7 -6
  83. package/dist/src/connection-manager/dial-queue.d.ts.map +1 -1
  84. package/dist/src/connection-manager/dial-queue.js +59 -23
  85. package/dist/src/connection-manager/dial-queue.js.map +1 -1
  86. package/dist/src/connection-manager/index.d.ts +16 -15
  87. package/dist/src/connection-manager/index.d.ts.map +1 -1
  88. package/dist/src/connection-manager/index.js +44 -41
  89. package/dist/src/connection-manager/index.js.map +1 -1
  90. package/dist/src/connection-manager/utils.d.ts +2 -3
  91. package/dist/src/connection-manager/utils.d.ts.map +1 -1
  92. package/dist/src/connection-manager/utils.js +3 -3
  93. package/dist/src/connection-manager/utils.js.map +1 -1
  94. package/dist/src/content-routing/index.d.ts +2 -12
  95. package/dist/src/content-routing/index.d.ts.map +1 -1
  96. package/dist/src/content-routing/index.js +12 -44
  97. package/dist/src/content-routing/index.js.map +1 -1
  98. package/dist/src/content-routing/utils.d.ts +1 -1
  99. package/dist/src/content-routing/utils.d.ts.map +1 -1
  100. package/dist/src/content-routing/utils.js +3 -1
  101. package/dist/src/content-routing/utils.js.map +1 -1
  102. package/dist/src/fetch/index.d.ts +15 -37
  103. package/dist/src/fetch/index.d.ts.map +1 -1
  104. package/dist/src/fetch/index.js +19 -16
  105. package/dist/src/fetch/index.js.map +1 -1
  106. package/dist/src/get-peer.d.ts +1 -1
  107. package/dist/src/get-peer.d.ts.map +1 -1
  108. package/dist/src/get-peer.js +3 -3
  109. package/dist/src/get-peer.js.map +1 -1
  110. package/dist/src/identify/identify.d.ts +53 -0
  111. package/dist/src/identify/identify.d.ts.map +1 -0
  112. package/dist/src/identify/identify.js +417 -0
  113. package/dist/src/identify/identify.js.map +1 -0
  114. package/dist/src/identify/index.d.ts +14 -59
  115. package/dist/src/identify/index.d.ts.map +1 -1
  116. package/dist/src/identify/index.js +5 -388
  117. package/dist/src/identify/index.js.map +1 -1
  118. package/dist/src/index.d.ts +28 -79
  119. package/dist/src/index.d.ts.map +1 -1
  120. package/dist/src/index.js +2 -1
  121. package/dist/src/index.js.map +1 -1
  122. package/dist/src/insecure/index.js +6 -8
  123. package/dist/src/insecure/index.js.map +1 -1
  124. package/dist/src/libp2p.d.ts +16 -47
  125. package/dist/src/libp2p.d.ts.map +1 -1
  126. package/dist/src/libp2p.js +141 -201
  127. package/dist/src/libp2p.js.map +1 -1
  128. package/dist/src/peer-routing.d.ts +3 -40
  129. package/dist/src/peer-routing.d.ts.map +1 -1
  130. package/dist/src/peer-routing.js +8 -65
  131. package/dist/src/peer-routing.js.map +1 -1
  132. package/dist/src/ping/constants.d.ts +4 -0
  133. package/dist/src/ping/constants.d.ts.map +1 -1
  134. package/dist/src/ping/constants.js +10 -0
  135. package/dist/src/ping/constants.js.map +1 -1
  136. package/dist/src/ping/index.d.ts +11 -28
  137. package/dist/src/ping/index.d.ts.map +1 -1
  138. package/dist/src/ping/index.js +31 -28
  139. package/dist/src/ping/index.js.map +1 -1
  140. package/dist/src/pnet/crypto.js +3 -3
  141. package/dist/src/pnet/crypto.js.map +1 -1
  142. package/dist/src/pnet/index.d.ts.map +1 -1
  143. package/dist/src/pnet/index.js +9 -6
  144. package/dist/src/pnet/index.js.map +1 -1
  145. package/dist/src/pnet/key-generator.js +1 -1
  146. package/dist/src/pnet/key-generator.js.map +1 -1
  147. package/dist/src/pubsub/dummy-pubsub.d.ts.map +1 -1
  148. package/dist/src/pubsub/dummy-pubsub.js +2 -5
  149. package/dist/src/pubsub/dummy-pubsub.js.map +1 -1
  150. package/dist/src/registrar.d.ts +6 -4
  151. package/dist/src/registrar.d.ts.map +1 -1
  152. package/dist/src/registrar.js +33 -28
  153. package/dist/src/registrar.js.map +1 -1
  154. package/dist/src/transport-manager.d.ts +14 -7
  155. package/dist/src/transport-manager.d.ts.map +1 -1
  156. package/dist/src/transport-manager.js +27 -13
  157. package/dist/src/transport-manager.js.map +1 -1
  158. package/dist/src/upgrader.d.ts +20 -15
  159. package/dist/src/upgrader.d.ts.map +1 -1
  160. package/dist/src/upgrader.js +49 -53
  161. package/dist/src/upgrader.js.map +1 -1
  162. package/dist/src/{nat-manager.d.ts → upnp-nat/index.d.ts} +12 -15
  163. package/dist/src/upnp-nat/index.d.ts.map +1 -0
  164. package/dist/src/{nat-manager.js → upnp-nat/index.js} +23 -10
  165. package/dist/src/upnp-nat/index.js.map +1 -0
  166. package/dist/src/version.d.ts +1 -1
  167. package/dist/src/version.d.ts.map +1 -1
  168. package/dist/src/version.js +1 -1
  169. package/dist/src/version.js.map +1 -1
  170. package/package.json +62 -47
  171. package/src/address-manager/index.ts +52 -10
  172. package/src/address-manager/utils.ts +14 -0
  173. package/src/autonat/constants.ts +17 -2
  174. package/src/autonat/index.ts +65 -57
  175. package/src/circuit-relay/index.ts +1 -1
  176. package/src/circuit-relay/server/advert-service.ts +5 -5
  177. package/src/circuit-relay/server/index.ts +28 -20
  178. package/src/circuit-relay/server/reservation-store.ts +5 -5
  179. package/src/circuit-relay/server/reservation-voucher.ts +1 -1
  180. package/src/circuit-relay/transport/discovery.ts +12 -10
  181. package/src/circuit-relay/transport/index.ts +26 -26
  182. package/src/circuit-relay/transport/listener.ts +43 -33
  183. package/src/circuit-relay/transport/reservation-store.ts +42 -28
  184. package/src/circuit-relay/utils.ts +6 -6
  185. package/src/components.ts +75 -238
  186. package/src/config/connection-gater.browser.ts +31 -0
  187. package/src/config/connection-gater.ts +19 -0
  188. package/src/config.ts +9 -70
  189. package/src/connection/index.ts +6 -10
  190. package/src/connection-manager/auto-dial.ts +46 -17
  191. package/src/connection-manager/connection-pruner.ts +30 -10
  192. package/src/connection-manager/dial-queue.ts +56 -35
  193. package/src/connection-manager/index.ts +45 -57
  194. package/src/connection-manager/utils.ts +4 -5
  195. package/src/content-routing/index.ts +11 -59
  196. package/src/content-routing/utils.ts +4 -2
  197. package/src/fetch/index.ts +63 -26
  198. package/src/get-peer.ts +4 -4
  199. package/src/identify/identify.ts +519 -0
  200. package/src/identify/index.ts +19 -509
  201. package/src/index.ts +25 -88
  202. package/src/insecure/index.ts +10 -10
  203. package/src/libp2p.ts +158 -279
  204. package/src/peer-routing.ts +10 -110
  205. package/src/ping/constants.ts +11 -0
  206. package/src/ping/index.ts +43 -39
  207. package/src/pnet/crypto.ts +3 -3
  208. package/src/pnet/index.ts +6 -6
  209. package/src/pnet/key-generator.ts +1 -1
  210. package/src/pubsub/dummy-pubsub.ts +2 -2
  211. package/src/registrar.ts +34 -31
  212. package/src/transport-manager.ts +33 -19
  213. package/src/upgrader.ts +75 -71
  214. package/src/{nat-manager.ts → upnp-nat/index.ts} +23 -24
  215. package/src/version.ts +1 -1
  216. package/dist/src/dht/dht-content-routing.d.ts +0 -17
  217. package/dist/src/dht/dht-content-routing.d.ts.map +0 -1
  218. package/dist/src/dht/dht-content-routing.js +0 -32
  219. package/dist/src/dht/dht-content-routing.js.map +0 -1
  220. package/dist/src/dht/dht-peer-routing.d.ts +0 -15
  221. package/dist/src/dht/dht-peer-routing.d.ts.map +0 -1
  222. package/dist/src/dht/dht-peer-routing.js +0 -26
  223. package/dist/src/dht/dht-peer-routing.js.map +0 -1
  224. package/dist/src/dht/dummy-dht.d.ts +0 -20
  225. package/dist/src/dht/dummy-dht.d.ts.map +0 -1
  226. package/dist/src/dht/dummy-dht.js +0 -46
  227. package/dist/src/dht/dummy-dht.js.map +0 -1
  228. package/dist/src/nat-manager.d.ts.map +0 -1
  229. package/dist/src/nat-manager.js.map +0 -1
  230. package/dist/src/peer-record-updater.d.ts +0 -24
  231. package/dist/src/peer-record-updater.d.ts.map +0 -1
  232. package/dist/src/peer-record-updater.js +0 -44
  233. package/dist/src/peer-record-updater.js.map +0 -1
  234. package/dist/typedoc-urls.json +0 -41
  235. package/src/dht/dht-content-routing.ts +0 -44
  236. package/src/dht/dht-peer-routing.ts +0 -36
  237. package/src/dht/dummy-dht.ts +0 -60
  238. package/src/peer-record-updater.ts +0 -65
@@ -1,37 +1,33 @@
1
- import { Multiaddr } from '@multiformats/multiaddr';
1
+ import { DefaultIdentifyService } from './identify.js';
2
2
  import { Identify } from './pb/message.js';
3
- import type { IncomingStreamData, Registrar } from '@libp2p/interface-registrar';
4
- import type { Connection } from '@libp2p/interface-connection';
5
- import type { Startable } from '@libp2p/interfaces/startable';
6
- import type { AbortOptions } from '@libp2p/interfaces';
3
+ import type { AddressManager } from '@libp2p/interface-address-manager';
7
4
  import type { ConnectionManager } from '@libp2p/interface-connection-manager';
5
+ import type { Libp2pEvents } from '@libp2p/interface-libp2p';
8
6
  import type { PeerId } from '@libp2p/interface-peer-id';
9
7
  import type { PeerStore } from '@libp2p/interface-peer-store';
10
- import type { AddressManager } from '@libp2p/interface-address-manager';
11
- export interface HostProperties {
12
- agentVersion: string;
13
- }
8
+ import type { Registrar } from '@libp2p/interface-registrar';
9
+ import type { EventEmitter } from '@libp2p/interfaces/events';
14
10
  export interface IdentifyServiceInit {
15
11
  /**
16
12
  * The prefix to use for the protocol (default: 'ipfs')
17
13
  */
18
- protocolPrefix: string;
14
+ protocolPrefix?: string;
19
15
  /**
20
16
  * What details we should send as part of an identify message
21
17
  */
22
- host: HostProperties;
18
+ agentVersion?: string;
23
19
  /**
24
20
  * How long we should wait for a remote peer to send their identify response
25
21
  */
26
- timeout: number;
22
+ timeout?: number;
27
23
  /**
28
24
  * Identify responses larger than this in bytes will be rejected (default: 8192)
29
25
  */
30
26
  maxIdentifyMessageSize?: number;
31
- maxInboundStreams: number;
32
- maxOutboundStreams: number;
33
- maxPushIncomingStreams: number;
34
- maxPushOutgoingStreams: number;
27
+ maxInboundStreams?: number;
28
+ maxOutboundStreams?: number;
29
+ maxPushIncomingStreams?: number;
30
+ maxPushOutgoingStreams?: number;
35
31
  maxObservedAddresses?: number;
36
32
  }
37
33
  export interface IdentifyServiceComponents {
@@ -40,49 +36,7 @@ export interface IdentifyServiceComponents {
40
36
  connectionManager: ConnectionManager;
41
37
  registrar: Registrar;
42
38
  addressManager: AddressManager;
43
- }
44
- export declare class IdentifyService implements Startable {
45
- private readonly components;
46
- private readonly identifyProtocolStr;
47
- private readonly identifyPushProtocolStr;
48
- readonly host: {
49
- protocolVersion: string;
50
- agentVersion: string;
51
- };
52
- private readonly init;
53
- private started;
54
- constructor(components: IdentifyServiceComponents, init: IdentifyServiceInit);
55
- isStarted(): boolean;
56
- start(): Promise<void>;
57
- stop(): Promise<void>;
58
- /**
59
- * Send an Identify Push update to the list of connections
60
- */
61
- push(connections: Connection[]): Promise<void>;
62
- /**
63
- * Calls `push` on all peer connections
64
- */
65
- pushToPeerStore(): Promise<void>;
66
- _identify(connection: Connection, options?: AbortOptions): Promise<Identify>;
67
- /**
68
- * Requests the `Identify` message from peer associated with the given `connection`.
69
- * If the identified peer does not match the `PeerId` associated with the connection,
70
- * an error will be thrown.
71
- */
72
- identify(connection: Connection, options?: AbortOptions): Promise<void>;
73
- /**
74
- * Sends the `Identify` response with the Signed Peer Record
75
- * to the requesting peer over the given `connection`
76
- */
77
- _handleIdentify(data: IncomingStreamData): Promise<void>;
78
- /**
79
- * Reads the Identify Push message from the given `connection`
80
- */
81
- _handlePush(data: IncomingStreamData): Promise<void>;
82
- /**
83
- * Takes the `addr` and converts it to a Multiaddr if possible
84
- */
85
- static getCleanMultiaddr(addr: Uint8Array | string | null | undefined): Multiaddr | undefined;
39
+ events: EventEmitter<Libp2pEvents>;
86
40
  }
87
41
  /**
88
42
  * The protocols the IdentifyService supports
@@ -94,4 +48,5 @@ export declare const multicodecs: {
94
48
  export declare const Message: {
95
49
  Identify: typeof Identify;
96
50
  };
51
+ export declare function identifyService(init?: IdentifyServiceInit): (components: IdentifyServiceComponents) => DefaultIdentifyService;
97
52
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/identify/index.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,SAAS,EAAwB,MAAM,yBAAyB,CAAA;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAY1C,OAAO,KAAK,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAA;AAChF,OAAO,KAAK,EAAE,UAAU,EAAU,MAAM,8BAA8B,CAAA;AACtE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAG7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAGtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAA;AAC7E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAA;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAA;AAOvE,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,cAAc,EAAE,MAAM,CAAA;IAEtB;;OAEG;IACH,IAAI,EAAE,cAAc,CAAA;IAEpB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IAEf;;OAEG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAE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kB,CAAC,EAAE,MAAM,CAAA;IAE3B,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAC/B,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAC/B,oBAAoB,CAAC,EAAE,MAAM,CAAA;CAC9B;AAED,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,SAAS,CAAA;IACpB,iBAAiB,EAAE,iBAAiB,CAAA;IACpC,SAAS,EAAE,SAAS,CAAA;IACpB,cAAc,EAAE,cAAc,CAAA;IAC9B,MAAM,EAAE,YAAY,CAAC,YAAY,CAAC,CAAA;CACnC;AAED;;GAEG;AACH,eAAO,MAAM,WAAW;;;CAGvB,CAAA;AAED,eAAO,MAAM,OAAO;;CAAe,CAAA;AAEnC,wBAAgB,eAAe,CAAE,IAAI,GAAE,mBAAwB,GAAG,CAAC,UAAU,EAAE,yBAAyB,KAAK,sBAAsB,CAElI"}
@@ -1,392 +1,6 @@
1
- import { logger } from '@libp2p/logger';
2
- import { CodeError } from '@libp2p/interfaces/errors';
3
- import * as lp from 'it-length-prefixed';
4
- import { pipe } from 'it-pipe';
5
- import first from 'it-first';
6
- import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string';
7
- import { multiaddr, protocols } from '@multiformats/multiaddr';
1
+ import { MULTICODEC_IDENTIFY, MULTICODEC_IDENTIFY_PUSH } from './consts.js';
2
+ import { DefaultIdentifyService } from './identify.js';
8
3
  import { Identify } from './pb/message.js';
9
- import { RecordEnvelope, PeerRecord } from '@libp2p/peer-record';
10
- import { MULTICODEC_IDENTIFY, MULTICODEC_IDENTIFY_PUSH, IDENTIFY_PROTOCOL_VERSION, MULTICODEC_IDENTIFY_PROTOCOL_NAME, MULTICODEC_IDENTIFY_PUSH_PROTOCOL_NAME, MULTICODEC_IDENTIFY_PROTOCOL_VERSION, MULTICODEC_IDENTIFY_PUSH_PROTOCOL_VERSION } from './consts.js';
11
- import { codes } from '../errors.js';
12
- import { peerIdFromKeys } from '@libp2p/peer-id';
13
- import { TimeoutController } from 'timeout-abort-controller';
14
- import { abortableDuplex } from 'abortable-iterator';
15
- import { setMaxListeners } from 'events';
16
- const log = logger('libp2p:identify');
17
- // https://github.com/libp2p/go-libp2p/blob/8d2e54e1637041d5cf4fac1e531287560bd1f4ac/p2p/protocol/identify/id.go#L52
18
- const MAX_IDENTIFY_MESSAGE_SIZE = 1024 * 8;
19
- export class IdentifyService {
20
- constructor(components, init) {
21
- this.components = components;
22
- this.started = false;
23
- this.init = init;
24
- this.identifyProtocolStr = `/${init.protocolPrefix}/${MULTICODEC_IDENTIFY_PROTOCOL_NAME}/${MULTICODEC_IDENTIFY_PROTOCOL_VERSION}`;
25
- this.identifyPushProtocolStr = `/${init.protocolPrefix}/${MULTICODEC_IDENTIFY_PUSH_PROTOCOL_NAME}/${MULTICODEC_IDENTIFY_PUSH_PROTOCOL_VERSION}`;
26
- // Store self host metadata
27
- this.host = {
28
- protocolVersion: `${init.protocolPrefix}/${IDENTIFY_PROTOCOL_VERSION}`,
29
- ...init.host
30
- };
31
- // When a new connection happens, trigger identify
32
- this.components.connectionManager.addEventListener('peer:connect', (evt) => {
33
- const connection = evt.detail;
34
- this.identify(connection).catch(log.error);
35
- });
36
- // When self multiaddrs change, trigger identify-push
37
- this.components.peerStore.addEventListener('change:multiaddrs', (evt) => {
38
- const { peerId } = evt.detail;
39
- if (this.components.peerId.equals(peerId)) {
40
- void this.pushToPeerStore().catch(err => { log.error(err); });
41
- }
42
- });
43
- // When self protocols change, trigger identify-push
44
- this.components.peerStore.addEventListener('change:protocols', (evt) => {
45
- const { peerId } = evt.detail;
46
- if (this.components.peerId.equals(peerId)) {
47
- void this.pushToPeerStore().catch(err => { log.error(err); });
48
- }
49
- });
50
- }
51
- isStarted() {
52
- return this.started;
53
- }
54
- async start() {
55
- if (this.started) {
56
- return;
57
- }
58
- await this.components.peerStore.metadataBook.setValue(this.components.peerId, 'AgentVersion', uint8ArrayFromString(this.host.agentVersion));
59
- await this.components.peerStore.metadataBook.setValue(this.components.peerId, 'ProtocolVersion', uint8ArrayFromString(this.host.protocolVersion));
60
- await this.components.registrar.handle(this.identifyProtocolStr, (data) => {
61
- void this._handleIdentify(data).catch(err => {
62
- log.error(err);
63
- });
64
- }, {
65
- maxInboundStreams: this.init.maxInboundStreams,
66
- maxOutboundStreams: this.init.maxOutboundStreams
67
- });
68
- await this.components.registrar.handle(this.identifyPushProtocolStr, (data) => {
69
- void this._handlePush(data).catch(err => {
70
- log.error(err);
71
- });
72
- }, {
73
- maxInboundStreams: this.init.maxPushIncomingStreams,
74
- maxOutboundStreams: this.init.maxPushOutgoingStreams
75
- });
76
- this.started = true;
77
- }
78
- async stop() {
79
- await this.components.registrar.unhandle(this.identifyProtocolStr);
80
- await this.components.registrar.unhandle(this.identifyPushProtocolStr);
81
- this.started = false;
82
- }
83
- /**
84
- * Send an Identify Push update to the list of connections
85
- */
86
- async push(connections) {
87
- const signedPeerRecord = await this.components.peerStore.addressBook.getRawEnvelope(this.components.peerId);
88
- const listenAddrs = this.components.addressManager.getAddresses().map((ma) => ma.bytes);
89
- const protocols = await this.components.peerStore.protoBook.get(this.components.peerId);
90
- const pushes = connections.map(async (connection) => {
91
- let stream;
92
- const timeoutController = new TimeoutController(this.init.timeout);
93
- try {
94
- // fails on node < 15.4
95
- setMaxListeners?.(Infinity, timeoutController.signal);
96
- }
97
- catch { }
98
- try {
99
- stream = await connection.newStream([this.identifyPushProtocolStr], {
100
- signal: timeoutController.signal
101
- });
102
- // make stream abortable
103
- const source = abortableDuplex(stream, timeoutController.signal);
104
- await source.sink(pipe([Identify.encode({
105
- listenAddrs,
106
- signedPeerRecord,
107
- protocols
108
- })], (source) => lp.encode(source)));
109
- }
110
- catch (err) {
111
- // Just log errors
112
- log.error('could not push identify update to peer', err);
113
- }
114
- finally {
115
- if (stream != null) {
116
- stream.close();
117
- }
118
- timeoutController.clear();
119
- }
120
- });
121
- await Promise.all(pushes);
122
- }
123
- /**
124
- * Calls `push` on all peer connections
125
- */
126
- async pushToPeerStore() {
127
- // Do not try to push if we are not running
128
- if (!this.isStarted()) {
129
- return;
130
- }
131
- const connections = [];
132
- for (const conn of this.components.connectionManager.getConnections()) {
133
- const peerId = conn.remotePeer;
134
- const peer = await this.components.peerStore.get(peerId);
135
- if (!peer.protocols.includes(this.identifyPushProtocolStr)) {
136
- continue;
137
- }
138
- connections.push(conn);
139
- }
140
- await this.push(connections);
141
- }
142
- async _identify(connection, options = {}) {
143
- let timeoutController;
144
- let signal = options.signal;
145
- let stream;
146
- // create a timeout if no abort signal passed
147
- if (signal == null) {
148
- timeoutController = new TimeoutController(this.init.timeout);
149
- signal = timeoutController.signal;
150
- try {
151
- // fails on node < 15.4
152
- setMaxListeners?.(Infinity, timeoutController.signal);
153
- }
154
- catch { }
155
- }
156
- try {
157
- stream = await connection.newStream([this.identifyProtocolStr], {
158
- signal
159
- });
160
- // make stream abortable
161
- const source = abortableDuplex(stream, signal);
162
- const data = await pipe([], source, (source) => lp.decode(source, {
163
- maxDataLength: this.init.maxIdentifyMessageSize ?? MAX_IDENTIFY_MESSAGE_SIZE
164
- }), async (source) => await first(source));
165
- if (data == null) {
166
- throw new CodeError('No data could be retrieved', codes.ERR_CONNECTION_ENDED);
167
- }
168
- try {
169
- return Identify.decode(data);
170
- }
171
- catch (err) {
172
- throw new CodeError(String(err), codes.ERR_INVALID_MESSAGE);
173
- }
174
- }
175
- finally {
176
- if (timeoutController != null) {
177
- timeoutController.clear();
178
- }
179
- if (stream != null) {
180
- stream.close();
181
- }
182
- }
183
- }
184
- /**
185
- * Requests the `Identify` message from peer associated with the given `connection`.
186
- * If the identified peer does not match the `PeerId` associated with the connection,
187
- * an error will be thrown.
188
- */
189
- async identify(connection, options = {}) {
190
- const message = await this._identify(connection, options);
191
- const { publicKey, listenAddrs, protocols, observedAddr, signedPeerRecord, agentVersion, protocolVersion } = message;
192
- if (publicKey == null) {
193
- throw new CodeError('public key was missing from identify message', codes.ERR_MISSING_PUBLIC_KEY);
194
- }
195
- const id = await peerIdFromKeys(publicKey);
196
- if (!connection.remotePeer.equals(id)) {
197
- throw new CodeError('identified peer does not match the expected peer', codes.ERR_INVALID_PEER);
198
- }
199
- if (this.components.peerId.equals(id)) {
200
- throw new CodeError('identified peer is our own peer id?', codes.ERR_INVALID_PEER);
201
- }
202
- // Get the observedAddr if there is one
203
- const cleanObservedAddr = IdentifyService.getCleanMultiaddr(observedAddr);
204
- if (signedPeerRecord != null) {
205
- log('received signed peer record from %p', id);
206
- try {
207
- const envelope = await RecordEnvelope.openAndCertify(signedPeerRecord, PeerRecord.DOMAIN);
208
- if (!envelope.peerId.equals(id)) {
209
- throw new CodeError('identified peer does not match the expected peer', codes.ERR_INVALID_PEER);
210
- }
211
- if (await this.components.peerStore.addressBook.consumePeerRecord(envelope)) {
212
- await this.components.peerStore.protoBook.set(id, protocols);
213
- if (agentVersion != null) {
214
- await this.components.peerStore.metadataBook.setValue(id, 'AgentVersion', uint8ArrayFromString(agentVersion));
215
- }
216
- if (protocolVersion != null) {
217
- await this.components.peerStore.metadataBook.setValue(id, 'ProtocolVersion', uint8ArrayFromString(protocolVersion));
218
- }
219
- log('identify completed for peer %p with protocols %o', id, protocols);
220
- return;
221
- }
222
- }
223
- catch (err) {
224
- log('received invalid envelope, discard it and fallback to listenAddrs is available', err);
225
- }
226
- }
227
- else {
228
- log('no signed peer record received from %p', id);
229
- }
230
- log('falling back to legacy addresses from %p', id);
231
- // LEGACY: Update peers data in PeerStore
232
- try {
233
- await this.components.peerStore.addressBook.set(id, listenAddrs.map((addr) => multiaddr(addr)));
234
- }
235
- catch (err) {
236
- log.error('received invalid addrs', err);
237
- }
238
- await this.components.peerStore.protoBook.set(id, protocols);
239
- if (agentVersion != null) {
240
- await this.components.peerStore.metadataBook.setValue(id, 'AgentVersion', uint8ArrayFromString(agentVersion));
241
- }
242
- if (protocolVersion != null) {
243
- await this.components.peerStore.metadataBook.setValue(id, 'ProtocolVersion', uint8ArrayFromString(protocolVersion));
244
- }
245
- log('identify completed for peer %p and protocols %o', id, protocols);
246
- log('our observed address is %s', cleanObservedAddr);
247
- if (cleanObservedAddr != null &&
248
- this.components.addressManager.getObservedAddrs().length < (this.init.maxObservedAddresses ?? Infinity)) {
249
- log('storing our observed address %s', cleanObservedAddr?.toString());
250
- this.components.addressManager.addObservedAddr(cleanObservedAddr);
251
- }
252
- }
253
- /**
254
- * Sends the `Identify` response with the Signed Peer Record
255
- * to the requesting peer over the given `connection`
256
- */
257
- async _handleIdentify(data) {
258
- const { connection, stream } = data;
259
- const timeoutController = new TimeoutController(this.init.timeout);
260
- try {
261
- // fails on node < 15.4
262
- setMaxListeners?.(Infinity, timeoutController.signal);
263
- }
264
- catch { }
265
- try {
266
- const publicKey = this.components.peerId.publicKey ?? new Uint8Array(0);
267
- const peerData = await this.components.peerStore.get(this.components.peerId);
268
- const multiaddrs = this.components.addressManager.getAddresses().map(ma => ma.decapsulateCode(protocols('p2p').code));
269
- let signedPeerRecord = peerData.peerRecordEnvelope;
270
- if (multiaddrs.length > 0 && signedPeerRecord == null) {
271
- const peerRecord = new PeerRecord({
272
- peerId: this.components.peerId,
273
- multiaddrs
274
- });
275
- const envelope = await RecordEnvelope.seal(peerRecord, this.components.peerId);
276
- await this.components.peerStore.addressBook.consumePeerRecord(envelope);
277
- signedPeerRecord = envelope.marshal().subarray();
278
- }
279
- const message = Identify.encode({
280
- protocolVersion: this.host.protocolVersion,
281
- agentVersion: this.host.agentVersion,
282
- publicKey,
283
- listenAddrs: multiaddrs.map(addr => addr.bytes),
284
- signedPeerRecord,
285
- observedAddr: connection.remoteAddr.bytes,
286
- protocols: peerData.protocols
287
- });
288
- // make stream abortable
289
- const source = abortableDuplex(stream, timeoutController.signal);
290
- const msgWithLenPrefix = pipe([message], (source) => lp.encode(source));
291
- await source.sink(msgWithLenPrefix);
292
- }
293
- catch (err) {
294
- log.error('could not respond to identify request', err);
295
- }
296
- finally {
297
- stream.close();
298
- timeoutController.clear();
299
- }
300
- }
301
- /**
302
- * Reads the Identify Push message from the given `connection`
303
- */
304
- async _handlePush(data) {
305
- const { connection, stream } = data;
306
- const timeoutController = new TimeoutController(this.init.timeout);
307
- try {
308
- // fails on node < 15.4
309
- setMaxListeners?.(Infinity, timeoutController.signal);
310
- }
311
- catch { }
312
- let message;
313
- try {
314
- // make stream abortable
315
- const source = abortableDuplex(stream, timeoutController.signal);
316
- const data = await pipe([], source, (source) => lp.decode(source, {
317
- maxDataLength: this.init.maxIdentifyMessageSize ?? MAX_IDENTIFY_MESSAGE_SIZE
318
- }), async (source) => await first(source));
319
- if (data != null) {
320
- message = Identify.decode(data);
321
- }
322
- }
323
- catch (err) {
324
- log.error('received invalid message', err);
325
- return;
326
- }
327
- finally {
328
- stream.close();
329
- timeoutController.clear();
330
- }
331
- if (message == null) {
332
- log.error('received invalid message');
333
- return;
334
- }
335
- const id = connection.remotePeer;
336
- if (this.components.peerId.equals(id)) {
337
- log('received push from ourselves?');
338
- return;
339
- }
340
- log('received push from %p', id);
341
- if (message.signedPeerRecord != null) {
342
- log('received signedPeerRecord in push');
343
- try {
344
- const envelope = await RecordEnvelope.openAndCertify(message.signedPeerRecord, PeerRecord.DOMAIN);
345
- if (await this.components.peerStore.addressBook.consumePeerRecord(envelope)) {
346
- log('consumed signedPeerRecord sent in push');
347
- await this.components.peerStore.protoBook.set(id, message.protocols);
348
- return;
349
- }
350
- else {
351
- log('failed to consume signedPeerRecord sent in push');
352
- }
353
- }
354
- catch (err) {
355
- log('received invalid envelope, discard it and fallback to listenAddrs is available', err);
356
- }
357
- }
358
- else {
359
- log('did not receive signedPeerRecord in push');
360
- }
361
- // LEGACY: Update peers data in PeerStore
362
- try {
363
- await this.components.peerStore.addressBook.set(id, message.listenAddrs.map((addr) => multiaddr(addr)));
364
- }
365
- catch (err) {
366
- log.error('received invalid addrs', err);
367
- }
368
- // Update the protocols
369
- try {
370
- await this.components.peerStore.protoBook.set(id, message.protocols);
371
- }
372
- catch (err) {
373
- log.error('received invalid protocols', err);
374
- }
375
- log('handled push from %p', id);
376
- }
377
- /**
378
- * Takes the `addr` and converts it to a Multiaddr if possible
379
- */
380
- static getCleanMultiaddr(addr) {
381
- if (addr != null && addr.length > 0) {
382
- try {
383
- return multiaddr(addr);
384
- }
385
- catch {
386
- }
387
- }
388
- }
389
- }
390
4
  /**
391
5
  * The protocols the IdentifyService supports
392
6
  */
@@ -395,4 +9,7 @@ export const multicodecs = {
395
9
  IDENTIFY_PUSH: MULTICODEC_IDENTIFY_PUSH
396
10
  };
397
11
  export const Message = { Identify };
12
+ export function identifyService(init = {}) {
13
+ return (components) => new DefaultIdentifyService(components, init);
14
+ }
398
15
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/identify/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AACrD,OAAO,KAAK,EAAE,MAAM,oBAAoB,CAAA;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,KAAK,MAAM,UAAU,CAAA;AAC5B,OAAO,EAAE,UAAU,IAAI,oBAAoB,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAO,EAAa,SAAS,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC1C,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAChE,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,yBAAyB,EACzB,iCAAiC,EACjC,sCAAsC,EACtC,oCAAoC,EACpC,yCAAyC,EAC1C,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AAIpC,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAA;AAChD,OAAO,EAA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