-
Notifications
You must be signed in to change notification settings - Fork 448
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING CHANGE: using libp2p-interface pubsub with new API
- Loading branch information
1 parent
fcebc20
commit 67a6376
Showing
13 changed files
with
416 additions
and
1,371 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
'use strict' | ||
|
||
/** | ||
* This file uses aegir hooks to | ||
* set up a libp2p instance for browser nodes to relay through | ||
* before tests start | ||
*/ | ||
|
||
const Libp2p = require('libp2p') | ||
const PeerId = require('peer-id') | ||
|
||
const WS = require('libp2p-websockets') | ||
const MPLEX = require('libp2p-mplex') | ||
const { NOISE } = require('libp2p-noise') | ||
|
||
const RelayPeer = require('./test/fixtures/relay') | ||
|
||
let libp2p | ||
|
||
const before = async () => { | ||
// Use the last peer | ||
const peerId = await PeerId.createFromJSON(RelayPeer) | ||
|
||
libp2p = new Libp2p({ | ||
addresses: { | ||
listen: [RelayPeer.multiaddr] | ||
}, | ||
peerId, | ||
modules: { | ||
transport: [WS], | ||
streamMuxer: [MPLEX], | ||
connEncryption: [NOISE] | ||
}, | ||
config: { | ||
relay: { | ||
enabled: true, | ||
hop: { | ||
enabled: true, | ||
active: false | ||
} | ||
}, | ||
pubsub: { | ||
enabled: false | ||
} | ||
} | ||
}) | ||
|
||
await libp2p.start() | ||
} | ||
|
||
const after = async () => { | ||
await libp2p.stop() | ||
} | ||
|
||
module.exports = { | ||
hooks: { | ||
pre: before, | ||
post: after | ||
}, | ||
webpack: { | ||
node: { | ||
// this is needed until bcrypto stops using node buffers in browser code | ||
Buffer: true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,30 +42,28 @@ | |
}, | ||
"homepage": "https://github.com/libp2p/js-libp2p-floodsub#readme", | ||
"devDependencies": { | ||
"aegir": "^25.0.0", | ||
"aegir": "^26.0.0", | ||
"benchmark": "^2.1.4", | ||
"chai": "^4.2.0", | ||
"chai-spies": "^1.0.0", | ||
"detect-node": "^2.0.4", | ||
"dirty-chai": "^2.0.1", | ||
"it-pair": "^1.0.0", | ||
"lodash": "^4.17.15", | ||
"ipfs-utils": "^3.0.0", | ||
"libp2p": "https://github.com/libp2p/js-libp2p#0.29.x", | ||
"libp2p-mplex": "^0.10.0", | ||
"libp2p-noise": "^2.0.0", | ||
"libp2p-websockets": "^0.14.0", | ||
"multiaddr": "^8.0.0", | ||
"p-defer": "^3.0.0", | ||
"p-wait-for": "^3.1.0", | ||
"peer-id": "^0.14.00", | ||
"sinon": "^9.0.1" | ||
}, | ||
"dependencies": { | ||
"async.nexttick": "^0.5.2", | ||
"debug": "^4.1.1", | ||
"it-length-prefixed": "^3.0.0", | ||
"it-pipe": "^1.0.1", | ||
"libp2p-pubsub": "~0.6.0", | ||
"p-map": "^4.0.0", | ||
"peer-id": "~0.14.0", | ||
"protons": "^2.0.0", | ||
"libp2p-interfaces": "^0.5.1", | ||
"time-cache": "^0.3.0", | ||
"uint8arrays": "^1.1.0" | ||
}, | ||
"peerDependencies": { | ||
"libp2p": "https://github.com/libp2p/js-libp2p#0.29.x" | ||
}, | ||
"contributors": [ | ||
"David Dias <[email protected]>", | ||
"Vasco Santos <[email protected]>", | ||
|
Oops, something went wrong.