This repository was archived by the owner on Feb 12, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +15
-4
lines changed
Expand file tree Collapse file tree 3 files changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -183,6 +183,7 @@ Commands:
183183- default repo location: ` ~/.jsipfs ` (can be changed with env variable ` IPFS_PATH ` )
184184- default swarm port: ` 4002 `
185185- default API port: ` 5002 `
186+ - default Bootstrap is off, to enable it set ` IPFS_BOOTSTRAP=1 `
186187
187188### HTTP-API
188189
Original file line number Diff line number Diff line change 22
33const utils = require ( '../../utils' )
44const debug = require ( 'debug' )
5+ const mafmt = require ( 'mafmt' )
6+ const multiaddr = require ( 'multiaddr' )
57const log = debug ( 'cli:object' )
68log . error = debug ( 'cli:object:error' )
79
@@ -28,7 +30,12 @@ module.exports = {
2830 }
2931
3032 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 )
3239 } )
3340 } )
3441 } )
Original file line number Diff line number Diff line change @@ -6,14 +6,17 @@ const promisify = require('promisify-es6')
66module . exports = function libp2p ( self ) {
77 return {
88 start : promisify ( ( callback ) => {
9- self . config . get ( 'Discovery.MDNS.Enabled' , gotConfig )
9+ self . config . get ( gotConfig )
1010
11- function gotConfig ( err , enabled ) {
11+ function gotConfig ( err , config ) {
1212 if ( err ) {
1313 return callback ( err )
1414 }
1515
16- const options = { mdns : enabled }
16+ const options = {
17+ mdns : config . Discovery . MDNS . Enabled ,
18+ bootstrap : config . Bootstrap
19+ }
1720
1821 self . _libp2pNode = new Node ( self . _peerInfo , undefined , options )
1922
You can’t perform that action at this time.
0 commit comments