@libp2p/interface 1.0.2-f81be145a → 1.1.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/dist/src/connection/index.d.ts +28 -0
- package/dist/src/connection/index.d.ts.map +1 -1
- package/dist/src/connection/index.js.map +1 -1
- package/dist/src/peer-id/index.d.ts +1 -1
- package/dist/src/peer-id/index.d.ts.map +1 -1
- package/dist/typedoc-urls.json +157 -0
- package/package.json +2 -2
- package/src/connection/index.ts +29 -0
- package/src/peer-id/index.ts +1 -1
|
@@ -159,8 +159,36 @@ export interface NewStreamOptions extends AbortOptions {
|
|
|
159
159
|
/**
|
|
160
160
|
* Opt-in to running over a transient connection - one that has time/data limits
|
|
161
161
|
* placed on it.
|
|
162
|
+
*
|
|
163
|
+
* @default false
|
|
162
164
|
*/
|
|
163
165
|
runOnTransientConnection?: boolean;
|
|
166
|
+
/**
|
|
167
|
+
* By default when negotiating a protocol the dialer writes then protocol name
|
|
168
|
+
* then reads the response.
|
|
169
|
+
*
|
|
170
|
+
* When a only a single protocol is being negotiated on an outbound stream,
|
|
171
|
+
* and the stream is written to before being read from, we can optimistically
|
|
172
|
+
* write the protocol name and the first chunk of data together in the first
|
|
173
|
+
* message.
|
|
174
|
+
*
|
|
175
|
+
* Reading and handling the protocol response is done asynchronously, which
|
|
176
|
+
* means we can skip a round trip on writing to newly opened streams which
|
|
177
|
+
* significantly reduces the time-to-first-byte on a stream.
|
|
178
|
+
*
|
|
179
|
+
* The side-effect of this is that the underlying stream won't negotiate the
|
|
180
|
+
* protocol until either data is written to or read from the stream so it will
|
|
181
|
+
* not be opened on the remote until this is done.
|
|
182
|
+
*
|
|
183
|
+
* Pass `false` here to optimistically write the protocol name and first chunk
|
|
184
|
+
* of data in the first message.
|
|
185
|
+
*
|
|
186
|
+
* If multiple protocols are being negotiated, negotiation is always completed
|
|
187
|
+
* in full before the stream is returned so this option has no effect.
|
|
188
|
+
*
|
|
189
|
+
* @default true
|
|
190
|
+
*/
|
|
191
|
+
negotiateFully?: boolean;
|
|
164
192
|
}
|
|
165
193
|
export type ConnectionStatus = 'open' | 'closing' | 'closed';
|
|
166
194
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/connection/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAEpD,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IAEZ;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;IAEjB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,UAAU,CAAA;AAE9C,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IAEZ;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IAEnB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAA;AAE9E;;;;;;GAMG;AACH,MAAM,MAAM,UAAU,GAAG,OA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AE,MAAM,CAAA;IAEjB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAoB,SAAQ,MAAM,CAAC,cAAc,CAAC,UAAU,GAAG,cAAc,CAAC,CAAC;IAC9F;;;OAGG;IACH,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAE5C;;OAEG;IACH,KAAK,CAAC,GAAG,EAAE,KAAK,GAAG,IAAI,CAAA;IAEvB;;OAEG;IACH,UAAU,EAAE,SAAS,CAAA;IAErB;;OAEG;IACH,QAAQ,EAAE,2BAA2B,CAAA;IAErC;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;CACZ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/connection/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/connection/index.ts"],"names":[],"mappings":"AAuTA,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAA;AAEhE,MAAM,UAAU,YAAY,CAAE,KAAU;IACtC,OAAO,KAAK,IAAI,IAAI,IAAI,OAAO,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC,CAAA;AAC1D,CAAC"}
|
|
@@ -9,7 +9,7 @@ interface BasePeerId {
|
|
|
9
9
|
toString(): string;
|
|
10
10
|
toCID(): CID;
|
|
11
11
|
toBytes(): Uint8Array;
|
|
12
|
-
equals(other
|
|
12
|
+
equals(other?: PeerId | Uint8Array | string): boolean;
|
|
13
13
|
}
|
|
14
14
|
export interface RSAPeerId extends BasePeerId {
|
|
15
15
|
readonly type: 'RSA';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/peer-id/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAA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,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAA;IACpB,QAAQ,CAAC,SAAS,CAAC,EAAE,UAAU,CAAA;CAChC;AAED,MAAM,WAAW,aAAc,SAAQ,UAAU;IAC/C,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;IACxB,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAA;CAC/B;AAED,MAAM,WAAW,eAAgB,SAAQ,UAAU;IACjD,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAA;IAC1B,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAA;CAC/B;AAED,MAAM,MAAM,MAAM,GAAG,SAAS,GAAG,aAAa,GAAG,eAAe,CAAA;AAEhE,eAAO,MAAM,YAAY,eAAgC,CAAA;AAEzD,wBAAgB,QAAQ,CAAE,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,MAAM,CAErD"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
{
|
|
2
|
+
"Connection": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.connection.Connection.html",
|
|
3
|
+
"ConnectionProtector": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.connection.ConnectionProtector.html",
|
|
4
|
+
"ConnectionTimeline": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.connection.ConnectionTimeline.html",
|
|
5
|
+
"MultiaddrConnection": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.connection.MultiaddrConnection.html",
|
|
6
|
+
"MultiaddrConnectionTimeline": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.connection.MultiaddrConnectionTimeline.html",
|
|
7
|
+
"NewStreamOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.connection.NewStreamOptions.html",
|
|
8
|
+
"Stream": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.connection.Stream.html",
|
|
9
|
+
"StreamTimeline": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.connection.StreamTimeline.html",
|
|
10
|
+
"ConnectionStatus": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.connection.ConnectionStatus.html",
|
|
11
|
+
"Direction": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.connection.Direction.html",
|
|
12
|
+
"ReadStatus": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.connection.ReadStatus.html",
|
|
13
|
+
"StreamStatus": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.connection.StreamStatus.html",
|
|
14
|
+
"WriteStatus": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.connection.WriteStatus.html",
|
|
15
|
+
"connectionSymbol": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.connection.connectionSymbol.html",
|
|
16
|
+
"isConnection": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface.connection.isConnection.html",
|
|
17
|
+
"ConnectionEncrypter": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.connection_encrypter.ConnectionEncrypter.html",
|
|
18
|
+
"SecuredConnection": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.connection_encrypter.SecuredConnection.html",
|
|
19
|
+
"ConnectionGater": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.connection_gater.ConnectionGater.html",
|
|
20
|
+
"ContentRouting": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.content_routing.ContentRouting.html",
|
|
21
|
+
"ContentRoutingProvider": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.content_routing.ContentRoutingProvider.html",
|
|
22
|
+
"contentRoutingSymbol": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.content_routing.contentRoutingSymbol.html",
|
|
23
|
+
"AbortError": "https://libp2p.github.io/js-libp2p/classes/_libp2p_interface.errors.AbortError.html",
|
|
24
|
+
"CodeError": "https://libp2p.github.io/js-libp2p/classes/_libp2p_interface.errors.CodeError.html",
|
|
25
|
+
"InvalidCryptoExchangeError": "https://libp2p.github.io/js-libp2p/classes/_libp2p_interface.errors.InvalidCryptoExchangeError.html",
|
|
26
|
+
"InvalidCryptoTransmissionError": "https://libp2p.github.io/js-libp2p/classes/_libp2p_interface.errors.InvalidCryptoTransmissionError.html",
|
|
27
|
+
"UnexpectedPeerError": "https://libp2p.github.io/js-libp2p/classes/_libp2p_interface.errors.UnexpectedPeerError.html",
|
|
28
|
+
"ERR_INVALID_MESSAGE": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.errors.ERR_INVALID_MESSAGE.html",
|
|
29
|
+
"ERR_INVALID_PARAMETERS": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.errors.ERR_INVALID_PARAMETERS.html",
|
|
30
|
+
"ERR_NOT_FOUND": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.errors.ERR_NOT_FOUND.html",
|
|
31
|
+
"ERR_TIMEOUT": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.errors.ERR_TIMEOUT.html",
|
|
32
|
+
"setMaxListeners": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface.events.setMaxListeners.html",
|
|
33
|
+
"TypedEventEmitter": "https://libp2p.github.io/js-libp2p/classes/_libp2p_interface.index.TypedEventEmitter.html",
|
|
34
|
+
"AbortOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.AbortOptions.html",
|
|
35
|
+
".:AbortOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.AbortOptions.html",
|
|
36
|
+
"AddressSorter": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.AddressSorter.html",
|
|
37
|
+
".:AddressSorter": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.AddressSorter.html",
|
|
38
|
+
"ComponentLogger": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.ComponentLogger.html",
|
|
39
|
+
".:ComponentLogger": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.ComponentLogger.html",
|
|
40
|
+
"EventCallback": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.EventCallback.html",
|
|
41
|
+
"EventObject": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.EventObject.html",
|
|
42
|
+
"IdentifyResult": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.IdentifyResult.html",
|
|
43
|
+
".:IdentifyResult": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.IdentifyResult.html",
|
|
44
|
+
"Libp2p": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.Libp2p.html",
|
|
45
|
+
".:Libp2p": "https://libp2p.github.io/js-libp2p/interfaces/libp2p.Libp2p.html",
|
|
46
|
+
"Libp2pEvents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.Libp2pEvents.html",
|
|
47
|
+
".:Libp2pEvents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.Libp2pEvents.html",
|
|
48
|
+
"Logger": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.Logger.html",
|
|
49
|
+
".:Logger": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.Logger.html",
|
|
50
|
+
"LoggerOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.LoggerOptions.html",
|
|
51
|
+
".:LoggerOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.LoggerOptions.html",
|
|
52
|
+
"NodeInfo": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.NodeInfo.html",
|
|
53
|
+
".:NodeInfo": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.NodeInfo.html",
|
|
54
|
+
"PeerUpdate": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.PeerUpdate.html",
|
|
55
|
+
".:PeerUpdate": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.PeerUpdate.html",
|
|
56
|
+
"PendingDial": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.PendingDial.html",
|
|
57
|
+
".:PendingDial": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.PendingDial.html",
|
|
58
|
+
"RoutingOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.RoutingOptions.html",
|
|
59
|
+
".:RoutingOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.RoutingOptions.html",
|
|
60
|
+
"SignedPeerRecord": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.SignedPeerRecord.html",
|
|
61
|
+
".:SignedPeerRecord": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.SignedPeerRecord.html",
|
|
62
|
+
"Topology": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.Topology.html",
|
|
63
|
+
"TypedEventTarget": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.index.TypedEventTarget.html",
|
|
64
|
+
"EventHandler": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.index.EventHandler.html",
|
|
65
|
+
"Libp2pStatus": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.index.Libp2pStatus.html",
|
|
66
|
+
".:Libp2pStatus": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.index.Libp2pStatus.html",
|
|
67
|
+
"PendingDialStatus": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.index.PendingDialStatus.html",
|
|
68
|
+
".:PendingDialStatus": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.index.PendingDialStatus.html",
|
|
69
|
+
"RecursivePartial": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.index.RecursivePartial.html",
|
|
70
|
+
".:RecursivePartial": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.index.RecursivePartial.html",
|
|
71
|
+
"ServiceMap": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.index.ServiceMap.html",
|
|
72
|
+
".:ServiceMap": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.index.ServiceMap.html",
|
|
73
|
+
"CustomEvent": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.index.CustomEvent.html",
|
|
74
|
+
"PrivateKey": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.keys.PrivateKey.html",
|
|
75
|
+
"PublicKey": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.keys.PublicKey.html",
|
|
76
|
+
"KeyType": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.keys.KeyType.html",
|
|
77
|
+
"Ed25519": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.keys.Ed25519.html",
|
|
78
|
+
"RSA": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.keys.RSA.html",
|
|
79
|
+
"secp256k1": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.keys.secp256k1.html",
|
|
80
|
+
"CalculatedMetricOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.metrics.CalculatedMetricOptions.html",
|
|
81
|
+
"Counter": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.metrics.Counter.html",
|
|
82
|
+
"CounterGroup": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.metrics.CounterGroup.html",
|
|
83
|
+
"Metric": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.metrics.Metric.html",
|
|
84
|
+
"MetricGroup": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.metrics.MetricGroup.html",
|
|
85
|
+
"MetricOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.metrics.MetricOptions.html",
|
|
86
|
+
"Metrics": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.metrics.Metrics.html",
|
|
87
|
+
"StopTimer": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.metrics.StopTimer.html",
|
|
88
|
+
"CalculateMetric": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.metrics.CalculateMetric.html",
|
|
89
|
+
"PeerDiscovery": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_discovery.PeerDiscovery.html",
|
|
90
|
+
"PeerDiscoveryEvents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_discovery.PeerDiscoveryEvents.html",
|
|
91
|
+
"PeerDiscoveryProvider": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_discovery.PeerDiscoveryProvider.html",
|
|
92
|
+
"peerDiscoverySymbol": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.peer_discovery.peerDiscoverySymbol.html",
|
|
93
|
+
"Ed25519PeerId": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_id.Ed25519PeerId.html",
|
|
94
|
+
"RSAPeerId": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_id.RSAPeerId.html",
|
|
95
|
+
"Secp256k1PeerId": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_id.Secp256k1PeerId.html",
|
|
96
|
+
"PeerId": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.peer_id.PeerId.html",
|
|
97
|
+
"PeerIdType": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.peer_id.PeerIdType.html",
|
|
98
|
+
"peerIdSymbol": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.peer_id.peerIdSymbol.html",
|
|
99
|
+
"isPeerId": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface.peer_id.isPeerId.html",
|
|
100
|
+
"PeerInfo": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_info.PeerInfo.html",
|
|
101
|
+
"PeerRouting": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_routing.PeerRouting.html",
|
|
102
|
+
"PeerRoutingProvider": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_routing.PeerRoutingProvider.html",
|
|
103
|
+
"peerRoutingSymbol": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.peer_routing.peerRoutingSymbol.html",
|
|
104
|
+
"Address": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_store.Address.html",
|
|
105
|
+
"Peer": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_store.Peer.html",
|
|
106
|
+
"PeerData": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_store.PeerData.html",
|
|
107
|
+
"PeerQuery": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_store.PeerQuery.html",
|
|
108
|
+
"PeerQueryFilter": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_store.PeerQueryFilter.html",
|
|
109
|
+
"PeerQueryOrder": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_store.PeerQueryOrder.html",
|
|
110
|
+
"PeerStore": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_store.PeerStore.html",
|
|
111
|
+
"Tag": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_store.Tag.html",
|
|
112
|
+
"TagOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.peer_store.TagOptions.html",
|
|
113
|
+
"KEEP_ALIVE": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.peer_store_tags.KEEP_ALIVE.html",
|
|
114
|
+
"TopicValidatorResult": "https://libp2p.github.io/js-libp2p/enums/_libp2p_interface.pubsub.TopicValidatorResult.html",
|
|
115
|
+
"PeerStreamEvents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.PeerStreamEvents.html",
|
|
116
|
+
"PeerStreams": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.PeerStreams.html",
|
|
117
|
+
"PubSub": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.PubSub.html",
|
|
118
|
+
"PubSubEvents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.PubSubEvents.html",
|
|
119
|
+
"PubSubInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.PubSubInit.html",
|
|
120
|
+
"PubSubRPC": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.PubSubRPC.html",
|
|
121
|
+
"PubSubRPCMessage": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.PubSubRPCMessage.html",
|
|
122
|
+
"PubSubRPCSubscription": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.PubSubRPCSubscription.html",
|
|
123
|
+
"PublishResult": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.PublishResult.html",
|
|
124
|
+
"SignedMessage": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.SignedMessage.html",
|
|
125
|
+
"SubscriptionChangeData": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.SubscriptionChangeData.html",
|
|
126
|
+
"TopicValidatorFn": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.TopicValidatorFn.html",
|
|
127
|
+
"UnsignedMessage": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.pubsub.UnsignedMessage.html",
|
|
128
|
+
"Message": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.pubsub.Message.html",
|
|
129
|
+
"SignaturePolicy": "https://libp2p.github.io/js-libp2p/types/_libp2p_interface.pubsub.SignaturePolicy.html",
|
|
130
|
+
"StrictNoSign": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.pubsub.StrictNoSign.html",
|
|
131
|
+
"StrictSign": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.pubsub.StrictSign.html",
|
|
132
|
+
"Envelope": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.record.Envelope.html",
|
|
133
|
+
"Record": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.record.Record.html",
|
|
134
|
+
"Startable": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.startable.Startable.html",
|
|
135
|
+
"isStartable": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface.startable.isStartable.html",
|
|
136
|
+
"start": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface.startable.start.html",
|
|
137
|
+
"stop": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface.startable.stop.html",
|
|
138
|
+
"IncomingStreamData": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.stream_handler.IncomingStreamData.html",
|
|
139
|
+
"StreamHandler": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.stream_handler.StreamHandler.html",
|
|
140
|
+
"StreamHandlerOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.stream_handler.StreamHandlerOptions.html",
|
|
141
|
+
"StreamHandlerRecord": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.stream_handler.StreamHandlerRecord.html",
|
|
142
|
+
"StreamMuxer": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.stream_muxer.StreamMuxer.html",
|
|
143
|
+
"StreamMuxerFactory": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.stream_muxer.StreamMuxerFactory.html",
|
|
144
|
+
"StreamMuxerInit": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.stream_muxer.StreamMuxerInit.html",
|
|
145
|
+
"FaultTolerance": "https://libp2p.github.io/js-libp2p/enums/_libp2p_interface.transport.FaultTolerance.html",
|
|
146
|
+
"ConnectionHandler": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.transport.ConnectionHandler.html",
|
|
147
|
+
"CreateListenerOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.transport.CreateListenerOptions.html",
|
|
148
|
+
"DialOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.transport.DialOptions.html",
|
|
149
|
+
"Listener": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.transport.Listener.html",
|
|
150
|
+
"ListenerEvents": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.transport.ListenerEvents.html",
|
|
151
|
+
"MultiaddrFilter": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.transport.MultiaddrFilter.html",
|
|
152
|
+
"Transport": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.transport.Transport.html",
|
|
153
|
+
"Upgrader": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.transport.Upgrader.html",
|
|
154
|
+
"UpgraderOptions": "https://libp2p.github.io/js-libp2p/interfaces/_libp2p_interface.transport.UpgraderOptions.html",
|
|
155
|
+
"transportSymbol": "https://libp2p.github.io/js-libp2p/variables/_libp2p_interface.transport.transportSymbol.html",
|
|
156
|
+
"isTransport": "https://libp2p.github.io/js-libp2p/functions/_libp2p_interface.transport.isTransport.html"
|
|
157
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libp2p/interface",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "The interface implemented by a libp2p node",
|
|
5
5
|
"license": "Apache-2.0 OR MIT",
|
|
6
6
|
"homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/interface#readme",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"@multiformats/multiaddr": "^12.1.10",
|
|
67
67
|
"it-pushable": "^3.2.1",
|
|
68
68
|
"it-stream-types": "^2.0.1",
|
|
69
|
-
"multiformats": "^
|
|
69
|
+
"multiformats": "^13.0.0",
|
|
70
70
|
"progress-events": "^1.0.0",
|
|
71
71
|
"uint8arraylist": "^2.4.3"
|
|
72
72
|
},
|
package/src/connection/index.ts
CHANGED
|
@@ -187,8 +187,37 @@ export interface NewStreamOptions extends AbortOptions {
|
|
|
187
187
|
/**
|
|
188
188
|
* Opt-in to running over a transient connection - one that has time/data limits
|
|
189
189
|
* placed on it.
|
|
190
|
+
*
|
|
191
|
+
* @default false
|
|
190
192
|
*/
|
|
191
193
|
runOnTransientConnection?: boolean
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* By default when negotiating a protocol the dialer writes then protocol name
|
|
197
|
+
* then reads the response.
|
|
198
|
+
*
|
|
199
|
+
* When a only a single protocol is being negotiated on an outbound stream,
|
|
200
|
+
* and the stream is written to before being read from, we can optimistically
|
|
201
|
+
* write the protocol name and the first chunk of data together in the first
|
|
202
|
+
* message.
|
|
203
|
+
*
|
|
204
|
+
* Reading and handling the protocol response is done asynchronously, which
|
|
205
|
+
* means we can skip a round trip on writing to newly opened streams which
|
|
206
|
+
* significantly reduces the time-to-first-byte on a stream.
|
|
207
|
+
*
|
|
208
|
+
* The side-effect of this is that the underlying stream won't negotiate the
|
|
209
|
+
* protocol until either data is written to or read from the stream so it will
|
|
210
|
+
* not be opened on the remote until this is done.
|
|
211
|
+
*
|
|
212
|
+
* Pass `false` here to optimistically write the protocol name and first chunk
|
|
213
|
+
* of data in the first message.
|
|
214
|
+
*
|
|
215
|
+
* If multiple protocols are being negotiated, negotiation is always completed
|
|
216
|
+
* in full before the stream is returned so this option has no effect.
|
|
217
|
+
*
|
|
218
|
+
* @default true
|
|
219
|
+
*/
|
|
220
|
+
negotiateFully?: boolean
|
|
192
221
|
}
|
|
193
222
|
|
|
194
223
|
export type ConnectionStatus = 'open' | 'closing' | 'closed'
|
package/src/peer-id/index.ts
CHANGED