@@ -3,18 +3,18 @@ import type { SpawnOptions, Daemon, DaemonFactory } from '@libp2p/interop'
3
3
import { createServer } from '@libp2p/daemon-server'
4
4
import { createClient } from '@libp2p/daemon-client'
5
5
import { createLibp2p , Libp2pOptions } from 'libp2p'
6
- import { TCP } from '@libp2p/tcp'
6
+ import { tcp } from '@libp2p/tcp'
7
7
import { multiaddr } from '@multiformats/multiaddr'
8
8
import { path as p2pd } from 'go-libp2p'
9
9
import { execa } from 'execa'
10
10
import pDefer from 'p-defer'
11
11
import { logger } from '@libp2p/logger'
12
- import { Mplex } from '@libp2p/mplex'
12
+ import { mplex } from '@libp2p/mplex'
13
13
import fs from 'fs'
14
14
import { unmarshalPrivateKey } from '@libp2p/crypto/keys'
15
15
import type { PeerId } from '@libp2p/interface-peer-id'
16
16
import { peerIdFromKeys } from '@libp2p/peer-id'
17
- import { Noise } from '../src/noise .js'
17
+ import { noise } from '../src/index .js'
18
18
19
19
async function createGoPeer ( options : SpawnOptions ) : Promise < Daemon > {
20
20
const controlPort = Math . floor ( Math . random ( ) * ( 50000 - 10000 + 1 ) ) + 10000
@@ -76,11 +76,9 @@ async function createJsPeer (options: SpawnOptions): Promise<Daemon> {
76
76
addresses : {
77
77
listen : [ '/ip4/0.0.0.0/tcp/0' ]
78
78
} ,
79
- transports : [ new TCP ( ) ] ,
80
- // @ts -expect-error libp2p options is still referencing the old stream muxer interface https://github.com/libp2p/js-libp2p/pull/1402
81
- streamMuxers : [ new Mplex ( ) ] ,
82
- // @ts -expect-error libp2p options is still referencing the old connection encrypter interface https://github.com/libp2p/js-libp2p/pull/1402
83
- connectionEncryption : [ new Noise ( ) ]
79
+ transports : [ tcp ( ) ] ,
80
+ streamMuxers : [ mplex ( ) ] ,
81
+ connectionEncryption : [ noise ( ) ]
84
82
}
85
83
86
84
const node = await createLibp2p ( opts )
0 commit comments