mirror of https://github.com/waku-org/js-waku.git
Merge pull request #1789 from waku-org/chore/bump-libp2p-packages
chore: bump all libp2p packages to latest version
This commit is contained in:
commit
a859243b76
File diff suppressed because it is too large
Load Diff
|
@ -72,6 +72,7 @@
|
|||
"node": ">=18"
|
||||
},
|
||||
"dependencies": {
|
||||
"@libp2p/ping": "^1.0.9",
|
||||
"@noble/hashes": "^1.3.2",
|
||||
"@waku/enr": "^0.0.20",
|
||||
"@waku/interfaces": "0.0.21",
|
||||
|
@ -107,7 +108,7 @@
|
|||
},
|
||||
"peerDependencies": {
|
||||
"@multiformats/multiaddr": "^12.0.0",
|
||||
"libp2p": "^0.46.3"
|
||||
"libp2p": "^1.1.2"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"@multiformats/multiaddr": {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import type { Libp2p } from "@libp2p/interface";
|
||||
import type { Stream } from "@libp2p/interface/connection";
|
||||
import { Peer, PeerStore } from "@libp2p/interface/peer-store";
|
||||
import type { Peer, PeerStore, Stream } from "@libp2p/interface";
|
||||
import type {
|
||||
IBaseProtocol,
|
||||
Libp2pComponents,
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
import type { PeerId } from "@libp2p/interface/peer-id";
|
||||
import type { PeerInfo } from "@libp2p/interface/peer-info";
|
||||
import type { Peer } from "@libp2p/interface/peer-store";
|
||||
import type { PeerStore } from "@libp2p/interface/peer-store";
|
||||
import { CustomEvent, EventEmitter } from "@libp2p/interfaces/events";
|
||||
import type { Peer, PeerId, PeerInfo, PeerStore } from "@libp2p/interface";
|
||||
import { CustomEvent, TypedEventEmitter } from "@libp2p/interface";
|
||||
import { decodeRelayShard } from "@waku/enr";
|
||||
import {
|
||||
ConnectionManagerOptions,
|
||||
|
@ -30,7 +27,7 @@ export const DEFAULT_MAX_DIAL_ATTEMPTS_FOR_PEER = 3;
|
|||
export const DEFAULT_MAX_PARALLEL_DIALS = 3;
|
||||
|
||||
export class ConnectionManager
|
||||
extends EventEmitter<IPeersByDiscoveryEvents & IConnectionStateEvents>
|
||||
extends TypedEventEmitter<IPeersByDiscoveryEvents & IConnectionStateEvents>
|
||||
implements IConnectionManager
|
||||
{
|
||||
private static instances = new Map<string, ConnectionManager>();
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { Stream } from "@libp2p/interface/connection";
|
||||
import type { Peer } from "@libp2p/interface/peer-store";
|
||||
import type { IncomingStreamData } from "@libp2p/interface-internal/registrar";
|
||||
import { Stream } from "@libp2p/interface";
|
||||
import type { Peer } from "@libp2p/interface";
|
||||
import type { IncomingStreamData } from "@libp2p/interface-internal";
|
||||
import type {
|
||||
Callback,
|
||||
ContentTopic,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Peer } from "@libp2p/interface/peer-store";
|
||||
import type { Tag } from "@libp2p/interface/peer-store";
|
||||
import { Peer } from "@libp2p/interface";
|
||||
import type { Tag } from "@libp2p/interface";
|
||||
import { createSecp256k1PeerId } from "@libp2p/peer-id-factory";
|
||||
import { Tags } from "@waku/interfaces";
|
||||
import { expect } from "chai";
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Peer } from "@libp2p/interface/peer-store";
|
||||
import { Peer } from "@libp2p/interface";
|
||||
import { Tags } from "@waku/interfaces";
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
import type { PeerId } from "@libp2p/interface/peer-id";
|
||||
import type { PeerStore } from "@libp2p/interface/peer-store";
|
||||
import type { PeerId, PeerStore } from "@libp2p/interface";
|
||||
import type { PingService } from "@libp2p/ping";
|
||||
import type { IRelay, PeerIdStr } from "@waku/interfaces";
|
||||
import type { KeepAliveOptions } from "@waku/interfaces";
|
||||
import { Logger, pubsubTopicToSingleShardInfo } from "@waku/utils";
|
||||
import { utf8ToBytes } from "@waku/utils/bytes";
|
||||
import type { PingService } from "libp2p/ping";
|
||||
|
||||
import { createEncoder } from "./message/version_0.js";
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { Stream } from "@libp2p/interface/connection";
|
||||
import type { PeerId } from "@libp2p/interface/peer-id";
|
||||
import type { PeerId, Stream } from "@libp2p/interface";
|
||||
import {
|
||||
IEncoder,
|
||||
ILightPush,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import type { PeerId } from "@libp2p/interface/peer-id";
|
||||
import { IncomingStreamData } from "@libp2p/interface/stream-handler";
|
||||
import type { PeerId } from "@libp2p/interface";
|
||||
import { IncomingStreamData } from "@libp2p/interface";
|
||||
import { encodeRelayShard } from "@waku/enr";
|
||||
import type {
|
||||
IMetadata,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type { Stream } from "@libp2p/interface/connection";
|
||||
import type { Stream } from "@libp2p/interface";
|
||||
import { sha256 } from "@noble/hashes/sha256";
|
||||
import {
|
||||
Cursor,
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import type { PeerUpdate } from "@libp2p/interface";
|
||||
import type { Stream } from "@libp2p/interface/connection";
|
||||
import { Peer } from "@libp2p/interface/peer-store";
|
||||
import type { PeerUpdate, Stream } from "@libp2p/interface";
|
||||
import { Peer } from "@libp2p/interface";
|
||||
import { Libp2p } from "@waku/interfaces";
|
||||
import { Logger } from "@waku/utils";
|
||||
import { selectConnection } from "@waku/utils/libp2p";
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import type { Stream } from "@libp2p/interface/connection";
|
||||
import { isPeerId, PeerId } from "@libp2p/interface/peer-id";
|
||||
import type { Stream } from "@libp2p/interface";
|
||||
import { isPeerId, PeerId } from "@libp2p/interface";
|
||||
import { multiaddr, Multiaddr, MultiaddrInput } from "@multiformats/multiaddr";
|
||||
import type {
|
||||
IFilter,
|
||||
|
@ -185,7 +185,7 @@ export class WakuNode implements Waku {
|
|||
}
|
||||
|
||||
isStarted(): boolean {
|
||||
return this.libp2p.isStarted();
|
||||
return this.libp2p.status == "started";
|
||||
}
|
||||
|
||||
isConnected(): boolean {
|
||||
|
|
|
@ -59,8 +59,8 @@
|
|||
"uint8arrays": "^4.0.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@libp2p/peer-id": "^3.0.3",
|
||||
"@libp2p/peer-id-factory": "^3.0.3",
|
||||
"@libp2p/peer-id": "^4.0.4",
|
||||
"@libp2p/peer-id-factory": "^4.0.4",
|
||||
"@multiformats/multiaddr": "^12.0.0",
|
||||
"@rollup/plugin-commonjs": "^25.0.7",
|
||||
"@rollup/plugin-json": "^6.0.0",
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
import { CustomEvent, EventEmitter } from "@libp2p/interface/events";
|
||||
import type {
|
||||
import {
|
||||
CustomEvent,
|
||||
PeerDiscovery,
|
||||
PeerDiscoveryEvents
|
||||
} from "@libp2p/interface/peer-discovery";
|
||||
import { peerDiscovery as symbol } from "@libp2p/interface/peer-discovery";
|
||||
import type { PeerInfo } from "@libp2p/interface/peer-info";
|
||||
PeerDiscoveryEvents,
|
||||
TypedEventEmitter
|
||||
} from "@libp2p/interface";
|
||||
import { peerDiscoverySymbol as symbol } from "@libp2p/interface";
|
||||
import type { PeerInfo } from "@libp2p/interface";
|
||||
import { encodeRelayShard } from "@waku/enr";
|
||||
import type {
|
||||
DnsDiscOptions,
|
||||
|
@ -28,7 +29,7 @@ const log = new Logger("peer-discovery-dns");
|
|||
* Parse options and expose function to return bootstrap peer addresses.
|
||||
*/
|
||||
export class PeerDiscoveryDns
|
||||
extends EventEmitter<PeerDiscoveryEvents>
|
||||
extends TypedEventEmitter<PeerDiscoveryEvents>
|
||||
implements PeerDiscovery
|
||||
{
|
||||
private nextPeer: (() => AsyncGenerator<IEnr>) | undefined;
|
||||
|
|
|
@ -52,8 +52,8 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@ethersproject/rlp": "^5.7.0",
|
||||
"@libp2p/crypto": "^3.0.2",
|
||||
"@libp2p/peer-id": "^3.0.3",
|
||||
"@libp2p/crypto": "^4.0.0",
|
||||
"@libp2p/peer-id": "^4.0.4",
|
||||
"@multiformats/multiaddr": "^12.0.0",
|
||||
"@noble/secp256k1": "^1.7.1",
|
||||
"@waku/utils": "0.0.14",
|
||||
|
@ -61,7 +61,7 @@
|
|||
"js-sha3": "^0.9.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@libp2p/peer-id-factory": "^3.0.3",
|
||||
"@libp2p/peer-id-factory": "^4.0.4",
|
||||
"@rollup/plugin-commonjs": "^25.0.7",
|
||||
"@rollup/plugin-json": "^6.0.0",
|
||||
"@rollup/plugin-node-resolve": "^15.2.3",
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type { PeerId } from "@libp2p/interface/peer-id";
|
||||
import type { PeerId } from "@libp2p/interface";
|
||||
import type { ENRKey, ENRValue } from "@waku/interfaces";
|
||||
import { utf8ToBytes } from "@waku/utils/bytes";
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type { PeerId } from "@libp2p/interface/peer-id";
|
||||
import type { PeerId } from "@libp2p/interface";
|
||||
import { createSecp256k1PeerId } from "@libp2p/peer-id-factory";
|
||||
import { multiaddr } from "@multiformats/multiaddr";
|
||||
import * as secp from "@noble/secp256k1";
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { PeerId } from "@libp2p/interface/peer-id";
|
||||
import type { PeerInfo } from "@libp2p/interface/peer-info";
|
||||
import type { PeerId, PeerInfo } from "@libp2p/interface";
|
||||
import type { Multiaddr } from "@multiformats/multiaddr";
|
||||
import type {
|
||||
ENRKey,
|
||||
|
@ -116,8 +115,7 @@ export class ENR extends RawEnr implements IEnr {
|
|||
if (!id) return;
|
||||
return {
|
||||
id,
|
||||
multiaddrs: this.getAllLocationMultiaddrs(),
|
||||
protocols: []
|
||||
multiaddrs: this.getAllLocationMultiaddrs()
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { unmarshalPrivateKey, unmarshalPublicKey } from "@libp2p/crypto/keys";
|
||||
import { supportedKeys } from "@libp2p/crypto/keys";
|
||||
import type { PeerId } from "@libp2p/interface/peer-id";
|
||||
import type { PeerId } from "@libp2p/interface";
|
||||
import { peerIdFromKeys } from "@libp2p/peer-id";
|
||||
|
||||
export function createPeerIdFromPublicKey(
|
||||
|
|
|
@ -47,11 +47,11 @@
|
|||
"node": ">=18"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@chainsafe/libp2p-gossipsub": "^10.1.1",
|
||||
"@chainsafe/libp2p-gossipsub": "^11.0.1",
|
||||
"@multiformats/multiaddr": "^12.0.0",
|
||||
"cspell": "^7.3.2",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"libp2p": "^0.46.14"
|
||||
"libp2p": "^1.1.2"
|
||||
},
|
||||
"files": [
|
||||
"dist",
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
import type { PeerId } from "@libp2p/interface/peer-id";
|
||||
import type { Peer } from "@libp2p/interface/peer-store";
|
||||
import type { EventEmitter } from "@libp2p/interfaces/events";
|
||||
import type { Peer, PeerId, TypedEventEmitter } from "@libp2p/interface";
|
||||
|
||||
export enum Tags {
|
||||
BOOTSTRAP = "bootstrap",
|
||||
|
@ -59,7 +57,7 @@ export interface IConnectionStateEvents {
|
|||
}
|
||||
|
||||
export interface IConnectionManager
|
||||
extends EventEmitter<IPeersByDiscoveryEvents & IConnectionStateEvents> {
|
||||
extends TypedEventEmitter<IPeersByDiscoveryEvents & IConnectionStateEvents> {
|
||||
getPeersByDiscovery(): Promise<PeersByDiscoveryResult>;
|
||||
stop(): void;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { PeerStore } from "@libp2p/interface/peer-store";
|
||||
import { PeerStore } from "@libp2p/interface";
|
||||
|
||||
export type SearchContext = {
|
||||
domain: string;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import type { PeerId } from "@libp2p/interface/peer-id";
|
||||
import type { PeerInfo } from "@libp2p/interface/peer-info";
|
||||
import type { PeerId } from "@libp2p/interface";
|
||||
import type { PeerInfo } from "@libp2p/interface";
|
||||
import type { Multiaddr } from "@multiformats/multiaddr";
|
||||
|
||||
export type ENRKey = string;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type { PeerId } from "@libp2p/interface/peer-id";
|
||||
import type { PeerId } from "@libp2p/interface";
|
||||
|
||||
import type { IDecodedMessage, IDecoder, SingleShardInfo } from "./message.js";
|
||||
import type { ContentTopic, PubsubTopic } from "./misc.js";
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import type { GossipSub } from "@chainsafe/libp2p-gossipsub";
|
||||
import type { identify } from "@libp2p/identify";
|
||||
import type { Libp2p as BaseLibp2p } from "@libp2p/interface";
|
||||
import type { PingService } from "@libp2p/ping";
|
||||
import type { Libp2pInit, Libp2pOptions } from "libp2p";
|
||||
import type { identifyService } from "libp2p/identify";
|
||||
import type { PingService } from "libp2p/ping";
|
||||
|
||||
import { IMetadata } from "./metadata";
|
||||
|
||||
|
@ -10,7 +10,7 @@ export type Libp2pServices = {
|
|||
ping: PingService;
|
||||
metadata?: IMetadata;
|
||||
pubsub?: GossipSub;
|
||||
identify: ReturnType<ReturnType<typeof identifyService>>;
|
||||
identify: ReturnType<ReturnType<typeof identify>>;
|
||||
};
|
||||
|
||||
// TODO: Get libp2p to export this.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type { PeerId } from "@libp2p/interface/peer-id";
|
||||
import type { PeerId } from "@libp2p/interface";
|
||||
|
||||
import type { ShardInfo } from "./enr.js";
|
||||
import type { IBaseProtocol } from "./protocols.js";
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import type { PeerId } from "@libp2p/interface/peer-id";
|
||||
import type { PeerStore } from "@libp2p/interface/peer-store";
|
||||
import type { ConnectionManager } from "@libp2p/interface-internal/connection-manager";
|
||||
import type { PeerId } from "@libp2p/interface";
|
||||
import type { PeerStore } from "@libp2p/interface";
|
||||
import type { ConnectionManager } from "@libp2p/interface-internal";
|
||||
|
||||
import { IEnr } from "./enr.js";
|
||||
import { IBaseProtocol } from "./protocols.js";
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import type { Libp2p } from "@libp2p/interface";
|
||||
import type { PeerId } from "@libp2p/interface/peer-id";
|
||||
import type { Peer, PeerStore } from "@libp2p/interface/peer-store";
|
||||
import type { PeerId } from "@libp2p/interface";
|
||||
import type { Peer, PeerStore } from "@libp2p/interface";
|
||||
|
||||
import type { ShardInfo } from "./enr.js";
|
||||
import type { CreateLibp2pOptions } from "./libp2p.js";
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { Stream } from "@libp2p/interface/connection";
|
||||
import type { PeerId } from "@libp2p/interface/peer-id";
|
||||
import type { PeerId, Stream } from "@libp2p/interface";
|
||||
import type { Multiaddr } from "@multiformats/multiaddr";
|
||||
|
||||
import { IConnectionManager } from "./connection_manager.js";
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import type { IdentifyResult } from "@libp2p/interface";
|
||||
import { CustomEvent, EventEmitter } from "@libp2p/interface/events";
|
||||
import { CustomEvent, TypedEventEmitter } from "@libp2p/interface";
|
||||
import { peerDiscoverySymbol as symbol } from "@libp2p/interface";
|
||||
import type {
|
||||
IdentifyResult,
|
||||
PeerDiscovery,
|
||||
PeerDiscoveryEvents
|
||||
} from "@libp2p/interface/peer-discovery";
|
||||
import { peerDiscovery as symbol } from "@libp2p/interface/peer-discovery";
|
||||
import type { PeerId } from "@libp2p/interface/peer-id";
|
||||
import type { PeerInfo } from "@libp2p/interface/peer-info";
|
||||
PeerDiscoveryEvents,
|
||||
PeerId,
|
||||
PeerInfo
|
||||
} from "@libp2p/interface";
|
||||
import { encodeRelayShard } from "@waku/enr";
|
||||
import { Libp2pComponents, Tags } from "@waku/interfaces";
|
||||
import { Logger } from "@waku/utils";
|
||||
|
@ -51,7 +51,7 @@ const DEFAULT_PEER_EXCHANGE_TAG_VALUE = 50;
|
|||
const DEFAULT_PEER_EXCHANGE_TAG_TTL = 100_000_000;
|
||||
|
||||
export class PeerExchangeDiscovery
|
||||
extends EventEmitter<PeerDiscoveryEvents>
|
||||
extends TypedEventEmitter<PeerDiscoveryEvents>
|
||||
implements PeerDiscovery
|
||||
{
|
||||
private readonly components: Libp2pComponents;
|
||||
|
@ -206,7 +206,6 @@ export class PeerExchangeDiscovery
|
|||
new CustomEvent<PeerInfo>("peer", {
|
||||
detail: {
|
||||
id: peerId,
|
||||
protocols: [],
|
||||
multiaddrs: peerInfo.multiaddrs
|
||||
}
|
||||
})
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
"node": ">=18"
|
||||
},
|
||||
"dependencies": {
|
||||
"@chainsafe/libp2p-gossipsub": "^10.1.1",
|
||||
"@chainsafe/libp2p-gossipsub": "^11.0.1",
|
||||
"@noble/hashes": "^1.3.2",
|
||||
"@waku/core": "0.0.26",
|
||||
"@waku/interfaces": "0.0.21",
|
||||
|
|
|
@ -6,8 +6,7 @@ import {
|
|||
} from "@chainsafe/libp2p-gossipsub";
|
||||
import type { PeerIdStr, TopicStr } from "@chainsafe/libp2p-gossipsub/types";
|
||||
import { SignaturePolicy } from "@chainsafe/libp2p-gossipsub/types";
|
||||
import type { PeerId } from "@libp2p/interface/peer-id";
|
||||
import type { PubSub as Libp2pPubsub } from "@libp2p/interface/pubsub";
|
||||
import type { PubSub as Libp2pPubsub, PeerId } from "@libp2p/interface";
|
||||
import { sha256 } from "@noble/hashes/sha256";
|
||||
import {
|
||||
ActiveSubscriptions,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { TopicValidatorResult } from "@libp2p/interface/pubsub";
|
||||
import type { UnsignedMessage } from "@libp2p/interface/pubsub";
|
||||
import { TopicValidatorResult } from "@libp2p/interface";
|
||||
import type { UnsignedMessage } from "@libp2p/interface";
|
||||
import { createSecp256k1PeerId } from "@libp2p/peer-id-factory";
|
||||
import { createEncoder } from "@waku/core";
|
||||
import { expect } from "chai";
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import type { PeerId } from "@libp2p/interface/peer-id";
|
||||
import type { Message } from "@libp2p/interface/pubsub";
|
||||
import { TopicValidatorResult } from "@libp2p/interface/pubsub";
|
||||
import type { Message, PeerId } from "@libp2p/interface";
|
||||
import { TopicValidatorResult } from "@libp2p/interface";
|
||||
import { proto_message as proto } from "@waku/proto";
|
||||
import { Logger } from "@waku/utils";
|
||||
|
||||
|
|
|
@ -61,19 +61,21 @@
|
|||
"node": ">=18"
|
||||
},
|
||||
"dependencies": {
|
||||
"@chainsafe/libp2p-noise": "^13.0.4",
|
||||
"@libp2p/mplex": "^9.0.10",
|
||||
"@libp2p/websockets": "^7.0.5",
|
||||
"@waku/utils": "0.0.14",
|
||||
"@waku/relay": "0.0.9",
|
||||
"@chainsafe/libp2p-noise": "^14.1.0",
|
||||
"@libp2p/identify": "^1.0.10",
|
||||
"@libp2p/mplex": "^10.0.11",
|
||||
"@libp2p/ping": "^1.0.9",
|
||||
"@libp2p/websockets": "^8.0.11",
|
||||
"@waku/core": "0.0.26",
|
||||
"@waku/dns-discovery": "0.0.20",
|
||||
"@waku/interfaces": "0.0.21",
|
||||
"@waku/peer-exchange": "^0.0.19",
|
||||
"libp2p": "^0.46.14"
|
||||
"@waku/relay": "0.0.9",
|
||||
"@waku/utils": "0.0.14",
|
||||
"libp2p": "^1.1.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@chainsafe/libp2p-gossipsub": "^10.1.1",
|
||||
"@chainsafe/libp2p-gossipsub": "^11.0.1",
|
||||
"@rollup/plugin-commonjs": "^25.0.7",
|
||||
"@rollup/plugin-json": "^6.0.0",
|
||||
"@rollup/plugin-node-resolve": "^15.2.3",
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
import type { GossipSub } from "@chainsafe/libp2p-gossipsub";
|
||||
import { noise } from "@chainsafe/libp2p-noise";
|
||||
import type { PeerDiscovery } from "@libp2p/interface/peer-discovery";
|
||||
import { identify } from "@libp2p/identify";
|
||||
import type { PeerDiscovery } from "@libp2p/interface";
|
||||
import { mplex } from "@libp2p/mplex";
|
||||
import { ping } from "@libp2p/ping";
|
||||
import { webSockets } from "@libp2p/websockets";
|
||||
import { all as filterAll } from "@libp2p/websockets/filters";
|
||||
import {
|
||||
|
@ -27,8 +29,6 @@ import type {
|
|||
import { wakuPeerExchangeDiscovery } from "@waku/peer-exchange";
|
||||
import { RelayCreateOptions, wakuGossipSub, wakuRelay } from "@waku/relay";
|
||||
import { createLibp2p } from "libp2p";
|
||||
import { identifyService } from "libp2p/identify";
|
||||
import { pingService } from "libp2p/ping";
|
||||
|
||||
const DEFAULT_NODE_REQUIREMENTS = {
|
||||
lightPush: 1,
|
||||
|
@ -242,10 +242,10 @@ export async function defaultLibp2p(
|
|||
connectionEncryption: [noise()],
|
||||
...options,
|
||||
services: {
|
||||
identify: identifyService({
|
||||
identify: identify({
|
||||
agentVersion: userAgent ?? DefaultUserAgent
|
||||
}),
|
||||
ping: pingService(),
|
||||
ping: ping(),
|
||||
...metadataService,
|
||||
...pubsubService,
|
||||
...options?.services
|
||||
|
|
|
@ -50,8 +50,8 @@
|
|||
"node": ">=18"
|
||||
},
|
||||
"dependencies": {
|
||||
"@libp2p/interface-compliance-tests": "^4.1.0",
|
||||
"@libp2p/peer-id": "^3.0.3",
|
||||
"@libp2p/interface-compliance-tests": "^5.1.2",
|
||||
"@libp2p/peer-id": "^4.0.4",
|
||||
"@waku/core": "*",
|
||||
"@waku/enr": "*",
|
||||
"@waku/interfaces": "*",
|
||||
|
@ -68,7 +68,7 @@
|
|||
"tail": "^2.2.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@libp2p/bootstrap": "^9.0.10",
|
||||
"@libp2p/bootstrap": "^10.0.11",
|
||||
"@types/chai": "^4.3.11",
|
||||
"@types/dockerode": "^3.3.19",
|
||||
"@types/mocha": "^10.0.1",
|
||||
|
@ -85,7 +85,7 @@
|
|||
"datastore-core": "^9.2.7",
|
||||
"debug": "^4.3.4",
|
||||
"interface-datastore": "^8.2.10",
|
||||
"libp2p": "^0.46.14",
|
||||
"libp2p": "^1.1.2",
|
||||
"mocha": "^10.2.0",
|
||||
"mocha-multi-reporters": "^1.5.1",
|
||||
"npm-run-all": "^4.1.5"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type { PeerId } from "@libp2p/interface/peer-id";
|
||||
import type { PeerId } from "@libp2p/interface";
|
||||
import { peerIdFromString } from "@libp2p/peer-id";
|
||||
import { Multiaddr, multiaddr } from "@multiformats/multiaddr";
|
||||
import { DefaultPubsubTopic } from "@waku/interfaces";
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import type { IdentifyResult } from "@libp2p/interface";
|
||||
import type { PeerId } from "@libp2p/interface/peer-id";
|
||||
import type { PeerId } from "@libp2p/interface";
|
||||
import type { LightNode } from "@waku/interfaces";
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import type { PeerId } from "@libp2p/interface/peer-id";
|
||||
import type { PeerInfo } from "@libp2p/interface/peer-info";
|
||||
import { CustomEvent } from "@libp2p/interfaces/events";
|
||||
import type { PeerId, PeerInfo } from "@libp2p/interface";
|
||||
import { CustomEvent } from "@libp2p/interface";
|
||||
import { createSecp256k1PeerId } from "@libp2p/peer-id-factory";
|
||||
import { Multiaddr } from "@multiformats/multiaddr";
|
||||
import {
|
||||
|
@ -62,8 +61,7 @@ describe("ConnectionManager", function () {
|
|||
new CustomEvent<PeerInfo>("peer:discovery", {
|
||||
detail: {
|
||||
id: peerIdBootstrap,
|
||||
multiaddrs: [],
|
||||
protocols: []
|
||||
multiaddrs: []
|
||||
}
|
||||
})
|
||||
);
|
||||
|
@ -96,8 +94,7 @@ describe("ConnectionManager", function () {
|
|||
new CustomEvent<PeerInfo>("peer:discovery", {
|
||||
detail: {
|
||||
id: peerIdPx,
|
||||
multiaddrs: [],
|
||||
protocols: []
|
||||
multiaddrs: []
|
||||
}
|
||||
})
|
||||
);
|
||||
|
@ -312,8 +309,7 @@ describe("ConnectionManager", function () {
|
|||
new CustomEvent<PeerInfo>("peer:discovery", {
|
||||
detail: {
|
||||
id: await createSecp256k1PeerId(),
|
||||
multiaddrs: [],
|
||||
protocols: []
|
||||
multiaddrs: []
|
||||
}
|
||||
})
|
||||
);
|
||||
|
@ -377,7 +373,7 @@ describe("ConnectionManager", function () {
|
|||
// emit a peer:discovery event
|
||||
waku.libp2p.dispatchEvent(
|
||||
new CustomEvent<PeerInfo>("peer:discovery", {
|
||||
detail: { id: bootstrapPeer, multiaddrs: [], protocols: [] }
|
||||
detail: { id: bootstrapPeer, multiaddrs: [] }
|
||||
})
|
||||
);
|
||||
|
||||
|
@ -399,8 +395,7 @@ describe("ConnectionManager", function () {
|
|||
new CustomEvent<PeerInfo>("peer:discovery", {
|
||||
detail: {
|
||||
id: await createSecp256k1PeerId(),
|
||||
multiaddrs: [],
|
||||
protocols: []
|
||||
multiaddrs: []
|
||||
}
|
||||
})
|
||||
);
|
||||
|
@ -417,8 +412,7 @@ describe("ConnectionManager", function () {
|
|||
new CustomEvent<PeerInfo>("peer:discovery", {
|
||||
detail: {
|
||||
id: await createSecp256k1PeerId(),
|
||||
multiaddrs: [],
|
||||
protocols: []
|
||||
multiaddrs: []
|
||||
}
|
||||
})
|
||||
);
|
||||
|
@ -443,8 +437,7 @@ describe("ConnectionManager", function () {
|
|||
new CustomEvent<PeerInfo>("peer:discovery", {
|
||||
detail: {
|
||||
id: pxPeer,
|
||||
multiaddrs: [],
|
||||
protocols: []
|
||||
multiaddrs: []
|
||||
}
|
||||
})
|
||||
);
|
||||
|
@ -469,8 +462,7 @@ describe("ConnectionManager", function () {
|
|||
new CustomEvent<PeerInfo>("peer:discovery", {
|
||||
detail: {
|
||||
id: await createSecp256k1PeerId(),
|
||||
multiaddrs: [],
|
||||
protocols: []
|
||||
multiaddrs: []
|
||||
}
|
||||
})
|
||||
);
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import { EventEmitter } from "@libp2p/interface/events";
|
||||
import { TypedEventEmitter } from "@libp2p/interface";
|
||||
import tests from "@libp2p/interface-compliance-tests/peer-discovery";
|
||||
import { prefixLogger } from "@libp2p/logger";
|
||||
import { createSecp256k1PeerId } from "@libp2p/peer-id-factory";
|
||||
import { PersistentPeerStore } from "@libp2p/peer-store";
|
||||
import {
|
||||
|
@ -24,9 +25,10 @@ describe("DNS Discovery: Compliance Test", function () {
|
|||
// create libp2p mock peerStore
|
||||
const components = {
|
||||
peerStore: new PersistentPeerStore({
|
||||
events: new EventEmitter(),
|
||||
events: new TypedEventEmitter(),
|
||||
peerId: await createSecp256k1PeerId(),
|
||||
datastore: new MemoryDatastore()
|
||||
datastore: new MemoryDatastore(),
|
||||
logger: prefixLogger("dns-peer-discovery.spec.ts")
|
||||
})
|
||||
} as unknown as Libp2pComponents;
|
||||
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
import type { Connection } from "@libp2p/interface/connection";
|
||||
import type { PeerStore } from "@libp2p/interface/peer-store";
|
||||
import type { Peer } from "@libp2p/interface/peer-store";
|
||||
import type { Connection, Peer, PeerStore } from "@libp2p/interface";
|
||||
import { createSecp256k1PeerId } from "@libp2p/peer-id-factory";
|
||||
import {
|
||||
createLightNode,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type { PeerId } from "@libp2p/interface/peer-id";
|
||||
import type { PeerId } from "@libp2p/interface";
|
||||
import { createEncoder, waitForRemotePeer } from "@waku/core";
|
||||
import {
|
||||
ContentTopicInfo,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { CustomEvent } from "@libp2p/interface/events";
|
||||
import type { PeerId } from "@libp2p/interface/peer-id";
|
||||
import type { PeerInfo } from "@libp2p/interface/peer-info";
|
||||
import type { PeerId } from "@libp2p/interface";
|
||||
import type { PeerInfo } from "@libp2p/interface";
|
||||
import { CustomEvent } from "@libp2p/interface";
|
||||
import { multiaddr } from "@multiformats/multiaddr";
|
||||
import type { Multiaddr } from "@multiformats/multiaddr";
|
||||
import type { Waku } from "@waku/interfaces";
|
||||
|
@ -84,7 +84,6 @@ describe("multiaddr: dialing", function () {
|
|||
new CustomEvent<PeerInfo>("peer:discovery", {
|
||||
detail: {
|
||||
id: peerId,
|
||||
protocols: [],
|
||||
multiaddrs: [multiaddr]
|
||||
}
|
||||
})
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type { PeerId } from "@libp2p/interface/peer-id";
|
||||
import type { PeerId } from "@libp2p/interface";
|
||||
import tests from "@libp2p/interface-compliance-tests/peer-discovery";
|
||||
import type { Multiaddr } from "@multiformats/multiaddr";
|
||||
import type { LightNode, PeerInfo } from "@waku/interfaces";
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type { PeerId } from "@libp2p/interface/peer-id";
|
||||
import type { PeerId } from "@libp2p/interface";
|
||||
import { DecodedMessage, waitForRemotePeer } from "@waku/core";
|
||||
import { DefaultPubsubTopic, Protocols, RelayNode } from "@waku/interfaces";
|
||||
import { createRelayNode } from "@waku/sdk/relay";
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { bootstrap } from "@libp2p/bootstrap";
|
||||
import type { PeerId } from "@libp2p/interface/peer-id";
|
||||
import type { PeerId } from "@libp2p/interface";
|
||||
import { wakuPeerExchangeDiscovery } from "@waku/peer-exchange";
|
||||
import {
|
||||
ContentTopicInfo,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { bootstrap } from "@libp2p/bootstrap";
|
||||
import type { PeerId } from "@libp2p/interface/peer-id";
|
||||
import type { PeerId } from "@libp2p/interface";
|
||||
import {
|
||||
DecodedMessage,
|
||||
DefaultUserAgent,
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import type { Connection } from "@libp2p/interface/connection";
|
||||
import type { Peer, PeerStore } from "@libp2p/interface/peer-store";
|
||||
import type { Connection, Peer, PeerStore } from "@libp2p/interface";
|
||||
|
||||
import { bytesToUtf8 } from "../bytes/index.js";
|
||||
|
||||
|
|
Loading…
Reference in New Issue