This commit is contained in:
Mitra Ardron 2019-06-19 14:54:12 +10:00
parent 728c611846
commit b3d602a1aa
3 changed files with 14 additions and 6 deletions

View File

@ -8,13 +8,19 @@ process.env.GUN_ENV = "false";
const Gun = require('gun/gun.js'); // gun/gun is the minimized version
// Raw Gun has almost nothing in it, it needs at least the following to work properly.
require('gun/lib/path.js'); // So that .path works
/*
WORKAROUND-GUN-STORAGE
//WORKAROUND-GUN-STORAGE
// The next step is to stop it failing as soon as its cached 5Mb in localstorage
// see https://github.com/amark/gun/blob/master/test/tmp/indexedDB.html and https://github.com/amark/gun/issues/590
// but the instructions on how to do this are obviously broken so waiting on @amark to get this working.
require('gun/lib/radix.js');
require('gun/lib/radisk.js');
// See https://github.com/internetarchive/dweb-archive/issues/106 unable to get this working (Gun doesnt work well with webpack)
//require('gun/nts');
//require('gun/lib/wire'); // NodeJS websocket
//require('gun/lib/multicast'); // Local area broadcasting needs passing `multicast: true` in options (which is safe in node + browser)
/*
require('gun/lib/radix.js'); // loaded by store but required for webpack
require('gun/lib/radisk.js'); // loaded by store but required for webpack
require('gun/lib/store.js');
require('gun/lib/rindexed.js');
*/

View File

@ -713,8 +713,9 @@ class Transports {
this._optionspaused = (options.paused || []).map(n => n.toUpperCase()); // Array of transports paused - defaults to none, upper cased
if (!(tabbrevs && tabbrevs.length)) { tabbrevs = options.defaulttransports || [] }
// WOLK is currently failing, and what is worse returning a data structure with a 404 instead of just failing
// GUN is turned off by default because it fills up localstorage on browser and stops working, https://github.com/internetarchive/dweb-archive/issues/106
//if (! tabbrevs.length) { tabbrevs = ["HTTP", "YJS", "IPFS", "WEBTORRENT", "GUN", "WOLK"]; } // SEE-OTHER-ADDTRANSPORT
if (! tabbrevs.length) { tabbrevs = ["HTTP", "YJS", "IPFS", "WEBTORRENT", "GUN"]; } // SEE-OTHER-ADDTRANSPORT
if (! tabbrevs.length) { tabbrevs = ["HTTP", "YJS", "IPFS", "WEBTORRENT"]; } // SEE-OTHER-ADDTRANSPORT
tabbrevs = tabbrevs.map(n => n.toUpperCase());
let transports = this.setup0(tabbrevs, options);
["statuscb", "mirror"].forEach(k => { if (options[k]) this[k] = options[k];} )

View File

@ -19,7 +19,8 @@ module.exports = {
clearImmediate: false,
Buffer: true,
setImmediate: false,
console: false
console: false,
dgram: 'empty'
},
plugins: [