Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

libp2p-pubsub

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

libp2p-pubsub - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

src/utils.js

17

CHANGELOG.md

@@ -0,1 +1,18 @@

<a name="0.0.3"></a>
## [0.0.3](https://github.com/libp2p/js-libp2p-pubsub/compare/v0.0.2...v0.0.3) (2019-04-17)
### Bug Fixes
* align topicid protobuf variable names ([f9a27d7](https://github.com/libp2p/js-libp2p-pubsub/commit/f9a27d7))
* libp2p crypto for linting ([b654c37](https://github.com/libp2p/js-libp2p-pubsub/commit/b654c37))
### Features
* added libp2p-crypto and bs58 dependencies ([c759f38](https://github.com/libp2p/js-libp2p-pubsub/commit/c759f38))
* added utils.js from js-libp2p-floodsub ([d83e357](https://github.com/libp2p/js-libp2p-pubsub/commit/d83e357))
<a name="0.0.2"></a>

@@ -2,0 +19,0 @@ ## [0.0.2](https://github.com/libp2p/js-libp2p-pubsub/compare/v0.0.1...v0.0.2) (2019-02-08)

19

package.json
{
"name": "libp2p-pubsub",
"version": "0.0.2",
"version": "0.0.3",
"description": "Pubsub base protocol for libp2p pubsub routers",

@@ -44,3 +44,3 @@ "leadMaintainer": "Vasco Santos <santos.vasco10@gmail.com>",

"devDependencies": {
"aegir": "^18.0.3",
"aegir": "^18.2.1",
"benchmark": "^2.1.4",

@@ -51,4 +51,4 @@ "chai": "^4.2.0",

"libp2p": "~0.24.4",
"libp2p-secio": "~0.11.0",
"libp2p-spdy": "~0.13.1",
"libp2p-secio": "~0.11.1",
"libp2p-spdy": "~0.13.3",
"libp2p-tcp": "~0.13.0",

@@ -60,14 +60,21 @@ "lodash": "^4.17.11",

"dependencies": {
"async": "^2.6.1",
"async": "^2.6.2",
"bs58": "^4.0.1",
"debug": "^4.1.1",
"err-code": "^1.1.2",
"length-prefixed-stream": "^1.6.0",
"length-prefixed-stream": "^2.0.0",
"libp2p-crypto": "~0.16.1",
"protons": "^1.0.1",
"pull-length-prefixed": "^1.3.1",
"pull-pushable": "^2.2.0",
"pull-stream": "^3.6.9",
"time-cache": "~0.3.0"
},
"contributors": [
"Cayman <caymannava@gmail.com>",
"Jacob Heun <jacobheun@gmail.com>",
"Mikerah <mikerahqc@protonmail.com>",
"Vasco Santos <vasco.santos@ua.pt>",
"Vasco Santos <vasco.santos@moxy.studio>"
]
}

@@ -7,2 +7,3 @@ js-libp2p-pubsub

[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)
[![Discourse posts](https://img.shields.io/discourse/https/discuss.libp2p.io/posts.svg)](https://discuss.libp2p.io)
[![Coverage Status](https://coveralls.io/repos/github/libp2p/js-libp2p-pubsub/badge.svg?branch=master)](https://coveralls.io/github/libp2p/js-libp2p-pubsub?branch=master)

@@ -36,4 +37,8 @@ [![Travis CI](https://travis-ci.org/libp2p/js-libp2p-pubsub.svg?branch=master)](https://travis-ci.org/libp2p/js-libp2p-pubsub)

A pubsub implementation **MUST** override the `_processConnection`, `publish`, `subscribe` and `unsubscribe` functions. `add_peer` and `remove_peer` may be overwritten if the pubsub implementation needs to add custom logic when peers are added and remove. All the remaining functions **MUST NOT** be overwritten.
A pubsub implementation **MUST** override the `_processConnection`, `publish`, `subscribe` and `unsubscribe` functions.
Other functions, such as `_addPeer`, `_removePeer`, `_onDial`, `start` and `stop` may be overwritten if the pubsub implementation needs to add custom logic on them. It is important pointing out that `start` and `stop` **must** call `super`. The `start` function is responsible for mounting the pubsub protocol onto the libp2p node and sending its' subscriptions to every peer conneceted, while the `stop` function is responsible for unmounting the pubsub protocol and shutting down every connection
All the remaining functions **MUST NOT** be overwritten.
The following example aims to show how to create your pubsub implementation extending this base protocol. The pubsub implementation will handle the subscriptions logic.

@@ -40,0 +45,0 @@

@@ -9,3 +9,3 @@ 'use strict'

optional bool subscribe = 1; // subscribe or unsubcribe
optional string topicCID = 2;
optional string topicID = 2;
}

@@ -12,0 +12,0 @@

@@ -108,3 +108,3 @@ 'use strict'

subscribe: subscribe,
topicCID: topic
topicID: topic
})

@@ -157,5 +157,5 @@ })

if (subopt.subscribe) {
this.topics.add(subopt.topicCID)
this.topics.add(subopt.topicID)
} else {
this.topics.delete(subopt.topicCID)
this.topics.delete(subopt.topicID)
}

@@ -162,0 +162,0 @@ })

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc