Merge pull request #1011 from waku-org/chore/multiaddr

This commit is contained in:
fryorcraken.eth 2022-11-09 15:44:51 +11:00 committed by GitHub
commit 589d2b3d8a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 84 additions and 1382 deletions

1372
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -88,7 +88,7 @@
"dependencies": {
"@waku/byte-utils": "*",
"@chainsafe/libp2p-gossipsub": "^4.1.1",
"@libp2p/interface-connection": "3.0.1",
"@libp2p/interface-connection": "^3.0.3",
"@libp2p/interface-peer-discovery": "^1.0.0",
"@libp2p/interface-peer-id": "^1.0.2",
"@libp2p/interface-peer-info": "^1.0.1",
@ -102,7 +102,7 @@
"it-all": "^1.0.6",
"it-length-prefixed": "^8.0.2",
"it-pipe": "^2.0.4",
"libp2p": "0.38.0",
"libp2p": "0.39.2",
"p-event": "^5.0.1",
"protons-runtime": "^3.1.0",
"uint8arraylist": "^2.3.2",

View File

@ -53,7 +53,7 @@
"@libp2p/interface-peer-id": "^1.0.5",
"@libp2p/interface-peer-store": "^1.2.2",
"@multiformats/multiaddr": "^11.0.6",
"libp2p": "0.38.0"
"libp2p": "0.39.2"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.8.1",

View File

@ -31,8 +31,6 @@ describe("ENR Interop: nwaku", function () {
staticNoiseKey: NOISE_KEY_1,
});
await waku.start();
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore TODO: uniformize usage of multiaddr lib across repos
await waku.dial(multiAddrWithId);
await waitForRemotePeer(waku, [Protocols.Relay]);
@ -65,8 +63,6 @@ describe("ENR Interop: nwaku", function () {
staticNoiseKey: NOISE_KEY_1,
});
await waku.start();
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore TODO: uniformize usage of multiaddr lib across repos
await waku.dial(multiAddrWithId);
await waitForRemotePeer(waku, [Protocols.Relay]);
@ -99,8 +95,6 @@ describe("ENR Interop: nwaku", function () {
staticNoiseKey: NOISE_KEY_1,
});
await waku.start();
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore TODO: uniformize usage of multiaddr lib across repos
await waku.dial(multiAddrWithId);
await waitForRemotePeer(waku, [Protocols.Relay]);

View File

@ -34,8 +34,6 @@ describe("Waku Filter", () => {
libp2p: { addresses: { listen: ["/ip4/0.0.0.0/tcp/0/ws"] } },
});
await waku.start();
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore TODO: uniformize usage of multiaddr lib across repos
await waku.dial(await nwaku.getMultiaddrWithId());
await waitForRemotePeer(waku, [Protocols.Filter, Protocols.LightPush]);
});

View File

@ -39,8 +39,6 @@ describe("Waku Light Push [node only]", () => {
staticNoiseKey: NOISE_KEY_1,
});
await waku.start();
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore TODO: uniformize usage of multiaddr lib across repos
await waku.dial(await nwaku.getMultiaddrWithId());
await waitForRemotePeer(waku, [Protocols.LightPush]);
@ -75,8 +73,6 @@ describe("Waku Light Push [node only]", () => {
staticNoiseKey: NOISE_KEY_1,
});
await waku.start();
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore TODO: uniformize usage of multiaddr lib across repos
await waku.dial(await nwaku.getMultiaddrWithId());
await waitForRemotePeer(waku, [Protocols.LightPush]);

View File

@ -66,9 +66,6 @@ describe("Waku Relay [node only]", () => {
log("Instances started, adding waku2 to waku1's address book");
waku1.addPeerToAddressBook(
waku2.libp2p.peerId,
// TODO: Upgrade libp2p package.
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: New multiaddr type but they seem mostly compatible
waku2.libp2p.getMultiaddrs()
);
@ -286,16 +283,10 @@ describe("Waku Relay [node only]", () => {
waku1.addPeerToAddressBook(
waku2.libp2p.peerId,
// TODO: Upgrade libp2p package.
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: New multiaddr type but they seem mostly compatible
waku2.libp2p.getMultiaddrs()
);
waku3.addPeerToAddressBook(
waku2.libp2p.peerId,
// TODO: Upgrade libp2p package.
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: New multiaddr type but they seem mostly compatible
waku2.libp2p.getMultiaddrs()
);
@ -346,8 +337,6 @@ describe("Waku Relay [node only]", () => {
nwaku = new Nwaku(this.test?.ctx?.currentTest?.title + "");
await nwaku.start();
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore TODO: uniformize usage of multiaddr lib across repos
await waku.dial(await nwaku.getMultiaddrWithId());
await waitForRemotePeer(waku, [Protocols.Relay]);
});
@ -445,11 +434,7 @@ describe("Waku Relay [node only]", () => {
const nwakuMultiaddr = await nwaku.getMultiaddrWithId();
await Promise.all([
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore TODO: uniformize usage of multiaddr lib across repos
waku1.dial(nwakuMultiaddr),
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore TODO: uniformize usage of multiaddr lib across repos
waku2.dial(nwakuMultiaddr),
]);

View File

@ -59,8 +59,6 @@ describe("Waku Store", () => {
staticNoiseKey: NOISE_KEY_1,
});
await waku.start();
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore TODO: uniformize usage of multiaddr lib across repos
await waku.dial(await nwaku.getMultiaddrWithId());
await waitForRemotePeer(waku, [Protocols.Store]);
@ -92,8 +90,6 @@ describe("Waku Store", () => {
staticNoiseKey: NOISE_KEY_1,
});
await waku.start();
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore TODO: uniformize usage of multiaddr lib across repos
await waku.dial(await nwaku.getMultiaddrWithId());
await waitForRemotePeer(waku, [Protocols.Store]);
@ -134,8 +130,6 @@ describe("Waku Store", () => {
staticNoiseKey: NOISE_KEY_1,
});
await waku.start();
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore TODO: uniformize usage of multiaddr lib across repos
await waku.dial(await nwaku.getMultiaddrWithId());
await waitForRemotePeer(waku, [Protocols.Store]);
@ -177,8 +171,6 @@ describe("Waku Store", () => {
staticNoiseKey: NOISE_KEY_1,
});
await waku.start();
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore TODO: uniformize usage of multiaddr lib across repos
await waku.dial(await nwaku.getMultiaddrWithId());
await waitForRemotePeer(waku, [Protocols.Store]);
@ -218,8 +210,6 @@ describe("Waku Store", () => {
staticNoiseKey: NOISE_KEY_1,
});
await waku.start();
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore TODO: uniformize usage of multiaddr lib across repos
await waku.dial(await nwaku.getMultiaddrWithId());
await waitForRemotePeer(waku, [Protocols.Store]);
@ -263,8 +253,6 @@ describe("Waku Store", () => {
staticNoiseKey: NOISE_KEY_1,
});
await waku.start();
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore TODO: uniformize usage of multiaddr lib across repos
await waku.dial(await nwaku.getMultiaddrWithId());
await waitForRemotePeer(waku, [Protocols.Store]);
@ -347,11 +335,7 @@ describe("Waku Store", () => {
log("Waku nodes created");
await Promise.all([
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore TODO: uniformize usage of multiaddr lib across repos
waku1.dial(nimWakuMultiaddr),
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore TODO: uniformize usage of multiaddr lib across repos
waku2.dial(nimWakuMultiaddr),
]);
@ -433,8 +417,6 @@ describe("Waku Store", () => {
staticNoiseKey: NOISE_KEY_1,
});
await waku.start();
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore TODO: uniformize usage of multiaddr lib across repos
await waku.dial(await nwaku.getMultiaddrWithId());
await waitForRemotePeer(waku, [Protocols.Store]);
@ -496,8 +478,6 @@ describe("Waku Store", () => {
staticNoiseKey: NOISE_KEY_1,
});
await waku.start();
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore TODO: uniformize usage of multiaddr lib across repos
await waku.dial(await nwaku.getMultiaddrWithId());
await waitForRemotePeer(waku, [Protocols.Store]);
@ -557,8 +537,6 @@ describe("Waku Store, custom pubsub topic", () => {
pubSubTopic: customPubSubTopic,
});
await waku.start();
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore TODO: uniformize usage of multiaddr lib across repos
await waku.dial(await nwaku.getMultiaddrWithId());
await waitForRemotePeer(waku, [Protocols.Store]);

View File

@ -36,8 +36,6 @@ describe("Wait for remote peer", function () {
staticNoiseKey: NOISE_KEY_1,
});
await waku1.start();
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore TODO: uniformize usage of multiaddr lib across repos
await waku1.dial(multiAddrWithId);
await delay(1000);
await waitForRemotePeer(waku1, [Protocols.Relay]);
@ -66,8 +64,6 @@ describe("Wait for remote peer", function () {
const waitPromise = waitForRemotePeer(waku1, [Protocols.Relay]);
await delay(1000);
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore TODO: uniformize usage of multiaddr lib across repos
await waku1.dial(multiAddrWithId);
await waitPromise;
@ -113,8 +109,6 @@ describe("Wait for remote peer", function () {
staticNoiseKey: NOISE_KEY_1,
});
await waku2.start();
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore TODO: uniformize usage of multiaddr lib across repos
await waku2.dial(multiAddrWithId);
await delay(1000);
await waitForRemotePeer(waku2, [Protocols.Store]);
@ -144,8 +138,6 @@ describe("Wait for remote peer", function () {
await waku2.start();
const waitPromise = waitForRemotePeer(waku2, [Protocols.Store], 2000);
await delay(1000);
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore TODO: uniformize usage of multiaddr lib across repos
await waku2.dial(multiAddrWithId);
await waitPromise;
@ -172,8 +164,6 @@ describe("Wait for remote peer", function () {
staticNoiseKey: NOISE_KEY_1,
});
await waku2.start();
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore TODO: uniformize usage of multiaddr lib across repos
await waku2.dial(multiAddrWithId);
await waitForRemotePeer(waku2, [Protocols.LightPush]);
@ -202,8 +192,6 @@ describe("Wait for remote peer", function () {
staticNoiseKey: NOISE_KEY_1,
});
await waku2.start();
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore TODO: uniformize usage of multiaddr lib across repos
await waku2.dial(multiAddrWithId);
await waitForRemotePeer(waku2, [Protocols.Filter]);
@ -233,8 +221,6 @@ describe("Wait for remote peer", function () {
staticNoiseKey: NOISE_KEY_1,
});
await waku2.start();
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore TODO: uniformize usage of multiaddr lib across repos
await waku2.dial(multiAddrWithId);
await waitForRemotePeer(waku2);
@ -271,8 +257,6 @@ describe("Wait for remote peer", function () {
staticNoiseKey: NOISE_KEY_1,
});
await waku1.start();
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore TODO: uniformize usage of multiaddr lib across repos
await waku1.dial(multiAddrWithId);
await waitForRemotePeer(waku1);

View File

@ -46,8 +46,6 @@ describe("Waku Dial [node only]", function () {
staticNoiseKey: NOISE_KEY_1,
});
await waku.start();
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore TODO: uniformize usage of multiaddr lib across repos
await waku.dial(multiAddrWithId);
await waitForRemotePeer(waku);
@ -74,8 +72,6 @@ describe("Waku Dial [node only]", function () {
waku = await createLightNode({
staticNoiseKey: NOISE_KEY_1,
libp2p: {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore TODO: uniformize usage of multiaddr lib across repos
peerDiscovery: [new PeerDiscoveryStaticPeers([multiAddrWithId])],
},
});
@ -103,8 +99,6 @@ describe("Waku Dial [node only]", function () {
staticNoiseKey: NOISE_KEY_1,
libp2p: {
peerDiscovery: [
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore TODO: uniformize usage of multiaddr lib across repos
new PeerDiscoveryStaticPeers([await nwaku.getMultiaddrWithId()]),
],
},
@ -149,9 +143,6 @@ describe("Decryption Keys", () => {
waku1.addPeerToAddressBook(
waku2.libp2p.peerId,
// TODO: Upgrade libp2p package.
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: New multiaddr type but they seem mostly compatible
waku2.libp2p.getMultiaddrs()
);