Replace deprecated package for libp2p-noise

This commit is contained in:
Franck Royer 2021-08-18 15:26:18 +10:00
parent e0d2b3d525
commit 3f95934250
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
4 changed files with 82 additions and 80 deletions

View File

@ -8,6 +8,7 @@
"bitjson", "bitjson",
"bitauth", "bitauth",
"bufbuild", "bufbuild",
"chainsafe",
"cimg", "cimg",
"ciphertext", "ciphertext",
"circleci", "circleci",

155
package-lock.json generated
View File

@ -5,9 +5,11 @@
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "js-waku",
"version": "0.10.0", "version": "0.10.0",
"license": "MIT OR Apache-2.0", "license": "MIT OR Apache-2.0",
"dependencies": { "dependencies": {
"@chainsafe/libp2p-noise": "^4.0.0",
"axios": "^0.21.1", "axios": "^0.21.1",
"debug": "^4.3.1", "debug": "^4.3.1",
"ecies-geth": "^1.5.2", "ecies-geth": "^1.5.2",
@ -18,7 +20,6 @@
"libp2p-bootstrap": "^0.13.0", "libp2p-bootstrap": "^0.13.0",
"libp2p-gossipsub": "^0.10.0", "libp2p-gossipsub": "^0.10.0",
"libp2p-mplex": "^0.10.4", "libp2p-mplex": "^0.10.4",
"libp2p-noise": "^4.0.0",
"libp2p-tcp": "^0.17.0", "libp2p-tcp": "^0.17.0",
"libp2p-websockets": "^0.16.0", "libp2p-websockets": "^0.16.0",
"multiaddr": "^10.0.0", "multiaddr": "^10.0.0",
@ -2133,6 +2134,46 @@
"resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz",
"integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==" "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw=="
}, },
"node_modules/@chainsafe/libp2p-noise": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/@chainsafe/libp2p-noise/-/libp2p-noise-4.0.0.tgz",
"integrity": "sha512-Q9gcC1IzN8/aQQXl/ntRbldTD/3c35j5lK5guIKEB+QU/Ogi0EyaihkL3YGx9QrSiFTyz0ABlSfxA0Wxfw5R1A==",
"dependencies": {
"@stablelib/chacha20poly1305": "^1.0.1",
"@stablelib/hkdf": "^1.0.1",
"@stablelib/sha256": "^1.0.1",
"@stablelib/x25519": "^1.0.1",
"debug": "^4.3.1",
"it-buffer": "^0.1.1",
"it-length-prefixed": "^5.0.2",
"it-pair": "^1.0.0",
"it-pb-rpc": "^0.1.9",
"it-pipe": "^1.1.0",
"libp2p-crypto": "^0.19.0",
"peer-id": "^0.15.0",
"protobufjs": "^6.10.1",
"uint8arrays": "^2.0.5"
}
},
"node_modules/@chainsafe/libp2p-noise/node_modules/peer-id": {
"version": "0.15.2",
"resolved": "https://registry.npmjs.org/peer-id/-/peer-id-0.15.2.tgz",
"integrity": "sha512-3OMbup76F28gKsQK4rGheEJHwosnJGe2+Obsf1xFaS9DpUaG9/JK0rtguWVLbrkxPclsCceci8g3/ulg8jsORA==",
"dependencies": {
"class-is": "^1.1.0",
"libp2p-crypto": "^0.19.0",
"minimist": "^1.2.5",
"multiformats": "^9.3.0",
"protobufjs": "^6.10.2",
"uint8arrays": "^2.0.5"
},
"bin": {
"peer-id": "src/bin.js"
},
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/@cnakazawa/watch": { "node_modules/@cnakazawa/watch": {
"version": "1.0.4", "version": "1.0.4",
"resolved": "https://registry.npmjs.org/@cnakazawa/watch/-/watch-1.0.4.tgz", "resolved": "https://registry.npmjs.org/@cnakazawa/watch/-/watch-1.0.4.tgz",
@ -15386,46 +15427,6 @@
"varint": "^6.0.0" "varint": "^6.0.0"
} }
}, },
"node_modules/libp2p-noise": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/libp2p-noise/-/libp2p-noise-4.0.0.tgz",
"integrity": "sha512-DCXRKh9Y4pkw4HEWKPpZbeoROilZA1nrQMHIVrJ4JDEMUKVRucJc9GZTFNzo4yJUZ+ayQAlrfbUARiPPFbpfng==",
"dependencies": {
"@stablelib/chacha20poly1305": "^1.0.1",
"@stablelib/hkdf": "^1.0.1",
"@stablelib/sha256": "^1.0.1",
"@stablelib/x25519": "^1.0.1",
"debug": "^4.3.1",
"it-buffer": "^0.1.1",
"it-length-prefixed": "^5.0.2",
"it-pair": "^1.0.0",
"it-pb-rpc": "^0.1.9",
"it-pipe": "^1.1.0",
"libp2p-crypto": "^0.19.0",
"peer-id": "^0.15.0",
"protobufjs": "^6.10.1",
"uint8arrays": "^2.0.5"
}
},
"node_modules/libp2p-noise/node_modules/peer-id": {
"version": "0.15.1",
"resolved": "https://registry.npmjs.org/peer-id/-/peer-id-0.15.1.tgz",
"integrity": "sha512-EoZig26nzPt922s1D/EOe2vJY3D1NCl/+G8rzI99G4HOrUcM94DI5MV8EWLv3ra5j9R/6n7TLgQIpZm2hpBaAA==",
"dependencies": {
"class-is": "^1.1.0",
"libp2p-crypto": "^0.19.0",
"minimist": "^1.2.5",
"multiformats": "^9.3.0",
"protobufjs": "^6.10.2",
"uint8arrays": "^2.0.5"
},
"bin": {
"peer-id": "src/bin.js"
},
"engines": {
"node": ">=14.0.0"
}
},
"node_modules/libp2p-tcp": { "node_modules/libp2p-tcp": {
"version": "0.17.1", "version": "0.17.1",
"resolved": "https://registry.npmjs.org/libp2p-tcp/-/libp2p-tcp-0.17.1.tgz", "resolved": "https://registry.npmjs.org/libp2p-tcp/-/libp2p-tcp-0.17.1.tgz",
@ -26602,6 +26603,42 @@
"resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz",
"integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==" "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw=="
}, },
"@chainsafe/libp2p-noise": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/@chainsafe/libp2p-noise/-/libp2p-noise-4.0.0.tgz",
"integrity": "sha512-Q9gcC1IzN8/aQQXl/ntRbldTD/3c35j5lK5guIKEB+QU/Ogi0EyaihkL3YGx9QrSiFTyz0ABlSfxA0Wxfw5R1A==",
"requires": {
"@stablelib/chacha20poly1305": "^1.0.1",
"@stablelib/hkdf": "^1.0.1",
"@stablelib/sha256": "^1.0.1",
"@stablelib/x25519": "^1.0.1",
"debug": "^4.3.1",
"it-buffer": "^0.1.1",
"it-length-prefixed": "^5.0.2",
"it-pair": "^1.0.0",
"it-pb-rpc": "^0.1.9",
"it-pipe": "^1.1.0",
"libp2p-crypto": "^0.19.0",
"peer-id": "^0.15.0",
"protobufjs": "^6.10.1",
"uint8arrays": "^2.0.5"
},
"dependencies": {
"peer-id": {
"version": "0.15.2",
"resolved": "https://registry.npmjs.org/peer-id/-/peer-id-0.15.2.tgz",
"integrity": "sha512-3OMbup76F28gKsQK4rGheEJHwosnJGe2+Obsf1xFaS9DpUaG9/JK0rtguWVLbrkxPclsCceci8g3/ulg8jsORA==",
"requires": {
"class-is": "^1.1.0",
"libp2p-crypto": "^0.19.0",
"minimist": "^1.2.5",
"multiformats": "^9.3.0",
"protobufjs": "^6.10.2",
"uint8arrays": "^2.0.5"
}
}
}
},
"@cnakazawa/watch": { "@cnakazawa/watch": {
"version": "1.0.4", "version": "1.0.4",
"resolved": "https://registry.npmjs.org/@cnakazawa/watch/-/watch-1.0.4.tgz", "resolved": "https://registry.npmjs.org/@cnakazawa/watch/-/watch-1.0.4.tgz",
@ -36957,42 +36994,6 @@
"varint": "^6.0.0" "varint": "^6.0.0"
} }
}, },
"libp2p-noise": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/libp2p-noise/-/libp2p-noise-4.0.0.tgz",
"integrity": "sha512-DCXRKh9Y4pkw4HEWKPpZbeoROilZA1nrQMHIVrJ4JDEMUKVRucJc9GZTFNzo4yJUZ+ayQAlrfbUARiPPFbpfng==",
"requires": {
"@stablelib/chacha20poly1305": "^1.0.1",
"@stablelib/hkdf": "^1.0.1",
"@stablelib/sha256": "^1.0.1",
"@stablelib/x25519": "^1.0.1",
"debug": "^4.3.1",
"it-buffer": "^0.1.1",
"it-length-prefixed": "^5.0.2",
"it-pair": "^1.0.0",
"it-pb-rpc": "^0.1.9",
"it-pipe": "^1.1.0",
"libp2p-crypto": "^0.19.0",
"peer-id": "^0.15.0",
"protobufjs": "^6.10.1",
"uint8arrays": "^2.0.5"
},
"dependencies": {
"peer-id": {
"version": "0.15.1",
"resolved": "https://registry.npmjs.org/peer-id/-/peer-id-0.15.1.tgz",
"integrity": "sha512-EoZig26nzPt922s1D/EOe2vJY3D1NCl/+G8rzI99G4HOrUcM94DI5MV8EWLv3ra5j9R/6n7TLgQIpZm2hpBaAA==",
"requires": {
"class-is": "^1.1.0",
"libp2p-crypto": "^0.19.0",
"minimist": "^1.2.5",
"multiformats": "^9.3.0",
"protobufjs": "^6.10.2",
"uint8arrays": "^2.0.5"
}
}
}
},
"libp2p-tcp": { "libp2p-tcp": {
"version": "0.17.1", "version": "0.17.1",
"resolved": "https://registry.npmjs.org/libp2p-tcp/-/libp2p-tcp-0.17.1.tgz", "resolved": "https://registry.npmjs.org/libp2p-tcp/-/libp2p-tcp-0.17.1.tgz",

View File

@ -58,6 +58,7 @@
"node": ">=14" "node": ">=14"
}, },
"dependencies": { "dependencies": {
"@chainsafe/libp2p-noise": "^4.0.0",
"axios": "^0.21.1", "axios": "^0.21.1",
"debug": "^4.3.1", "debug": "^4.3.1",
"ecies-geth": "^1.5.2", "ecies-geth": "^1.5.2",
@ -68,7 +69,6 @@
"libp2p-bootstrap": "^0.13.0", "libp2p-bootstrap": "^0.13.0",
"libp2p-gossipsub": "^0.10.0", "libp2p-gossipsub": "^0.10.0",
"libp2p-mplex": "^0.10.4", "libp2p-mplex": "^0.10.4",
"libp2p-noise": "^4.0.0",
"libp2p-tcp": "^0.17.0", "libp2p-tcp": "^0.17.0",
"libp2p-websockets": "^0.16.0", "libp2p-websockets": "^0.16.0",
"multiaddr": "^10.0.0", "multiaddr": "^10.0.0",

View File

@ -1,3 +1,5 @@
import { bytes } from '@chainsafe/libp2p-noise/dist/src/@types/basic';
import { Noise } from '@chainsafe/libp2p-noise/dist/src/noise';
import debug from 'debug'; import debug from 'debug';
import Libp2p, { Connection, Libp2pModules, Libp2pOptions } from 'libp2p'; import Libp2p, { Connection, Libp2pModules, Libp2pOptions } from 'libp2p';
import Bootstrap from 'libp2p-bootstrap'; import Bootstrap from 'libp2p-bootstrap';
@ -5,8 +7,6 @@ import { MuxedStream } from 'libp2p-interfaces/dist/src/stream-muxer/types';
// eslint-disable-next-line @typescript-eslint/ban-ts-comment // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: No types available // @ts-ignore: No types available
import Mplex from 'libp2p-mplex'; import Mplex from 'libp2p-mplex';
import { bytes } from 'libp2p-noise/dist/src/@types/basic';
import { Noise } from 'libp2p-noise/dist/src/noise';
// eslint-disable-next-line @typescript-eslint/ban-ts-comment // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: No types available // @ts-ignore: No types available
import Websockets from 'libp2p-websockets'; import Websockets from 'libp2p-websockets';