libp2p 2.3.1 → 2.4.0-5c4a79e5a

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 (69) hide show
  1. package/README.md +9 -25
  2. package/dist/index.min.js +18 -15
  3. package/dist/src/address-manager/dns-mappings.d.ts +20 -0
  4. package/dist/src/address-manager/dns-mappings.d.ts.map +1 -0
  5. package/dist/src/address-manager/dns-mappings.js +139 -0
  6. package/dist/src/address-manager/dns-mappings.js.map +1 -0
  7. package/dist/src/{address-manager.d.ts → address-manager/index.d.ts} +54 -10
  8. package/dist/src/address-manager/index.d.ts.map +1 -0
  9. package/dist/src/address-manager/index.js +264 -0
  10. package/dist/src/address-manager/index.js.map +1 -0
  11. package/dist/src/address-manager/ip-mappings.d.ts +18 -0
  12. package/dist/src/address-manager/ip-mappings.d.ts.map +1 -0
  13. package/dist/src/address-manager/ip-mappings.js +143 -0
  14. package/dist/src/address-manager/ip-mappings.js.map +1 -0
  15. package/dist/src/address-manager/observed-addresses.d.ts +19 -0
  16. package/dist/src/address-manager/observed-addresses.d.ts.map +1 -0
  17. package/dist/src/address-manager/observed-addresses.js +70 -0
  18. package/dist/src/address-manager/observed-addresses.js.map +1 -0
  19. package/dist/src/address-manager/transport-addresses.d.ts +19 -0
  20. package/dist/src/address-manager/transport-addresses.d.ts.map +1 -0
  21. package/dist/src/address-manager/transport-addresses.js +83 -0
  22. package/dist/src/address-manager/transport-addresses.js.map +1 -0
  23. package/dist/src/config/connection-gater.browser.d.ts +7 -3
  24. package/dist/src/config/connection-gater.browser.d.ts.map +1 -1
  25. package/dist/src/config/connection-gater.browser.js +16 -4
  26. package/dist/src/config/connection-gater.browser.js.map +1 -1
  27. package/dist/src/connection-manager/connection-pruner.d.ts.map +1 -1
  28. package/dist/src/connection-manager/connection-pruner.js +4 -3
  29. package/dist/src/connection-manager/connection-pruner.js.map +1 -1
  30. package/dist/src/connection-manager/dial-queue.d.ts +3 -3
  31. package/dist/src/connection-manager/dial-queue.d.ts.map +1 -1
  32. package/dist/src/connection-manager/dial-queue.js +6 -13
  33. package/dist/src/connection-manager/dial-queue.js.map +1 -1
  34. package/dist/src/connection-manager/index.d.ts +1 -0
  35. package/dist/src/connection-manager/index.d.ts.map +1 -1
  36. package/dist/src/connection-manager/index.js +10 -6
  37. package/dist/src/connection-manager/index.js.map +1 -1
  38. package/dist/src/connection-manager/utils.d.ts +13 -1
  39. package/dist/src/connection-manager/utils.d.ts.map +1 -1
  40. package/dist/src/connection-manager/utils.js +33 -1
  41. package/dist/src/connection-manager/utils.js.map +1 -1
  42. package/dist/src/index.d.ts +1 -1
  43. package/dist/src/index.d.ts.map +1 -1
  44. package/dist/src/libp2p.js +1 -1
  45. package/dist/src/libp2p.js.map +1 -1
  46. package/dist/src/version.d.ts +2 -2
  47. package/dist/src/version.d.ts.map +1 -1
  48. package/dist/src/version.js +2 -2
  49. package/dist/src/version.js.map +1 -1
  50. package/package.json +27 -25
  51. package/src/address-manager/dns-mappings.ts +182 -0
  52. package/src/address-manager/index.ts +413 -0
  53. package/src/address-manager/ip-mappings.ts +191 -0
  54. package/src/address-manager/observed-addresses.ts +94 -0
  55. package/src/address-manager/transport-addresses.ts +116 -0
  56. package/src/config/connection-gater.browser.ts +18 -4
  57. package/src/connection-manager/connection-pruner.ts +6 -4
  58. package/src/connection-manager/dial-queue.ts +12 -19
  59. package/src/connection-manager/index.ts +14 -8
  60. package/src/connection-manager/utils.ts +35 -2
  61. package/src/index.ts +1 -1
  62. package/src/libp2p.ts +1 -1
  63. package/src/version.ts +2 -2
  64. package/LICENSE +0 -4
  65. package/dist/src/address-manager.d.ts.map +0 -1
  66. package/dist/src/address-manager.js +0 -214
  67. package/dist/src/address-manager.js.map +0 -1
  68. package/dist/typedoc-urls.json +0 -19
  69. package/src/address-manager.ts +0 -319
@@ -0,0 +1,20 @@
1
+ import type { AddressManagerComponents, AddressManagerInit } from './index.js';
2
+ import type { NodeAddress } from '@libp2p/interface-internal';
3
+ import type { Multiaddr } from '@multiformats/multiaddr';
4
+ export declare const defaultValues: {
5
+ maxObservedAddresses: number;
6
+ };
7
+ export declare class DNSMappings {
8
+ private readonly log;
9
+ private readonly mappings;
10
+ constructor(components: AddressManagerComponents, init?: AddressManagerInit);
11
+ has(ma: Multiaddr): boolean;
12
+ add(domain: string, addresses: string[]): void;
13
+ remove(ma: Multiaddr): boolean;
14
+ getAll(addresses: NodeAddress[]): NodeAddress[];
15
+ private maybeAddSNITuple;
16
+ confirm(ma: Multiaddr, ttl: number): boolean;
17
+ unconfirm(ma: Multiaddr, ttl: number): boolean;
18
+ private findHost;
19
+ }
20
+ //# sourceMappingURL=dns-mappings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dns-mappings.d.ts","sourceRoot":"","sources":["../../../src/address-manager/dns-mappings.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAE9E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAe,MAAM,yBAAyB,CAAA;AAIrE,eAAO,MAAM,aAAa;;CAEzB,CAAA;AAgBD,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAQ;IAC5B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAyB;gBAErC,UAAU,EAAE,wBAAwB,EAAE,IAAI,GAAE,kBAAuB;IAKhF,GAAG,CAAE,EAAE,EAAE,SAAS,GAAG,OAAO;IAY5B,GAAG,CAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI;IAgB/C,MAAM,CAAE,EAAE,EAAE,SAAS,GAAG,OAAO;IAe/B,MAAM,CAAE,SAAS,EAAE,WAAW,EAAE,GAAG,WAAW,EAAE;IA+ChD,OAAO,CAAC,gBAAgB;IAWxB,OAAO,CAAE,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO;IAiB7C,SAAS,CAAE,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO;IAgB/C,OAAO,CAAC,QAAQ;CAWjB"}
@@ -0,0 +1,139 @@
1
+ import { isPrivateIp } from '@libp2p/utils/private-ip';
2
+ import { multiaddr, protocols } from '@multiformats/multiaddr';
3
+ const MAX_DATE = 8_640_000_000_000_000;
4
+ export const defaultValues = {
5
+ maxObservedAddresses: 10
6
+ };
7
+ const CODEC_TLS = 0x01c0;
8
+ const CODEC_SNI = 0x01c1;
9
+ const CODEC_DNS = 0x35;
10
+ const CODEC_DNS4 = 0x36;
11
+ const CODEC_DNS6 = 0x37;
12
+ const CODEC_DNSADDR = 0x38;
13
+ export class DNSMappings {
14
+ log;
15
+ mappings;
16
+ constructor(components, init = {}) {
17
+ this.log = components.logger.forComponent('libp2p:address-manager:dns-mappings');
18
+ this.mappings = new Map();
19
+ }
20
+ has(ma) {
21
+ const host = this.findHost(ma);
22
+ for (const mapping of this.mappings.values()) {
23
+ if (mapping.domain === host) {
24
+ return true;
25
+ }
26
+ }
27
+ return false;
28
+ }
29
+ add(domain, addresses) {
30
+ addresses.forEach(ip => {
31
+ this.log('add DNS mapping %s to %s', ip, domain);
32
+ // we are only confident if this is an local domain mapping, otherwise
33
+ // we will require external validation
34
+ const verified = isPrivateIp(ip) === true;
35
+ this.mappings.set(ip, {
36
+ domain,
37
+ verified,
38
+ expires: verified ? MAX_DATE - Date.now() : 0,
39
+ lastVerified: verified ? MAX_DATE - Date.now() : undefined
40
+ });
41
+ });
42
+ }
43
+ remove(ma) {
44
+ const host = this.findHost(ma);
45
+ let wasConfident = false;
46
+ for (const [ip, mapping] of this.mappings.entries()) {
47
+ if (mapping.domain === host) {
48
+ this.log('removing %s to %s DNS mapping %e', ip, mapping.domain, new Error('where'));
49
+ this.mappings.delete(ip);
50
+ wasConfident = wasConfident || mapping.verified;
51
+ }
52
+ }
53
+ return wasConfident;
54
+ }
55
+ getAll(addresses) {
56
+ const dnsMappedAddresses = [];
57
+ for (let i = 0; i < addresses.length; i++) {
58
+ const address = addresses[i];
59
+ const tuples = address.multiaddr.stringTuples();
60
+ const host = tuples[0][1];
61
+ if (host == null) {
62
+ continue;
63
+ }
64
+ for (const [ip, mapping] of this.mappings.entries()) {
65
+ if (host !== ip) {
66
+ continue;
67
+ }
68
+ // insert SNI tuple after TLS tuple, if one is present
69
+ const mappedIp = this.maybeAddSNITuple(tuples, mapping.domain);
70
+ if (mappedIp) {
71
+ // remove the address and replace it with the version that includes
72
+ // the SNI tuple
73
+ addresses.splice(i, 1);
74
+ i--;
75
+ dnsMappedAddresses.push({
76
+ multiaddr: multiaddr(`/${tuples.map(tuple => {
77
+ return [
78
+ protocols(tuple[0]).name,
79
+ tuple[1]
80
+ ].join('/');
81
+ }).join('/')}`),
82
+ verified: mapping.verified,
83
+ type: 'dns-mapping',
84
+ expires: mapping.expires,
85
+ lastVerified: mapping.lastVerified
86
+ });
87
+ }
88
+ }
89
+ }
90
+ return dnsMappedAddresses;
91
+ }
92
+ maybeAddSNITuple(tuples, domain) {
93
+ for (let j = 0; j < tuples.length; j++) {
94
+ if (tuples[j][0] === CODEC_TLS && tuples[j + 1]?.[0] !== CODEC_SNI) {
95
+ tuples.splice(j + 1, 0, [CODEC_SNI, domain]);
96
+ return true;
97
+ }
98
+ }
99
+ return false;
100
+ }
101
+ confirm(ma, ttl) {
102
+ const host = this.findHost(ma);
103
+ let startingConfidence = false;
104
+ for (const [ip, mapping] of this.mappings.entries()) {
105
+ if (mapping.domain === host) {
106
+ this.log('marking %s to %s DNS mapping as verified', ip, mapping.domain);
107
+ startingConfidence = mapping.verified;
108
+ mapping.verified = true;
109
+ mapping.expires = Date.now() + ttl;
110
+ mapping.lastVerified = Date.now();
111
+ }
112
+ }
113
+ return startingConfidence;
114
+ }
115
+ unconfirm(ma, ttl) {
116
+ const host = this.findHost(ma);
117
+ let wasConfident = false;
118
+ for (const [ip, mapping] of this.mappings.entries()) {
119
+ if (mapping.domain === host) {
120
+ this.log('removing verification of %s to %s DNS mapping', ip, mapping.domain);
121
+ wasConfident = wasConfident || mapping.verified;
122
+ mapping.verified = false;
123
+ mapping.expires = Date.now() + ttl;
124
+ }
125
+ }
126
+ return wasConfident;
127
+ }
128
+ findHost(ma) {
129
+ for (const tuple of ma.stringTuples()) {
130
+ if (tuple[0] === CODEC_SNI) {
131
+ return tuple[1];
132
+ }
133
+ if (tuple[0] === CODEC_DNS || tuple[0] === CODEC_DNS4 || tuple[0] === CODEC_DNS6 || tuple[0] === CODEC_DNSADDR) {
134
+ return tuple[1];
135
+ }
136
+ }
137
+ }
138
+ }
139
+ //# sourceMappingURL=dns-mappings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dns-mappings.js","sourceRoot":"","sources":["../../../src/address-manager/dns-mappings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAM9D,MAAM,QAAQ,GAAG,qBAAqB,CAAA;AAEtC,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,oBAAoB,EAAE,EAAE;CACzB,CAAA;AASD,MAAM,SAAS,GAAG,MAAM,CAAA;AACxB,MAAM,SAAS,GAAG,MAAM,CAAA;AACxB,MAAM,SAAS,GAAG,IAAI,CAAA;AACtB,MAAM,UAAU,GAAG,IAAI,CAAA;AACvB,MAAM,UAAU,GAAG,IAAI,CAAA;AACvB,MAAM,aAAa,GAAG,IAAI,CAAA;AAE1B,MAAM,OAAO,WAAW;IACL,GAAG,CAAQ;IACX,QAAQ,CAAyB;IAElD,YAAa,UAAoC,EAAE,OAA2B,EAAE;QAC9E,IAAI,CAAC,GAAG,GAAG,UAAU,CAAC,MAAM,CAAC,YAAY,CAAC,qCAAqC,CAAC,CAAA;QAChF,IAAI,CAAC,QAAQ,GAAG,IAAI,GAA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A;YACjB,CAAC;YAED,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,SAAS,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,UAAU,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,UAAU,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,aAAa,EAAE,CAAC;gBAC/G,OAAO,KAAK,CAAC,CAAC,CAAC,CAAA;YACjB,CAAC;QACH,CAAC;IACH,CAAC;CACF"}
@@ -1,6 +1,11 @@
1
1
  import type { ComponentLogger, Libp2pEvents, TypedEventTarget, PeerId, PeerStore } from '@libp2p/interface';
2
- import type { AddressManager as AddressManagerInterface, TransportManager } from '@libp2p/interface-internal';
2
+ import type { AddressManager as AddressManagerInterface, TransportManager, NodeAddress, ConfirmAddressOptions } from '@libp2p/interface-internal';
3
3
  import type { Multiaddr } from '@multiformats/multiaddr';
4
+ export declare const defaultValues: {
5
+ maxObservedAddresses: number;
6
+ addressVerificationTTL: number;
7
+ addressVerificationRetry: number;
8
+ };
4
9
  export interface AddressManagerInit {
5
10
  /**
6
11
  * Pass an function in this field to override the list of addresses
@@ -8,17 +13,44 @@ export interface AddressManagerInit {
8
13
  */
9
14
  announceFilter?: AddressFilter;
10
15
  /**
11
- * list of multiaddrs string representation to listen
16
+ * A list of string multiaddrs to listen on
12
17
  */
13
18
  listen?: string[];
14
19
  /**
15
- * list of multiaddrs string representation to announce
20
+ * A list of string multiaddrs to use instead of those reported by transports
16
21
  */
17
22
  announce?: string[];
18
23
  /**
19
- * list of multiaddrs string representation to never announce
24
+ * A list of string multiaddrs string to never announce
20
25
  */
21
26
  noAnnounce?: string[];
27
+ /**
28
+ * A list of string multiaddrs to add to the list of announced addresses
29
+ */
30
+ appendAnnounce?: string[];
31
+ /**
32
+ * Limits the number of observed addresses we will store
33
+ */
34
+ maxObservedAddresses?: number;
35
+ /**
36
+ * How long before each public address should be reverified in ms.
37
+ *
38
+ * Requires `@libp2p/autonat` or some other verification method to be
39
+ * configured.
40
+ *
41
+ * @default 600_000
42
+ */
43
+ addressVerificationTTL?: number;
44
+ /**
45
+ * After a transport or mapped address has failed to verify, how long to wait
46
+ * before retrying it in ms
47
+ *
48
+ * Requires `@libp2p/autonat` or some other verification method to be
49
+ * configured.
50
+ *
51
+ * @default 300_000
52
+ */
53
+ addressVerificationRetry?: number;
22
54
  }
23
55
  export interface AddressManagerComponents {
24
56
  peerId: PeerId;
@@ -39,10 +71,15 @@ export declare class AddressManager implements AddressManagerInterface {
39
71
  private readonly components;
40
72
  private readonly listen;
41
73
  private readonly announce;
42
- private readonly observed;
74
+ private readonly appendAnnounce;
43
75
  private readonly announceFilter;
44
- private readonly ipDomainMappings;
45
- private readonly where;
76
+ private readonly observed;
77
+ private readonly dnsMappings;
78
+ private readonly ipMappings;
79
+ private readonly transportAddresses;
80
+ private readonly observedAddressFilter;
81
+ private readonly addressVerificationTTL;
82
+ private readonly addressVerificationRetry;
46
83
  /**
47
84
  * Responsible for managing the peer addresses.
48
85
  * Peers can specify their listen and announce addresses.
@@ -60,6 +97,10 @@ export declare class AddressManager implements AddressManagerInterface {
60
97
  * Get peer announcing multiaddrs
61
98
  */
62
99
  getAnnounceAddrs(): Multiaddr[];
100
+ /**
101
+ * Get peer announcing multiaddrs
102
+ */
103
+ getAppendAnnounceAddrs(): Multiaddr[];
63
104
  /**
64
105
  * Get observed multiaddrs
65
106
  */
@@ -68,10 +109,13 @@ export declare class AddressManager implements AddressManagerInterface {
68
109
  * Add peer observed addresses
69
110
  */
70
111
  addObservedAddr(addr: Multiaddr): void;
71
- confirmObservedAddr(addr: Multiaddr): void;
72
- removeObservedAddr(addr: Multiaddr): void;
112
+ confirmObservedAddr(addr: Multiaddr, options?: ConfirmAddressOptions): void;
113
+ removeObservedAddr(addr: Multiaddr, options?: ConfirmAddressOptions): void;
73
114
  getAddresses(): Multiaddr[];
115
+ getAddressesWithMetadata(): NodeAddress[];
74
116
  addDNSMapping(domain: string, addresses: string[]): void;
75
117
  removeDNSMapping(domain: string): void;
118
+ addPublicAddressMapping(internalIp: string, internalPort: number, externalIp: string, externalPort?: number, protocol?: 'tcp' | 'udp'): void;
119
+ removePublicAddressMapping(internalIp: string, internalPort: number, externalIp: string, externalPort?: number, protocol?: 'tcp' | 'udp'): void;
76
120
  }
77
- //# sourceMappingURL=address-manager.d.ts.map
121
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/address-manager/index.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAU,gBAAgB,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AACnH,OAAO,KAAK,EAAE,cAAc,IAAI,uBAAuB,EAAE,gBAAgB,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AAEjJ,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAIxD,eAAO,MAAM,aAAa;;;;CAIzB,CAAA;AAED,MAAM,WAAW,kBAAkB;IACjC;;;OAGG;IACH,cAAc,CAAC,EAAE,aAAa,CAAA;IAE9B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IAEjB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;IAEnB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IAErB;;OAEG;IACH,cAAc,CAAC,EAAE,MAAM,EAAE,CAAA;IAEzB;;OAEG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAE7B;;;;;;;OAOG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAE/B;;;;;;;;OAQG;IACH,wBAAwB,CAAC,EAAE,MAAM,CAAA;CAClC;AAED,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,MAAM,CAAA;IACd,gBAAgB,EAAE,gBAAgB,CAAA;IAClC,SAAS,EAAE,SAAS,CAAA;IACpB,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E,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,IAAI;IA0B5E,kBAAkB,CAAE,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,IAAI;IA2B3E,YAAY,IAAK,SAAS,EAAE;IAwC5B,wBAAwB,IAAK,WAAW,EAAE;IAkD1C,aAAa,CAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI;IAIzD,gBAAgB,CAAE,MAAM,EAAE,MAAM,GAAG,IAAI;IAMvC,uBAAuB,CAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,GAAE,MAAqB,EAAE,QAAQ,GAAE,KAAK,GAAG,KAAa,GAAG,IAAI;IAOlK,0BAA0B,CAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,GAAE,MAAqB,EAAE,QAAQ,GAAE,KAAK,GAAG,KAAa,GAAG,IAAI;CAKtK"}
@@ -0,0 +1,264 @@
1
+ /* eslint-disable complexity */
2
+ import { isIPv4 } from '@chainsafe/is-ip';
3
+ import { peerIdFromString } from '@libp2p/peer-id';
4
+ import { debounce } from '@libp2p/utils/debounce';
5
+ import { createScalableCuckooFilter } from '@libp2p/utils/filters';
6
+ import { multiaddr } from '@multiformats/multiaddr';
7
+ import { DNSMappings } from './dns-mappings.js';
8
+ import { IPMappings } from './ip-mappings.js';
9
+ import { ObservedAddresses } from './observed-addresses.js';
10
+ import { TransportAddresses } from './transport-addresses.js';
11
+ const ONE_MINUTE = 60_000;
12
+ export const defaultValues = {
13
+ maxObservedAddresses: 10,
14
+ addressVerificationTTL: ONE_MINUTE * 10,
15
+ addressVerificationRetry: ONE_MINUTE * 5
16
+ };
17
+ const defaultAddressFilter = (addrs) => addrs;
18
+ /**
19
+ * If the passed multiaddr contains the passed peer id, remove it
20
+ */
21
+ function stripPeerId(ma, peerId) {
22
+ const observedPeerIdStr = ma.getPeerId();
23
+ // strip our peer id if it has been passed
24
+ if (observedPeerIdStr != null) {
25
+ const observedPeerId = peerIdFromString(observedPeerIdStr);
26
+ // use same encoding for comparison
27
+ if (observedPeerId.equals(peerId)) {
28
+ ma = ma.decapsulate(multiaddr(`/p2p/${peerId.toString()}`));
29
+ }
30
+ }
31
+ return ma;
32
+ }
33
+ export class AddressManager {
34
+ log;
35
+ components;
36
+ // this is an array to allow for duplicates, e.g. multiples of `/ip4/0.0.0.0/tcp/0`
37
+ listen;
38
+ announce;
39
+ appendAnnounce;
40
+ announceFilter;
41
+ observed;
42
+ dnsMappings;
43
+ ipMappings;
44
+ transportAddresses;
45
+ observedAddressFilter;
46
+ addressVerificationTTL;
47
+ addressVerificationRetry;
48
+ /**
49
+ * Responsible for managing the peer addresses.
50
+ * Peers can specify their listen and announce addresses.
51
+ * The listen addresses will be used by the libp2p transports to listen for new connections,
52
+ * while the announce addresses will be used for the peer addresses' to other peers in the network.
53
+ */
54
+ constructor(components, init = {}) {
55
+ const { listen = [], announce = [], appendAnnounce = [] } = init;
56
+ this.components = components;
57
+ this.log = components.logger.forComponent('libp2p:address-manager');
58
+ this.listen = listen.map(ma => ma.toString());
59
+ this.announce = new Set(announce.map(ma => ma.toString()));
60
+ this.appendAnnounce = new Set(appendAnnounce.map(ma => ma.toString()));
61
+ this.observed = new ObservedAddresses(components, init);
62
+ this.dnsMappings = new DNSMappings(components, init);
63
+ this.ipMappings = new IPMappings(components, init);
64
+ this.transportAddresses = new TransportAddresses(components, init);
65
+ this.announceFilter = init.announceFilter ?? defaultAddressFilter;
66
+ this.observedAddressFilter = createScalableCuckooFilter(1024);
67
+ this.addressVerificationTTL = init.addressVerificationTTL ?? defaultValues.addressVerificationTTL;
68
+ this.addressVerificationRetry = init.addressVerificationRetry ?? defaultValues.addressVerificationRetry;
69
+ // this method gets called repeatedly on startup when transports start listening so
70
+ // debounce it so we don't cause multiple self:peer:update events to be emitted
71
+ this._updatePeerStoreAddresses = debounce(this._updatePeerStoreAddresses.bind(this), 1000);
72
+ // update our stored addresses when new transports listen
73
+ components.events.addEventListener('transport:listening', () => {
74
+ this._updatePeerStoreAddresses();
75
+ });
76
+ // update our stored addresses when existing transports stop listening
77
+ components.events.addEventListener('transport:close', () => {
78
+ this._updatePeerStoreAddresses();
79
+ });
80
+ }
81
+ [Symbol.toStringTag] = '@libp2p/address-manager';
82
+ _updatePeerStoreAddresses() {
83
+ // if announce addresses have been configured, ensure they make it into our peer
84
+ // record for things like identify
85
+ const addrs = this.getAddresses()
86
+ .map(ma => {
87
+ // strip our peer id if it is present
88
+ if (ma.getPeerId() === this.components.peerId.toString()) {
89
+ return ma.decapsulate(`/p2p/${this.components.peerId.toString()}`);
90
+ }
91
+ return ma;
92
+ });
93
+ this.components.peerStore.patch(this.components.peerId, {
94
+ multiaddrs: addrs
95
+ })
96
+ .catch(err => {
97
+ this.log.error('error updating addresses', err);
98
+ });
99
+ }
100
+ /**
101
+ * Get peer listen multiaddrs
102
+ */
103
+ getListenAddrs() {
104
+ return Array.from(this.listen).map((a) => multiaddr(a));
105
+ }
106
+ /**
107
+ * Get peer announcing multiaddrs
108
+ */
109
+ getAnnounceAddrs() {
110
+ return Array.from(this.announce).map((a) => multiaddr(a));
111
+ }
112
+ /**
113
+ * Get peer announcing multiaddrs
114
+ */
115
+ getAppendAnnounceAddrs() {
116
+ return Array.from(this.appendAnnounce).map((a) => multiaddr(a));
117
+ }
118
+ /**
119
+ * Get observed multiaddrs
120
+ */
121
+ getObservedAddrs() {
122
+ return this.observed.getAll().map(addr => addr.multiaddr);
123
+ }
124
+ /**
125
+ * Add peer observed addresses
126
+ */
127
+ addObservedAddr(addr) {
128
+ const tuples = addr.stringTuples();
129
+ const socketAddress = `${tuples[0][1]}:${tuples[1][1]}`;
130
+ // ignore if this address if it's been observed before
131
+ if (this.observedAddressFilter.has(socketAddress)) {
132
+ return;
133
+ }
134
+ this.observedAddressFilter.add(socketAddress);
135
+ addr = stripPeerId(addr, this.components.peerId);
136
+ // ignore observed address if it is an IP mapping
137
+ if (this.ipMappings.has(addr)) {
138
+ return;
139
+ }
140
+ // ignore observed address if it is a DNS mapping
141
+ if (this.dnsMappings.has(addr)) {
142
+ return;
143
+ }
144
+ this.observed.add(addr);
145
+ }
146
+ confirmObservedAddr(addr, options) {
147
+ addr = stripPeerId(addr, this.components.peerId);
148
+ let startingConfidence = true;
149
+ if (options?.type === 'observed' || this.observed.has(addr)) {
150
+ startingConfidence = this.observed.confirm(addr, options?.ttl ?? this.addressVerificationTTL);
151
+ }
152
+ if (options?.type === 'transport' || this.transportAddresses.has(addr)) {
153
+ startingConfidence = this.transportAddresses.confirm(addr, options?.ttl ?? this.addressVerificationTTL);
154
+ }
155
+ if (options?.type === 'dns-mapping' || this.dnsMappings.has(addr)) {
156
+ startingConfidence = this.dnsMappings.confirm(addr, options?.ttl ?? this.addressVerificationTTL);
157
+ }
158
+ if (options?.type === 'ip-mapping' || this.ipMappings.has(addr)) {
159
+ startingConfidence = this.ipMappings.confirm(addr, options?.ttl ?? this.addressVerificationTTL);
160
+ }
161
+ // only trigger the 'self:peer:update' event if our confidence in an address has changed
162
+ if (!startingConfidence) {
163
+ this._updatePeerStoreAddresses();
164
+ }
165
+ }
166
+ removeObservedAddr(addr, options) {
167
+ addr = stripPeerId(addr, this.components.peerId);
168
+ let startingConfidence = false;
169
+ if (this.observed.has(addr)) {
170
+ startingConfidence = this.observed.remove(addr);
171
+ }
172
+ if (this.transportAddresses.has(addr)) {
173
+ startingConfidence = this.transportAddresses.unconfirm(addr, options?.ttl ?? this.addressVerificationRetry);
174
+ }
175
+ if (this.dnsMappings.has(addr)) {
176
+ startingConfidence = this.dnsMappings.unconfirm(addr, options?.ttl ?? this.addressVerificationRetry);
177
+ }
178
+ if (this.ipMappings.has(addr)) {
179
+ startingConfidence = this.ipMappings.unconfirm(addr, options?.ttl ?? this.addressVerificationRetry);
180
+ }
181
+ // only trigger the 'self:peer:update' event if our confidence in an address has changed
182
+ if (startingConfidence) {
183
+ this._updatePeerStoreAddresses();
184
+ }
185
+ }
186
+ getAddresses() {
187
+ const addresses = new Set();
188
+ const multiaddrs = this.getAddressesWithMetadata()
189
+ .filter(addr => {
190
+ if (!addr.verified) {
191
+ return false;
192
+ }
193
+ const maStr = addr.multiaddr.toString();
194
+ if (addresses.has(maStr)) {
195
+ return false;
196
+ }
197
+ addresses.add(maStr);
198
+ return true;
199
+ })
200
+ .map(address => address.multiaddr);
201
+ // filter addressees before returning
202
+ return this.announceFilter(multiaddrs.map(str => {
203
+ const ma = multiaddr(str);
204
+ // do not append our peer id to a path multiaddr as it will become invalid
205
+ if (ma.protos().pop()?.path === true) {
206
+ return ma;
207
+ }
208
+ if (ma.getPeerId() === this.components.peerId.toString()) {
209
+ return ma;
210
+ }
211
+ return ma.encapsulate(`/p2p/${this.components.peerId.toString()}`);
212
+ }));
213
+ }
214
+ getAddressesWithMetadata() {
215
+ const announceMultiaddrs = this.getAnnounceAddrs();
216
+ if (announceMultiaddrs.length > 0) {
217
+ return announceMultiaddrs.map(multiaddr => ({
218
+ multiaddr,
219
+ verified: true,
220
+ type: 'announce',
221
+ expires: Date.now() + this.addressVerificationTTL,
222
+ lastVerified: Date.now()
223
+ }));
224
+ }
225
+ let addresses = [];
226
+ // add transport addresses
227
+ addresses = addresses.concat(this.components.transportManager.getAddrs()
228
+ .map(multiaddr => this.transportAddresses.get(multiaddr, this.addressVerificationTTL)));
229
+ // add append announce addresses
230
+ addresses = addresses.concat(this.getAppendAnnounceAddrs().map(multiaddr => ({
231
+ multiaddr,
232
+ verified: true,
233
+ type: 'announce',
234
+ expires: Date.now() + this.addressVerificationTTL,
235
+ lastVerified: Date.now()
236
+ })));
237
+ // add observed addresses
238
+ addresses = addresses.concat(this.observed.getAll());
239
+ // add ip mapped addresses
240
+ addresses = addresses.concat(this.ipMappings.getAll(addresses));
241
+ // add ip->domain mappings, must be done after IP mappings
242
+ addresses = addresses.concat(this.dnsMappings.getAll(addresses));
243
+ return addresses;
244
+ }
245
+ addDNSMapping(domain, addresses) {
246
+ this.dnsMappings.add(domain, addresses);
247
+ }
248
+ removeDNSMapping(domain) {
249
+ if (this.dnsMappings.remove(multiaddr(`/dns/${domain}`))) {
250
+ this._updatePeerStoreAddresses();
251
+ }
252
+ }
253
+ addPublicAddressMapping(internalIp, internalPort, externalIp, externalPort = internalPort, protocol = 'tcp') {
254
+ this.ipMappings.add(internalIp, internalPort, externalIp, externalPort, protocol);
255
+ // remove duplicate observed addresses
256
+ this.observed.removePrefixed(`/ip${isIPv4(externalIp) ? 4 : 6}/${externalIp}/${protocol}/${externalPort}`);
257
+ }
258
+ removePublicAddressMapping(internalIp, internalPort, externalIp, externalPort = internalPort, protocol = 'tcp') {
259
+ if (this.ipMappings.remove(multiaddr(`/ip${isIPv4(externalIp) ? 4 : 6}/${externalIp}/${protocol}/${externalPort}`))) {
260
+ this._updatePeerStoreAddresses();
261
+ }
262
+ }
263
+ }
264
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/address-manager/index.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAA;AACjD,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAA;AAClE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAM7D,M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,CAAA;QAED,OAAO,SAAS,CAAA;IAClB,CAAC;IAED,aAAa,CAAE,MAAc,EAAE,SAAmB;QAChD,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;IACzC,CAAC;IAED,gBAAgB,CAAE,MAAc;QAC9B,IAAI,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC;YACzD,IAAI,CAAC,yBAAyB,EAAE,CAAA;QAClC,CAAC;IACH,CAAC;IAED,uBAAuB,CAAE,UAAkB,EAAE,YAAoB,EAAE,UAAkB,EAAE,eAAuB,YAAY,EAAE,WAA0B,KAAK;QACzJ,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,QAAQ,CAAC,CAAA;QAEjF,sCAAsC;QACtC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,MAAM,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,UAAU,IAAI,QAAQ,IAAI,YAAY,EAAE,CAAC,CAAA;IAC5G,CAAC;IAED,0BAA0B,CAAE,UAAkB,EAAE,YAAoB,EAAE,UAAkB,EAAE,eAAuB,YAAY,EAAE,WAA0B,KAAK;QAC5J,IAAI,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,UAAU,IAAI,QAAQ,IAAI,YAAY,EAAE,CAAC,CAAC,EAAE,CAAC;YACpH,IAAI,CAAC,yBAAyB,EAAE,CAAA;QAClC,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,18 @@
1
+ import type { AddressManagerComponents, AddressManagerInit } from './index.js';
2
+ import type { NodeAddress } from '@libp2p/interface-internal';
3
+ import type { Multiaddr } from '@multiformats/multiaddr';
4
+ export declare const defaultValues: {
5
+ maxObservedAddresses: number;
6
+ };
7
+ export declare class IPMappings {
8
+ private readonly log;
9
+ private readonly mappings;
10
+ constructor(components: AddressManagerComponents, init?: AddressManagerInit);
11
+ has(ma: Multiaddr): boolean;
12
+ add(internalIp: string, internalPort: number, externalIp: string, externalPort?: number, protocol?: 'tcp' | 'udp'): void;
13
+ remove(ma: Multiaddr): boolean;
14
+ getAll(addresses: NodeAddress[]): NodeAddress[];
15
+ confirm(ma: Multiaddr, ttl: number): boolean;
16
+ unconfirm(ma: Multiaddr, ttl: number): boolean;
17
+ }
18
+ //# sourceMappingURL=ip-mappings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ip-mappings.d.ts","sourceRoot":"","sources":["../../../src/address-manager/ip-mappings.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAE9E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAExD,eAAO,MAAM,aAAa;;CAEzB,CAAA;AAmBD,qBAAa,UAAU;IACrB,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAQ;IAC5B,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAqC;gBAEjD,UAAU,EAAE,wBAAwB,EAAE,IAAI,GAAE,kBAAuB;IAKhF,GAAG,CAAE,EAAE,EAAE,SAAS,GAAG,OAAO;IAc5B,GAAG,CAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,GAAE,MAAqB,EAAE,QAAQ,GAAE,KAAK,GAAG,KAAa,GAAG,IAAI;IAkB9I,MAAM,CAAE,EAAE,EAAE,SAAS,GAAG,OAAO;IA4B/B,MAAM,CAAE,SAAS,EAAE,WAAW,EAAE,GAAG,WAAW,EAAE;IAiDhD,OAAO,CAAE,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO;IAqB7C,SAAS,CAAE,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO;CAuBhD"}