diff --git a/src/core/components/init.js b/src/core/components/init.js index 02ff9d71fa..11429a08ac 100644 --- a/src/core/components/init.js +++ b/src/core/components/init.js @@ -63,6 +63,18 @@ module.exports = function init (self) { opts.log('done') opts.log('peer identity: ' + config.Identity.PeerID) + const isWin = /^win/.test(process.platform) + const isLinux = /^linux/.test(process.platform) + + // For the lack of sane WebRTC support on Linux and Windows + if (!process.env.USE_WRTC && (isWin || isLinux)) { + console.log('WARNING: Your platform does not have native WebRTC support, it won\' use any WebRTC transport') + const newAddrs = config.Addresses.Swarm.filter((addr) => { + return addr.indexOf('libp2p-webrtc-star') < 0 + }) + config.Addresses.Swarm = newAddrs + } + self._repo.init(config, cb) }, (_, cb) => self._repo.open(cb),