This repository was archived by the owner on Jul 21, 2023. It is now read-only.
Commit 01b7ec1 1 parent ee3b374 commit 01b7ec1 Copy full SHA for 01b7ec1
File tree 3 files changed +2
-5
lines changed
3 files changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -9,9 +9,6 @@ const esbuild = {
9
9
build . onResolve ( { filter : / ^ s t r e a m $ / } , ( ) => {
10
10
return { path : require . resolve ( 'readable-stream' ) }
11
11
} )
12
- build . onResolve ( { filter : / ^ c r y p t o $ / } , ( ) => {
13
- return { path : require . resolve ( 'crypto-browserify' ) }
14
- } )
15
12
}
16
13
}
17
14
]
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ const KBuck = require('k-bucket')
5
5
const { xor : uint8ArrayXor } = require ( 'uint8arrays/xor' )
6
6
const GENERATED_PREFIXES = require ( './generated-prefix-list.json' )
7
7
const { sha256 } = require ( 'multiformats/hashes/sha2' )
8
- const crypto = require ( 'crypto' )
8
+ const crypto = require ( 'libp2p- crypto' )
9
9
const PeerId = require ( 'peer-id' )
10
10
const utils = require ( '../utils' )
11
11
const debug = require ( 'debug' )
Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ const { convertBuffer } = require('../../src/utils')
12
12
const { sortClosestPeers } = require ( '../../src/utils' )
13
13
const DHT = require ( '../../src' )
14
14
const { fromString : uint8ArrayFromString } = require ( 'uint8arrays/from-string' )
15
+ const crypto = require ( 'libp2p-crypto' )
15
16
16
17
const NUM_PEERS = 10e3 // Peers to create, not including us
17
18
const LATENCY_DEAD_NODE = 120e3 // How long dead nodes should take before erroring
@@ -134,7 +135,6 @@ async function GetClosestPeersSimulation () {
134
135
* @returns {Array<PeerId> }
135
136
*/
136
137
function createPeers ( num ) {
137
- const crypto = require ( 'crypto' )
138
138
const peers = [ ...new Array ( num ) ] . map ( ( ) => {
139
139
return PeerId . createFromB58String (
140
140
base58btc . baseEncode ( crypto . randomBytes ( 34 ) )
You can’t perform that action at this time.
0 commit comments