This repository was archived by the owner on Feb 12, 2024. It is now read-only.
File tree 6 files changed +52
-6
lines changed
6 files changed +52
-6
lines changed Original file line number Diff line number Diff line change @@ -323,11 +323,15 @@ function IPFS (repo) {
323
323
libp2pNode . swarm . close ( callback )
324
324
} ,
325
325
swarm : {
326
- peers : ( ) => { } ,
326
+ peers : ( callback ) => {
327
+ callback ( null , [ ] )
328
+ } ,
329
+ // all the addrs we know
327
330
addrs : notImpl ,
331
+ localAddrs : notImpl ,
328
332
connect : notImpl ,
329
333
disconnect : notImpl ,
330
- filters : notImpl
334
+ filters : notImpl // TODO
331
335
} ,
332
336
routing : { } ,
333
337
records : { } ,
Original file line number Diff line number Diff line change
1
+ const resources = require ( './../resources' )
2
+
3
+ module . exports = ( server ) => {
4
+ const api = server . select ( 'API' )
5
+
6
+ api . route ( {
7
+ method : 'GET' ,
8
+ path : '/api/v0/swarm/addrs' ,
9
+ config : {
10
+ handler : resources . swarm . addrs . handler
11
+ }
12
+ } )
13
+
14
+ api . route ( {
15
+ method : 'GET' ,
16
+ path : '/api/v0/swarm/addrs/local' ,
17
+ config : {
18
+ handler : resources . swarm . localAddrs . handler
19
+ }
20
+ } )
21
+
22
+ api . route ( {
23
+ method : 'GET' ,
24
+ path : '/api/v0/swarm/connect' ,
25
+ config : {
26
+ handler : resources . swarm . connect
27
+ }
28
+ } )
29
+
30
+ api . route ( {
31
+ method : 'GET' ,
32
+ path : '/api/v0/swarm/disconnect' ,
33
+ config : {
34
+ handler : resources . swarm . disconnect
35
+ }
36
+ } )
37
+
38
+ // TODO
39
+ // api.route({
40
+ // method: 'GET',
41
+ // path: '/api/v0/swarm/filters',
42
+ // config: {
43
+ // handler: resources.swarm.disconnect
44
+ // }
45
+ // })
46
+ }
Original file line number Diff line number Diff line change 2
2
3
3
const expect = require ( 'chai' ) . expect
4
4
5
- process . env . IPFS_PATH = process . cwd ( ) + '/tests/repo-example'
6
5
const IPFS = require ( '../../src/core' )
7
6
8
7
describe ( 'bootstrap' , ( ) => {
Original file line number Diff line number Diff line change 2
2
3
3
const expect = require ( 'chai' ) . expect
4
4
5
- process . env . IPFS_PATH = process . cwd ( ) + '/tests/repo-example'
6
5
const IPFS = require ( '../../src/core' )
7
6
8
7
describe ( 'id' , ( ) => {
Original file line number Diff line number Diff line change 2
2
3
3
const expect = require ( 'chai' ) . expect
4
4
5
- process . env . IPFS_PATH = process . cwd ( ) + '/tests/repo-example'
6
5
const IPFS = require ( '../../src/core' )
7
6
8
7
describe ( 'swarm' , ( ) => {
Original file line number Diff line number Diff line change 2
2
3
3
const expect = require ( 'chai' ) . expect
4
4
5
- process . env . IPFS_PATH = process . cwd ( ) + '/tests/repo-example'
6
5
const IPFS = require ( '../../src/core' )
7
6
8
7
describe ( 'version' , ( ) => {
You can’t perform that action at this time.
0 commit comments