All Projects → ChainSafe → js-libp2p-gossipsub

ChainSafe / js-libp2p-gossipsub

Licence: Apache-2.0 License
JavaScript implementation of Gossipsub

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to js-libp2p-gossipsub

Rust Libp2p
The Rust Implementation of the libp2p networking stack.
Stars: ✭ 2,062 (+2613.16%)
Mutual labels:  peer-to-peer, libp2p
sharding-p2p-poc
Proof of Concept of Ethereum Serenity Peer-to-Peer Layer on libp2p PubSub System
Stars: ✭ 35 (-53.95%)
Mutual labels:  pubsub, libp2p
Js Ipfs
IPFS implementation in JavaScript
Stars: ✭ 6,129 (+7964.47%)
Mutual labels:  peer-to-peer, libp2p
network
Monorepo containing all the main components of Streamr Network.
Stars: ✭ 522 (+586.84%)
Mutual labels:  peer-to-peer, pubsub
sprawl
Alpha implementation of the Sprawl distributed marketplace protocol.
Stars: ✭ 27 (-64.47%)
Mutual labels:  peer-to-peer, libp2p
network-monorepo
Monorepo containing all the main components of Streamr Network.
Stars: ✭ 223 (+193.42%)
Mutual labels:  peer-to-peer, pubsub
p2p-forwarder
P2P Forwarder - a tool for farwarding tcp/udp ports. Made using libp2p.
Stars: ✭ 31 (-59.21%)
Mutual labels:  peer-to-peer, libp2p
ipfs-chat
Real-time P2P messenger using go-ipfs pubsub. TUI. End-to-end encrypted texting & file-sharing. NAT traversal.
Stars: ✭ 84 (+10.53%)
Mutual labels:  peer-to-peer, pubsub
azure-webpubsub
Azure Web PubSub Service helps you to manage WebSocket connections and do publish and subscribe in an easy way
Stars: ✭ 86 (+13.16%)
Mutual labels:  pubsub
VaporCoin
A peer-to-peer blockchain ledger, built with Swift, using Vapor
Stars: ✭ 68 (-10.53%)
Mutual labels:  peer-to-peer
bifrost
Communications library & daemon for Go. Modular transports, links, pubsub (NATS), quic-over-websocket, libp2p, RPC, encryption, testing, and more.
Stars: ✭ 63 (-17.11%)
Mutual labels:  peer-to-peer
numerifides
A proposal for a system of decentralized trust, built on an open, public blockchain.
Stars: ✭ 14 (-81.58%)
Mutual labels:  peer-to-peer
glitch
!NO MORE MAINTAINED! Reactive API Wrapper for Twitch in Kotlin/JVM
Stars: ✭ 12 (-84.21%)
Mutual labels:  pubsub
go-aws-msg
AWS Pub/Sub Primitives for Go
Stars: ✭ 22 (-71.05%)
Mutual labels:  pubsub
wsapix
Next generation Websocket framework for nodejs
Stars: ✭ 17 (-77.63%)
Mutual labels:  pubsub
tensorpeers
p2p peer-to-peer training of tensorflow models
Stars: ✭ 57 (-25%)
Mutual labels:  peer-to-peer
flask-redis-realtime-chat
A simple Flask realtime chat using Redis PubSub
Stars: ✭ 31 (-59.21%)
Mutual labels:  pubsub
subee
✉️ 🐝 It's not only a bee, but a message - Pub/Sub Worker Framework Implementation
Stars: ✭ 40 (-47.37%)
Mutual labels:  pubsub
py-multiaddr
multiaddr implementation in Python
Stars: ✭ 27 (-64.47%)
Mutual labels:  libp2p
cypherpoker.js
An open source peer-to-peer poker platform with cryptocurrency integration written in JavaScript.
Stars: ✭ 72 (-5.26%)
Mutual labels:  peer-to-peer

js-libp2p-gossipsub

Travis CI ES Version Node Version

Lead Maintainer

Cayman Nava

Table of Contents

Specs

Gossipsub is an implementation of pubsub based on meshsub and floodsub. You can read the specification here.

libp2p-gossipsub currently implements the v1.1 of the spec.

Install

npm install libp2p-gossipsub

Usage

const Gossipsub = require('libp2p-gossipsub')

const gsub = new Gossipsub(libp2p, options)

await gsub.start()

gsub.on('fruit', (data) => {
  console.log(data)
})
gsub.subscribe('fruit')

gsub.publish('fruit', new TextEncoder().encode('banana'))

API

Create a gossipsub implementation

const options = {}
const gossipsub = new Gossipsub(libp2p, options)

Options is an optional object with the following key-value pairs:

  • emitSelf: boolean identifying whether the node should emit to self on publish, in the event of the topic being subscribed (defaults to false).
  • gossipIncoming: boolean identifying if incoming messages on a subscribed topic should be automatically gossiped (defaults to true).
  • fallbackToFloodsub: boolean identifying whether the node should fallback to the floodsub protocol, if another connecting peer does not support gossipsub (defaults to true).
  • floodPublish: boolean identifying if self-published messages should be sent to all peers, (defaults to true).
  • doPX: boolean identifying whether PX is enabled; this should be enabled in bootstrappers and other well connected/trusted nodes (defaults to false).
  • msgIdFn: a function with signature (message) => string defining the message id given a message, used internally to deduplicate gossip (defaults to (message) => message.from + message.seqno.toString('hex'))
  • signMessages: boolean identifying if we want to sign outgoing messages or not (default: true)
  • strictSigning: boolean identifying if message signing is required for incoming messages or not (default: true)
  • messageCache: optional, a customized MessageCache instance, see the implementation for the interface.
  • scoreParams: optional, a customized peer score parameters Object.
  • scoreThresholds: optional, a customized peer score thresholds Object.
  • directPeers: optional, an array of AddrInfo of peers with which we will maintain direct connections.

For the remaining API, see libp2p-interfaces/pubsub.

Contribute

This module is actively under development. Please check out the issues and submit PRs!

License

MIT © ChainSafe Systems

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].