
Research
/Security News
Weaponizing Discord for Command and Control Across npm, PyPI, and RubyGems.org
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
@achingbrain/libp2p-gossipsub
Advanced tools
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.
npm install libp2p-gossipsub
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'))
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.
This module is actively under development. Please check out the issues and submit PRs!
MIT © ChainSafe Systems
FAQs
A typescript implementation of gossipsub
The npm package @achingbrain/libp2p-gossipsub receives a total of 26 weekly downloads. As such, @achingbrain/libp2p-gossipsub popularity was classified as not popular.
We found that @achingbrain/libp2p-gossipsub demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Socket researchers uncover how threat actors weaponize Discord across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Research
The Socket Threat Research Team is tracking weekly intrusions into the npm registry that follow a repeatable adversarial playbook used by North Korean state-sponsored actors.