libp2p 2.8.6 → 2.8.7-776cb432d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -0
- package/dist/index.min.js +9 -9
- package/dist/index.min.js.map +4 -4
- package/dist/src/address-manager/ip-mappings.d.ts.map +1 -1
- package/dist/src/address-manager/ip-mappings.js +0 -1
- package/dist/src/address-manager/ip-mappings.js.map +1 -1
- package/dist/src/components.d.ts +1 -1
- package/dist/src/components.d.ts.map +1 -1
- package/dist/src/components.js +1 -2
- package/dist/src/components.js.map +1 -1
- package/dist/src/config.js +2 -2
- package/dist/src/config.js.map +1 -1
- package/dist/src/connection-manager/index.d.ts +1 -1
- package/dist/src/connection-manager/index.d.ts.map +1 -1
- package/dist/src/connection-manager/index.js.map +1 -1
- package/dist/src/connection-manager/utils.d.ts +1 -1
- package/dist/src/connection-manager/utils.d.ts.map +1 -1
- package/dist/src/connection-manager/utils.js.map +1 -1
- package/dist/src/libp2p.d.ts +1 -1
- package/dist/src/libp2p.d.ts.map +1 -1
- package/dist/src/libp2p.js.map +1 -1
- package/dist/src/random-walk.d.ts.map +1 -1
- package/dist/src/random-walk.js +1 -1
- package/dist/src/random-walk.js.map +1 -1
- package/dist/src/registrar.js +2 -2
- package/dist/src/registrar.js.map +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.d.ts.map +1 -1
- package/dist/src/version.js +1 -1
- package/dist/src/version.js.map +1 -1
- package/package.json +24 -37
- package/src/address-manager/ip-mappings.ts +0 -1
- package/src/components.ts +2 -2
- package/src/config.ts +2 -2
- package/src/connection-manager/index.ts +2 -1
- package/src/connection-manager/utils.ts +2 -1
- package/src/libp2p.ts +2 -1
- package/src/random-walk.ts +2 -1
- package/src/registrar.ts +2 -2
- package/src/version.ts +1 -1
- package/dist/typedoc-urls.json +0 -21
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ConnectionClosedError, InvalidMultiaddrError, InvalidParametersError, InvalidPeerIdError, NotStartedError, start, stop } from '@libp2p/interface'
|
|
2
2
|
import { PeerMap } from '@libp2p/peer-collections'
|
|
3
3
|
import { RateLimiter } from '@libp2p/utils/rate-limiter'
|
|
4
|
-
import {
|
|
4
|
+
import { multiaddr } from '@multiformats/multiaddr'
|
|
5
5
|
import { dnsaddrResolver } from '@multiformats/multiaddr/resolvers'
|
|
6
6
|
import { CustomProgressEvent } from 'progress-events'
|
|
7
7
|
import { getPeerAddress } from '../get-peer.js'
|
|
@@ -14,6 +14,7 @@ import type { IpNet } from '@chainsafe/netmask'
|
|
|
14
14
|
import type { PendingDial, AddressSorter, Libp2pEvents, AbortOptions, ComponentLogger, Logger, Connection, MultiaddrConnection, ConnectionGater, TypedEventTarget, Metrics, PeerId, PeerStore, Startable, PendingDialStatus, PeerRouting, IsDialableOptions } from '@libp2p/interface'
|
|
15
15
|
import type { ConnectionManager, OpenConnectionOptions, TransportManager } from '@libp2p/interface-internal'
|
|
16
16
|
import type { JobStatus } from '@libp2p/utils/queue'
|
|
17
|
+
import type { Multiaddr, Resolver } from '@multiformats/multiaddr'
|
|
17
18
|
|
|
18
19
|
export const DEFAULT_DIAL_PRIORITY = 50
|
|
19
20
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { multiaddr, resolvers
|
|
1
|
+
import { multiaddr, resolvers } from '@multiformats/multiaddr'
|
|
2
2
|
import { convertToIpNet } from '@multiformats/multiaddr/convert'
|
|
3
3
|
import type { IpNet } from '@chainsafe/netmask'
|
|
4
4
|
import type { LoggerOptions } from '@libp2p/interface'
|
|
5
|
+
import type { Multiaddr, ResolveOptions } from '@multiformats/multiaddr'
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Recursively resolve DNSADDR multiaddrs
|
package/src/libp2p.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { defaultLogger } from '@libp2p/logger'
|
|
|
4
4
|
import { PeerSet } from '@libp2p/peer-collections'
|
|
5
5
|
import { peerIdFromString } from '@libp2p/peer-id'
|
|
6
6
|
import { persistentPeerStore } from '@libp2p/peer-store'
|
|
7
|
-
import { isMultiaddr
|
|
7
|
+
import { isMultiaddr } from '@multiformats/multiaddr'
|
|
8
8
|
import { MemoryDatastore } from 'datastore-core/memory'
|
|
9
9
|
import { concat as uint8ArrayConcat } from 'uint8arrays/concat'
|
|
10
10
|
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
|
|
@@ -24,6 +24,7 @@ import * as pkg from './version.js'
|
|
|
24
24
|
import type { Components } from './components.js'
|
|
25
25
|
import type { Libp2p as Libp2pInterface, Libp2pInit } from './index.js'
|
|
26
26
|
import type { PeerRouting, ContentRouting, Libp2pEvents, PendingDial, ServiceMap, AbortOptions, ComponentLogger, Logger, Connection, NewStreamOptions, Stream, Metrics, PeerId, PeerInfo, PeerStore, Topology, Libp2pStatus, IsDialableOptions, DialOptions, PublicKey, Ed25519PeerId, Secp256k1PeerId, RSAPublicKey, RSAPeerId, URLPeerId, Ed25519PublicKey, Secp256k1PublicKey, StreamHandler, StreamHandlerOptions } from '@libp2p/interface'
|
|
27
|
+
import type { Multiaddr } from '@multiformats/multiaddr'
|
|
27
28
|
|
|
28
29
|
export class Libp2p<T extends ServiceMap = ServiceMap> extends TypedEventEmitter<Libp2pEvents> implements Libp2pInterface<T> {
|
|
29
30
|
public peerId: PeerId
|
package/src/random-walk.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { randomBytes } from '@libp2p/crypto'
|
|
2
2
|
import { TypedEventEmitter, setMaxListeners } from '@libp2p/interface'
|
|
3
3
|
import { anySignal } from 'any-signal'
|
|
4
|
-
import pDefer
|
|
4
|
+
import pDefer from 'p-defer'
|
|
5
5
|
import { raceEvent } from 'race-event'
|
|
6
6
|
import { raceSignal } from 'race-signal'
|
|
7
7
|
import type { AbortOptions, ComponentLogger, Logger, PeerInfo, PeerRouting, Startable } from '@libp2p/interface'
|
|
8
8
|
import type { RandomWalk as RandomWalkInterface } from '@libp2p/interface-internal'
|
|
9
|
+
import type { DeferredPromise } from 'p-defer'
|
|
9
10
|
|
|
10
11
|
export interface RandomWalkComponents {
|
|
11
12
|
peerRouting: PeerRouting
|
package/src/registrar.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InvalidParametersError } from '@libp2p/interface'
|
|
2
|
-
import
|
|
2
|
+
import { mergeOptions } from '@libp2p/utils/merge-options'
|
|
3
3
|
import * as errorsJs from './errors.js'
|
|
4
4
|
import type { IdentifyResult, Libp2pEvents, Logger, PeerUpdate, TypedEventTarget, PeerId, PeerStore, Topology, StreamHandler, StreamHandlerRecord, StreamHandlerOptions } from '@libp2p/interface'
|
|
5
5
|
import type { Registrar as RegistrarInterface } from '@libp2p/interface-internal'
|
|
@@ -77,7 +77,7 @@ export class Registrar implements RegistrarInterface {
|
|
|
77
77
|
throw new errorsJs.DuplicateProtocolHandlerError(`Handler already registered for protocol ${protocol}`)
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
const options =
|
|
80
|
+
const options = mergeOptions.bind({ ignoreUndefined: true })({
|
|
81
81
|
maxInboundStreams: DEFAULT_MAX_INBOUND_STREAMS,
|
|
82
82
|
maxOutboundStreams: DEFAULT_MAX_OUTBOUND_STREAMS
|
|
83
83
|
}, opts)
|
package/src/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const version = '2.8.
|
|
1
|
+
export const version = '2.8.7-776cb432d'
|
|
2
2
|
export const name = 'js-libp2p'
|
package/dist/typedoc-urls.json
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"AddressFilter": "https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.AddressFilter.html",
|
|
3
|
-
"AddressManagerInit": "https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.AddressManagerInit.html",
|
|
4
|
-
"ConnectionManagerInit": "https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.ConnectionManagerInit.html",
|
|
5
|
-
"ConnectionMonitorInit": "https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.ConnectionMonitorInit.html",
|
|
6
|
-
"Libp2pInit": "https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.Libp2pInit.html",
|
|
7
|
-
".:Libp2pInit": "https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.Libp2pInit.html",
|
|
8
|
-
"TransportManagerInit": "https://libp2p.github.io/js-libp2p/interfaces/libp2p.index.TransportManagerInit.html",
|
|
9
|
-
"Libp2pOptions": "https://libp2p.github.io/js-libp2p/types/libp2p.index.Libp2pOptions.html",
|
|
10
|
-
".:Libp2pOptions": "https://libp2p.github.io/js-libp2p/types/libp2p.index.Libp2pOptions.html",
|
|
11
|
-
"ServiceFactoryMap": "https://libp2p.github.io/js-libp2p/types/libp2p.index.ServiceFactoryMap.html",
|
|
12
|
-
".:ServiceFactoryMap": "https://libp2p.github.io/js-libp2p/types/libp2p.index.ServiceFactoryMap.html",
|
|
13
|
-
"createLibp2p": "https://libp2p.github.io/js-libp2p/functions/libp2p.index.createLibp2p.html",
|
|
14
|
-
".:createLibp2p": "https://libp2p.github.io/js-libp2p/functions/libp2p.index.createLibp2p.html",
|
|
15
|
-
"userAgent": "https://libp2p.github.io/js-libp2p/functions/libp2p.user_agent.userAgent.html",
|
|
16
|
-
"./user-agent:userAgent": "https://libp2p.github.io/js-libp2p/functions/libp2p.user_agent.userAgent.html",
|
|
17
|
-
"name": "https://libp2p.github.io/js-libp2p/variables/libp2p.version.name.html",
|
|
18
|
-
"./version:name": "https://libp2p.github.io/js-libp2p/variables/libp2p.version.name.html",
|
|
19
|
-
"version": "https://libp2p.github.io/js-libp2p/variables/libp2p.version.version.html",
|
|
20
|
-
"./version:version": "https://libp2p.github.io/js-libp2p/variables/libp2p.version.version.html"
|
|
21
|
-
}
|