@libp2p/interface-internal 1.1.1-90cfd25e2 → 1.1.1-c82432312

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.
@@ -1,5 +1,6 @@
1
1
  export * from './address-manager/index.js';
2
2
  export * from './connection-manager/index.js';
3
+ export * from './random-walk/index.js';
3
4
  export * from './record/index.js';
4
5
  export * from './registrar/index.js';
5
6
  export * from './transport-manager/index.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAA;AAC1C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,mBAAmB,CAAA;AACjC,cAAc,sBAAsB,CAAA;AACpC,cAAc,8BAA8B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAA;AAC1C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,wBAAwB,CAAA;AACtC,cAAc,mBAAmB,CAAA;AACjC,cAAc,sBAAsB,CAAA;AACpC,cAAc,8BAA8B,CAAA"}
package/dist/src/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from './address-manager/index.js';
2
2
  export * from './connection-manager/index.js';
3
+ export * from './random-walk/index.js';
3
4
  export * from './record/index.js';
4
5
  export * from './registrar/index.js';
5
6
  export * from './transport-manager/index.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAA;AAC1C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,mBAAmB,CAAA;AACjC,cAAc,sBAAsB,CAAA;AACpC,cAAc,8BAA8B,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAA;AAC1C,cAAc,+BAA+B,CAAA;AAC7C,cAAc,wBAAwB,CAAA;AACtC,cAAc,mBAAmB,CAAA;AACjC,cAAc,sBAAsB,CAAA;AACpC,cAAc,8BAA8B,CAAA"}
@@ -0,0 +1,13 @@
1
+ import type { AbortOptions, PeerInfo } from '@libp2p/interface';
2
+ /**
3
+ * RandomWalk finds random peers on the network and dials them. Use this after
4
+ * registering a Topology if you need to discover common network services.
5
+ */
6
+ export interface RandomWalk {
7
+ /**
8
+ * Begin or join an existing walk. Abort the passed signal if you wish to
9
+ * abort the walk early.
10
+ */
11
+ walk(options?: AbortOptions): AsyncGenerator<PeerInfo>;
12
+ }
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/random-walk/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE/D;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB;;;OAGG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAA;CACvD"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/random-walk/index.ts"],"names":[],"mappings":""}
@@ -25,9 +25,14 @@ export interface TransportManager {
25
25
  */
26
26
  getListeners(): Listener[];
27
27
  /**
28
- * Get the transport for a given multiaddr, if one has been configured
28
+ * Get the transport to dial a given multiaddr, if one has been configured
29
29
  */
30
- transportForMultiaddr(ma: Multiaddr): Transport | undefined;
30
+ dialTransportForMultiaddr(ma: Multiaddr): Transport | undefined;
31
+ /**
32
+ * Get the transport to listen on a given multiaddr, if one has been
33
+ * configured
34
+ */
35
+ listenTransportForMultiaddr(ma: Multiaddr): Transport | undefined;
31
36
  /**
32
37
  * Listen on the passed multiaddrs
33
38
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/transport-manager/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AACxE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAExD,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,GAAG,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI,CAAA;IAE/B;;;;;OAKG;IACH,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;IAEvD;;OAEG;IACH,QAAQ,IAAI,SAAS,EAAE,CAAA;IAEvB;;OAEG;IACH,aAAa,IAAI,SAAS,EAAE,CAAA;IAE5B;;OAEG;IACH,YAAY,IAAI,QAAQ,EAAE,CAAA;IAE1B;;OAEG;IACH,qBAAqB,CAAC,EAAE,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,CAAA;IAE3D;;OAEG;IACH,MAAM,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEzC;;OAEG;IACH,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAElC;;OAEG;IACH,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CAC3B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/transport-manager/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AACxE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAExD,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,GAAG,CAAC,SAAS,EAAE,SAAS,GAAG,IAAI,CAAA;IAE/B;;;;;OAKG;IACH,IAAI,CAAC,EAAE,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,UAAU,CAAC,CAAA;IAEvD;;OAEG;IACH,QAAQ,IAAI,SAAS,EAAE,CAAA;IAEvB;;OAEG;IACH,aAAa,IAAI,SAAS,EAAE,CAAA;IAE5B;;OAEG;IACH,YAAY,IAAI,QAAQ,EAAE,CAAA;IAE1B;;OAEG;IACH,yBAAyB,CAAC,EAAE,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,CAAA;IAE/D;;;OAGG;IACH,2BAA2B,CAAC,EAAE,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,CAAA;IAEjE;;OAEG;IACH,MAAM,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAEzC;;OAEG;IACH,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAElC;;OAEG;IACH,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAAA;CAC3B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@libp2p/interface-internal",
3
- "version": "1.1.1-90cfd25e2",
3
+ "version": "1.1.1-c82432312",
4
4
  "description": "Interfaces implemented by internal libp2p components",
5
5
  "license": "Apache-2.0 OR MIT",
6
6
  "homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/interface-internal#readme",
@@ -48,8 +48,8 @@
48
48
  "build": "aegir build"
49
49
  },
50
50
  "dependencies": {
51
- "@libp2p/interface": "1.3.0-90cfd25e2",
52
- "@libp2p/peer-collections": "5.1.11-90cfd25e2",
51
+ "@libp2p/interface": "1.3.0-c82432312",
52
+ "@libp2p/peer-collections": "5.1.11-c82432312",
53
53
  "@multiformats/multiaddr": "^12.2.1",
54
54
  "uint8arraylist": "^2.4.8"
55
55
  },
package/src/index.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from './address-manager/index.js'
2
2
  export * from './connection-manager/index.js'
3
+ export * from './random-walk/index.js'
3
4
  export * from './record/index.js'
4
5
  export * from './registrar/index.js'
5
6
  export * from './transport-manager/index.js'
@@ -0,0 +1,13 @@
1
+ import type { AbortOptions, PeerInfo } from '@libp2p/interface'
2
+
3
+ /**
4
+ * RandomWalk finds random peers on the network and dials them. Use this after
5
+ * registering a Topology if you need to discover common network services.
6
+ */
7
+ export interface RandomWalk {
8
+ /**
9
+ * Begin or join an existing walk. Abort the passed signal if you wish to
10
+ * abort the walk early.
11
+ */
12
+ walk(options?: AbortOptions): AsyncGenerator<PeerInfo>
13
+ }
@@ -31,9 +31,15 @@ export interface TransportManager {
31
31
  getListeners(): Listener[]
32
32
 
33
33
  /**
34
- * Get the transport for a given multiaddr, if one has been configured
34
+ * Get the transport to dial a given multiaddr, if one has been configured
35
35
  */
36
- transportForMultiaddr(ma: Multiaddr): Transport | undefined
36
+ dialTransportForMultiaddr(ma: Multiaddr): Transport | undefined
37
+
38
+ /**
39
+ * Get the transport to listen on a given multiaddr, if one has been
40
+ * configured
41
+ */
42
+ listenTransportForMultiaddr(ma: Multiaddr): Transport | undefined
37
43
 
38
44
  /**
39
45
  * Listen on the passed multiaddrs