This repository was archived by the owner on Feb 12, 2024. It is now read-only.
File tree 3 files changed +15
-4
lines changed
3 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -183,6 +183,7 @@ Commands:
183
183
- default repo location: ` ~/.jsipfs ` (can be changed with env variable ` IPFS_PATH ` )
184
184
- default swarm port: ` 4002 `
185
185
- default API port: ` 5002 `
186
+ - default Bootstrap is off, to enable it set ` IPFS_BOOTSTRAP=1 `
186
187
187
188
### HTTP-API
188
189
Original file line number Diff line number Diff line change 2
2
3
3
const utils = require ( '../../utils' )
4
4
const debug = require ( 'debug' )
5
+ const mafmt = require ( 'mafmt' )
6
+ const multiaddr = require ( 'multiaddr' )
5
7
const log = debug ( 'cli:object' )
6
8
log . error = debug ( 'cli:object:error' )
7
9
@@ -28,7 +30,12 @@ module.exports = {
28
30
}
29
31
30
32
result . forEach ( ( item ) => {
31
- console . log ( item . addr . toString ( ) )
33
+ let ma = multiaddr ( item . addr . toString ( ) )
34
+ if ( ! mafmt . IPFS . matches ( ma ) ) {
35
+ ma = ma . encapsulate ( '/ipfs/' + item . peer . toB58String ( ) )
36
+ }
37
+ const addr = ma . toString ( )
38
+ console . log ( addr )
32
39
} )
33
40
} )
34
41
} )
Original file line number Diff line number Diff line change @@ -6,14 +6,17 @@ const promisify = require('promisify-es6')
6
6
module . exports = function libp2p ( self ) {
7
7
return {
8
8
start : promisify ( ( callback ) => {
9
- self . config . get ( 'Discovery.MDNS.Enabled' , gotConfig )
9
+ self . config . get ( gotConfig )
10
10
11
- function gotConfig ( err , enabled ) {
11
+ function gotConfig ( err , config ) {
12
12
if ( err ) {
13
13
return callback ( err )
14
14
}
15
15
16
- const options = { mdns : enabled }
16
+ const options = {
17
+ mdns : config . Discovery . MDNS . Enabled ,
18
+ bootstrap : config . Bootstrap
19
+ }
17
20
18
21
self . _libp2pNode = new Node ( self . _peerInfo , undefined , options )
19
22
You can’t perform that action at this time.
0 commit comments