File tree 4 files changed +39
-16
lines changed
4 files changed +39
-16
lines changed Original file line number Diff line number Diff line change 1
1
'use strict'
2
2
3
- const createServer = require ( 'ipfsd-ctl' ) . createServer
4
-
5
- const server = createServer ( )
3
+ const { createServer } = require ( 'ipfsd-ctl' )
4
+ let server
6
5
7
6
module . exports = {
8
7
hooks : {
9
8
browser : {
10
- pre : ( ) => server . start ( ) ,
9
+ pre : async ( ) => {
10
+ server = createServer ( {
11
+ host : '127.0.0.1' ,
12
+ port : 57483
13
+ } , {
14
+ type : 'go' ,
15
+ ipfsHttpModule : require ( 'ipfs-http-client' ) ,
16
+ ipfsBin : require ( 'go-ipfs-dep' ) . path ( ) ,
17
+ test : true
18
+ } )
19
+
20
+ await server . start ( )
21
+ } ,
11
22
post : ( ) => server . stop ( )
12
23
}
13
24
}
Original file line number Diff line number Diff line change 18
18
"coverage" : " aegir coverage"
19
19
},
20
20
"devDependencies" : {
21
- "aegir" : " ^21.0.2 " ,
21
+ "aegir" : " ^21.4.5 " ,
22
22
"chai" : " ^4.2.0" ,
23
23
"dirty-chai" : " ^2.0.1" ,
24
- "go-ipfs-dep" : " ^0.4.23" ,
25
- "ipfsd-ctl" : " ^0.44.1"
24
+ "go-ipfs-dep" : " 0.4.23-3" ,
25
+ "ipfs-utils" : " ^1.2.1" ,
26
+ "ipfsd-ctl" : " ^3.0.0"
26
27
},
27
28
"dependencies" : {
28
29
"debug" : " ^4.1.1" ,
29
- "ipfs-http-client" : " ^42 .0.0 " ,
30
+ "ipfs-http-client" : " ^43 .0.1 " ,
30
31
"p-queue" : " ^6.2.1" ,
31
32
"peer-id" : " ~0.13.5" ,
32
33
"peer-info" : " ^0.17.1"
Original file line number Diff line number Diff line change @@ -49,7 +49,9 @@ class DelegatedPeerRouting {
49
49
try {
50
50
return await this . _httpQueue . add ( async ( ) => {
51
51
const { addrs } = await this . dht . findPeer ( id , {
52
- timeout : `${ options . timeout } ms` // The api requires specification of the time unit (s/ms)
52
+ searchParams : {
53
+ timeout : `${ options . timeout } ms` // The api requires specification of the time unit (s/ms)
54
+ }
53
55
} )
54
56
55
57
const peerInfo = new PeerInfo ( PeerId . createFromCID ( id ) )
Original file line number Diff line number Diff line change 4
4
const chai = require ( 'chai' )
5
5
const { expect } = chai
6
6
chai . use ( require ( 'dirty-chai' ) )
7
- const IPFSFactory = require ( 'ipfsd-ctl' )
7
+ const { createFactory } = require ( 'ipfsd-ctl' )
8
8
const PeerID = require ( 'peer-id' )
9
+ const { isNode } = require ( 'ipfs-utils/src/env' )
9
10
10
11
const DelegatedPeerRouting = require ( '../src' )
11
- const factory = IPFSFactory . create ( { type : 'go' } )
12
+ const factory = createFactory ( {
13
+ type : 'go' ,
14
+ ipfsHttpModule : require ( 'ipfs-http-client' ) ,
15
+ ipfsBin : isNode ? require ( 'go-ipfs-dep' ) . path ( ) : undefined ,
16
+ test : true ,
17
+ endpoint : 'http://localhost:57483'
18
+ } )
12
19
13
20
async function spawnNode ( boostrap = [ ] ) {
14
21
const node = await factory . spawn ( {
15
22
// Lock down the nodes so testing can be deterministic
16
- config : {
17
- Bootstrap : boostrap ,
18
- Discovery : {
19
- MDNS : {
20
- Enabled : false
23
+ ipfsOptions : {
24
+ config : {
25
+ Bootstrap : boostrap ,
26
+ Discovery : {
27
+ MDNS : {
28
+ Enabled : false
29
+ }
21
30
}
22
31
}
23
32
}
You can’t perform that action at this time.
0 commit comments