This repository was archived by the owner on Feb 12, 2024. It is now read-only.
File tree 15 files changed +302
-31
lines changed
15 files changed +302
-31
lines changed Original file line number Diff line number Diff line change 2
2
'use strict'
3
3
4
4
const test = require ( 'interface-ipfs-core' )
5
+ const parallel = require ( 'async/parallel' )
6
+
5
7
const IPFS = require ( '../../../src' )
6
8
7
9
const DaemonFactory = require ( 'ipfsd-ctl' )
8
- const df = DaemonFactory . create ( { remote : false } )
10
+ const df = DaemonFactory . create ( { type : 'proc' , exec : IPFS } )
9
11
12
+ const nodes = [ ]
10
13
const common = {
11
14
setup : function ( callback ) {
12
- callback ( null , df , 'proc' , IPFS )
15
+ callback ( null , {
16
+ spawnNode : ( cb ) => {
17
+ df . spawn ( ( err , _ipfsd ) => {
18
+ if ( err ) {
19
+ return cb ( err )
20
+ }
21
+
22
+ nodes . push ( _ipfsd )
23
+ cb ( null , _ipfsd . api )
24
+ } )
25
+ }
26
+ } )
27
+ } ,
28
+ teardown : function ( callback ) {
29
+ parallel ( nodes . map ( ( node ) => ( cb ) => node . stop ( cb ) ) , callback )
13
30
}
14
31
}
15
32
Original file line number Diff line number Diff line change 2
2
'use strict'
3
3
4
4
const test = require ( 'interface-ipfs-core' )
5
+ const parallel = require ( 'async/parallel' )
6
+
5
7
const IPFS = require ( '../../../src' )
6
8
7
9
const DaemonFactory = require ( 'ipfsd-ctl' )
8
- const df = DaemonFactory . create ( { remote : false } )
10
+ const df = DaemonFactory . create ( { type : 'proc' , exec : IPFS } )
9
11
12
+ const nodes = [ ]
10
13
const common = {
11
14
setup : function ( callback ) {
12
- callback ( null , df , 'proc' , IPFS )
15
+ callback ( null , {
16
+ spawnNode : ( cb ) => {
17
+ df . spawn ( ( err , _ipfsd ) => {
18
+ if ( err ) {
19
+ return cb ( err )
20
+ }
21
+
22
+ nodes . push ( _ipfsd )
23
+ cb ( null , _ipfsd . api )
24
+ } )
25
+ }
26
+ } )
27
+ } ,
28
+ teardown : function ( callback ) {
29
+ parallel ( nodes . map ( ( node ) => ( cb ) => node . stop ( cb ) ) , callback )
13
30
}
14
31
}
32
+
15
33
test . config ( common )
Original file line number Diff line number Diff line change 2
2
'use strict'
3
3
4
4
const test = require ( 'interface-ipfs-core' )
5
+ const parallel = require ( 'async/parallel' )
6
+
5
7
const IPFS = require ( '../../../src' )
6
8
7
9
const DaemonFactory = require ( 'ipfsd-ctl' )
8
- const df = DaemonFactory . create ( { remote : false } )
10
+ const df = DaemonFactory . create ( { type : 'proc' , exec : IPFS } )
9
11
12
+ const nodes = [ ]
10
13
const common = {
11
14
setup : function ( callback ) {
12
- callback ( null , df , 'proc' , IPFS )
15
+ callback ( null , {
16
+ spawnNode : ( cb ) => {
17
+ df . spawn ( ( err , _ipfsd ) => {
18
+ if ( err ) {
19
+ return cb ( err )
20
+ }
21
+
22
+ nodes . push ( _ipfsd )
23
+ cb ( null , _ipfsd . api )
24
+ } )
25
+ }
26
+ } )
27
+ } ,
28
+ teardown : function ( callback ) {
29
+ parallel ( nodes . map ( ( node ) => ( cb ) => node . stop ( cb ) ) , callback )
13
30
}
14
31
}
15
32
Original file line number Diff line number Diff line change 3
3
4
4
/*
5
5
const test = require('interface-ipfs-core')
6
+ const parallel = require('async/parallel')
6
7
7
8
const DaemonFactory = require('ipfsd-ctl')
8
- const df = DaemonFactory.create()
9
+ const df = DaemonFactory.create({ type: 'proc', exec: IPFS } )
9
10
11
+ const nodes = []
10
12
const common = {
11
13
setup: function (callback) {
12
- callback(null, df)
14
+ callback(null, {
15
+ spawnNode: (cb) => {
16
+ df.spawn((err, _ipfsd) => {
17
+ if (err) {
18
+ return cb(err)
19
+ }
20
+
21
+ nodes.push(_ipfsd)
22
+ cb(null, _ipfsd.api)
23
+ })
24
+ }
25
+ })
26
+ },
27
+ teardown: function (callback) {
28
+ parallel(nodes.map((node) => (cb) => node.stop(cb)), callback)
13
29
}
14
30
}
15
-
16
31
test.dht(common)
17
32
*/
Original file line number Diff line number Diff line change 2
2
'use strict'
3
3
4
4
const test = require ( 'interface-ipfs-core' )
5
+ const parallel = require ( 'async/parallel' )
6
+
5
7
const IPFS = require ( '../../../src' )
6
8
7
9
const DaemonFactory = require ( 'ipfsd-ctl' )
8
- const df = DaemonFactory . create ( { remote : false } )
10
+ const df = DaemonFactory . create ( { type : 'proc' , exec : IPFS } )
9
11
12
+ const nodes = [ ]
10
13
const common = {
11
14
setup : function ( callback ) {
12
- callback ( null , df , 'proc' , IPFS )
15
+ callback ( null , {
16
+ spawnNode : ( cb ) => {
17
+ df . spawn ( ( err , _ipfsd ) => {
18
+ if ( err ) {
19
+ return cb ( err )
20
+ }
21
+
22
+ nodes . push ( _ipfsd )
23
+ cb ( null , _ipfsd . api )
24
+ } )
25
+ }
26
+ } )
27
+ } ,
28
+ teardown : function ( callback ) {
29
+ parallel ( nodes . map ( ( node ) => ( cb ) => node . stop ( cb ) ) , callback )
13
30
}
14
31
}
15
32
Original file line number Diff line number Diff line change 2
2
'use strict'
3
3
4
4
const test = require ( 'interface-ipfs-core' )
5
+ const parallel = require ( 'async/parallel' )
6
+
5
7
const IPFS = require ( '../../../src' )
6
8
7
9
const DaemonFactory = require ( 'ipfsd-ctl' )
8
- const df = DaemonFactory . create ( { remote : false } )
10
+ const df = DaemonFactory . create ( { type : 'proc' , exec : IPFS } )
9
11
12
+ const nodes = [ ]
10
13
const common = {
11
14
setup : function ( callback ) {
12
- callback ( null , df , 'proc' , IPFS )
15
+ callback ( null , {
16
+ spawnNode : ( cb ) => {
17
+ df . spawn ( ( err , _ipfsd ) => {
18
+ if ( err ) {
19
+ return cb ( err )
20
+ }
21
+
22
+ nodes . push ( _ipfsd )
23
+ cb ( null , _ipfsd . api )
24
+ } )
25
+ }
26
+ } )
27
+ } ,
28
+ teardown : function ( callback ) {
29
+ parallel ( nodes . map ( ( node ) => ( cb ) => node . stop ( cb ) ) , callback )
13
30
}
14
31
}
32
+
15
33
test . generic ( common )
Original file line number Diff line number Diff line change 2
2
'use strict'
3
3
4
4
const test = require ( 'interface-ipfs-core' )
5
+ const parallel = require ( 'async/parallel' )
6
+
5
7
const IPFS = require ( '../../../src' )
6
8
7
9
const DaemonFactory = require ( 'ipfsd-ctl' )
8
- const df = DaemonFactory . create ( { remote : false } )
10
+ const df = DaemonFactory . create ( { type : 'proc' , exec : IPFS } )
9
11
12
+ const nodes = [ ]
10
13
const common = {
11
14
setup : function ( callback ) {
12
- callback ( null , df , 'proc' , IPFS )
15
+ callback ( null , {
16
+ spawnNode : ( cb ) => {
17
+ df . spawn ( ( err , _ipfsd ) => {
18
+ if ( err ) {
19
+ return cb ( err )
20
+ }
21
+
22
+ nodes . push ( _ipfsd )
23
+ cb ( null , _ipfsd . api )
24
+ } )
25
+ }
26
+ } )
27
+ } ,
28
+ teardown : function ( callback ) {
29
+ parallel ( nodes . map ( ( node ) => ( cb ) => node . stop ( cb ) ) , callback )
13
30
}
14
31
}
15
32
Original file line number Diff line number Diff line change 2
2
'use strict'
3
3
4
4
const test = require ( 'interface-ipfs-core' )
5
+ const parallel = require ( 'async/parallel' )
6
+
5
7
const IPFS = require ( '../../../src' )
6
8
7
9
const DaemonFactory = require ( 'ipfsd-ctl' )
8
- const df = DaemonFactory . create ( { remote : false } )
10
+ const df = DaemonFactory . create ( { type : 'proc' , exec : IPFS } )
9
11
12
+ const nodes = [ ]
10
13
const common = {
11
14
setup : function ( callback ) {
12
- callback ( null , df , 'proc' , IPFS )
15
+ callback ( null , {
16
+ spawnNode : ( cb ) => {
17
+ df . spawn ( { args : [ '--enable-pubsub-experiment' ] } ,
18
+ ( err , _ipfsd ) => {
19
+ if ( err ) {
20
+ return cb ( err )
21
+ }
22
+
23
+ nodes . push ( _ipfsd )
24
+ cb ( null , _ipfsd . api )
25
+ } )
26
+ }
27
+ } )
28
+ } ,
29
+ teardown : function ( callback ) {
30
+ parallel ( nodes . map ( ( node ) => ( cb ) => node . stop ( cb ) ) , callback )
13
31
}
14
32
}
15
33
Original file line number Diff line number Diff line change 2
2
'use strict'
3
3
4
4
const test = require ( 'interface-ipfs-core' )
5
+ const parallel = require ( 'async/parallel' )
6
+
5
7
const IPFS = require ( '../../../src' )
6
8
7
9
const DaemonFactory = require ( 'ipfsd-ctl' )
8
- const df = DaemonFactory . create ( { remote : false } )
10
+ const df = DaemonFactory . create ( { type : 'proc' , exec : IPFS } )
9
11
12
+ const nodes = [ ]
10
13
const common = {
11
14
setup : function ( callback ) {
12
- callback ( null , df , 'proc' , IPFS )
15
+ callback ( null , {
16
+ spawnNode : ( repoPath , config , cb ) => {
17
+ if ( typeof repoPath === 'function' ) {
18
+ cb = repoPath
19
+ repoPath = undefined
20
+ }
21
+
22
+ if ( typeof config === 'function' ) {
23
+ cb = config
24
+ config = undefined
25
+ }
26
+
27
+ df . spawn ( { repoPath, config } , ( err , _ipfsd ) => {
28
+ if ( err ) {
29
+ return cb ( err )
30
+ }
31
+
32
+ nodes . push ( _ipfsd )
33
+ cb ( null , _ipfsd . api )
34
+ } )
35
+ }
36
+ } )
37
+ } ,
38
+ teardown : function ( callback ) {
39
+ parallel ( nodes . map ( ( node ) => ( cb ) => node . stop ( cb ) ) , callback )
13
40
}
14
41
}
15
42
Original file line number Diff line number Diff line change 2
2
'use strict'
3
3
4
4
const test = require ( 'interface-ipfs-core' )
5
+ const parallel = require ( 'async/parallel' )
5
6
6
7
const DaemonFactory = require ( 'ipfsd-ctl' )
7
- const df = DaemonFactory . create ( )
8
+ const df = DaemonFactory . create ( { exec : 'src/cli/bin.js' } )
8
9
10
+ const nodes = [ ]
9
11
const common = {
10
12
setup : function ( callback ) {
11
- callback ( null , df )
13
+ callback ( null , {
14
+ spawnNode : ( cb ) => {
15
+ df . spawn ( ( err , _ipfsd ) => {
16
+ if ( err ) {
17
+ return cb ( err )
18
+ }
19
+
20
+ nodes . push ( _ipfsd )
21
+ cb ( null , _ipfsd . api )
22
+ } )
23
+ }
24
+ } )
25
+ } ,
26
+ teardown : function ( callback ) {
27
+ parallel ( nodes . map ( ( node ) => ( cb ) => node . stop ( cb ) ) , callback )
12
28
}
13
29
}
14
30
Original file line number Diff line number Diff line change 2
2
'use strict'
3
3
4
4
const test = require ( 'interface-ipfs-core' )
5
+ const parallel = require ( 'async/parallel' )
5
6
6
7
const DaemonFactory = require ( 'ipfsd-ctl' )
7
- const df = DaemonFactory . create ( )
8
+ const df = DaemonFactory . create ( { exec : 'src/cli/bin.js' } )
8
9
10
+ const nodes = [ ]
9
11
const common = {
10
12
setup : function ( callback ) {
11
- callback ( null , df , 'js' , './src/cli/bin.js' )
13
+ callback ( null , {
14
+ spawnNode : ( cb ) => {
15
+ df . spawn ( ( err , _ipfsd ) => {
16
+ if ( err ) {
17
+ return cb ( err )
18
+ }
19
+
20
+ nodes . push ( _ipfsd )
21
+ cb ( null , _ipfsd . api )
22
+ } )
23
+ }
24
+ } )
25
+ } ,
26
+ teardown : function ( callback ) {
27
+ parallel ( nodes . map ( ( node ) => ( cb ) => node . stop ( cb ) ) , callback )
12
28
}
13
29
}
14
30
You can’t perform that action at this time.
0 commit comments