mirror of
https://github.com/fluencelabs/js-libp2p
synced 2025-06-21 13:01:33 +00:00
Initial version, readme docs, expectations, and so on
This commit is contained in:
18
src/index.js
18
src/index.js
@ -0,0 +1,18 @@
|
||||
|
||||
exports = module.exports = Libp2p
|
||||
|
||||
function Libp2p (swarm, peerRouting, recordStore) {
|
||||
var self = this
|
||||
|
||||
if (!(self instanceof Libp2p)) {
|
||||
throw new Error('Must be called with new')
|
||||
}
|
||||
|
||||
if (!swarm) {
|
||||
throw new Error('a swarm must be passed')
|
||||
}
|
||||
|
||||
self.swarm = swarm
|
||||
self.routing = peerRouting
|
||||
self.record = recordStore
|
||||
}
|
||||
|
Reference in New Issue
Block a user