{"id":14483627,"url":"https://github.com/ChainSafe/js-libp2p-gossipsub","last_synced_at":"2025-08-30T04:31:39.227Z","repository":{"id":37852623,"uuid":"144341841","full_name":"ChainSafe/js-libp2p-gossipsub","owner":"ChainSafe","description":"TypeScript implementation of Gossipsub","archived":false,"fork":false,"pushed_at":"2025-06-03T16:28:21.000Z","size":11533,"stargazers_count":160,"open_issues_count":28,"forks_count":52,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-08-29T10:04:46.478Z","etag":null,"topics":["gossip-protocol","javascript","libp2p","networking","p2p","peer-to-peer","pubsub"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ChainSafe.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-08-10T23:53:29.000Z","updated_at":"2025-08-25T16:43:23.000Z","dependencies_parsed_at":"2023-02-11T07:40:18.961Z","dependency_job_id":"e3b0f17d-8637-4230-a34c-c3c381639f8e","html_url":"https://github.com/ChainSafe/js-libp2p-gossipsub","commit_stats":{"total_commits":662,"total_committers":35,"mean_commits":"18.914285714285715","dds":0.6344410876132931,"last_synced_commit":"f62859b346474ff3e29d59e31449b15d60e054d6"},"previous_names":["chainsafe/gossipsub-js"],"tags_count":103,"template":false,"template_full_name":null,"purl":"pkg:github/ChainSafe/js-libp2p-gossipsub","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChainSafe%2Fjs-libp2p-gossipsub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChainSafe%2Fjs-libp2p-gossipsub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChainSafe%2Fjs-libp2p-gossipsub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChainSafe%2Fjs-libp2p-gossipsub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ChainSafe","download_url":"https://codeload.github.com/ChainSafe/js-libp2p-gossipsub/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChainSafe%2Fjs-libp2p-gossipsub/sbom","scorecard":{"id":28313,"data":{"date":"2025-08-11","repo":{"name":"github.com/ChainSafe/js-libp2p-gossipsub","commit":"2234bfa4bfcf296db19c3064f8b3945d2dc53e80"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4,"checks":[{"name":"Code-Review","score":8,"reason":"Found 15/17 approved changesets -- score normalized to 8","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"1 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/main.yml:1","Warn: no topLevel permission defined: .github/workflows/semantic-pr.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:47: update your workflow using https://app.stepsecurity.io/secureworkflow/ChainSafe/js-libp2p-gossipsub/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:48: update your workflow using https://app.stepsecurity.io/secureworkflow/ChainSafe/js-libp2p-gossipsub/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:57: update your workflow using https://app.stepsecurity.io/secureworkflow/ChainSafe/js-libp2p-gossipsub/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:58: update your workflow using https://app.stepsecurity.io/secureworkflow/ChainSafe/js-libp2p-gossipsub/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:67: update your workflow using https://app.stepsecurity.io/secureworkflow/ChainSafe/js-libp2p-gossipsub/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:68: update your workflow using https://app.stepsecurity.io/secureworkflow/ChainSafe/js-libp2p-gossipsub/main.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:79: update your workflow using https://app.stepsecurity.io/secureworkflow/ChainSafe/js-libp2p-gossipsub/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:86: update your workflow using https://app.stepsecurity.io/secureworkflow/ChainSafe/js-libp2p-gossipsub/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:89: update your workflow using https://app.stepsecurity.io/secureworkflow/ChainSafe/js-libp2p-gossipsub/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/ChainSafe/js-libp2p-gossipsub/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/ChainSafe/js-libp2p-gossipsub/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:31: update your workflow using https://app.stepsecurity.io/secureworkflow/ChainSafe/js-libp2p-gossipsub/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:32: update your workflow using https://app.stepsecurity.io/secureworkflow/ChainSafe/js-libp2p-gossipsub/main.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/ChainSafe/js-libp2p-gossipsub/main.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/semantic-pr.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/ChainSafe/js-libp2p-gossipsub/semantic-pr.yml/master?enable=pin","Warn: npmCommand not pinned by hash: .github/workflows/main.yml:19","Warn: npmCommand not pinned by hash: .github/workflows/main.yml:36","Warn: npmCommand not pinned by hash: .github/workflows/main.yml:52","Warn: npmCommand not pinned by hash: .github/workflows/main.yml:62","Warn: npmCommand not pinned by hash: .github/workflows/main.yml:72","Warn: npmCommand not pinned by hash: .github/workflows/main.yml:96","Info:   0 out of  12 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   3 third-party GitHubAction dependencies pinned","Info:   0 out of   6 npmCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/main.yml:73"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"13 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-x4c5-c7rf-jjgv","Warn: Project is vulnerable to: GHSA-h5c3-5r3r-rr8q","Warn: Project is vulnerable to: GHSA-rmvr-2pp2-xj38","Warn: Project is vulnerable to: GHSA-xx4v-prfh-6cgc","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-67mh-4wv8-2f99","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-c76h-2ccp-4975","Warn: Project is vulnerable to: GHSA-cxrh-j4jr-qwg3"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-14T18:26:48.626Z","repository_id":37852623,"created_at":"2025-08-14T18:26:48.627Z","updated_at":"2025-08-14T18:26:48.627Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272680464,"owners_count":24975267,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-29T02:00:10.610Z","response_time":87,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gossip-protocol","javascript","libp2p","networking","p2p","peer-to-peer","pubsub"],"created_at":"2024-09-03T00:01:55.314Z","updated_at":"2025-08-30T04:31:38.906Z","avatar_url":"https://github.com/ChainSafe.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# js-libp2p-gossipsub\n\n[![](https://img.shields.io/badge/made%20by-ChainSafe-blue.svg?style=flat-square)](https://chainsafe.io/)\n[![Travis CI](https://flat.badgen.net/travis/ChainSafe/gossipsub-js)](https://travis-ci.com/ChainSafe/gossipsub-js)\n![ES Version](https://img.shields.io/badge/ES-2017-yellow)\n![Node Version](https://img.shields.io/badge/node-10.x-green)\n\n## Table of Contents\n\n- [js-libp2p-gossipsub](#js-libp2p-gossipsub)\n  - [Lead Maintainer](#lead-maintainer)\n  - [Table of Contents](#table-of-contents)\n  - [Specs](#specs)\n  - [Install](#install)\n  - [Usage](#usage)\n  - [API](#api)\n    - [Create a gossipsub implementation](#create-a-gossipsub-implementation)\n  - [Contribute](#contribute)\n  - [License](#license)\n\n## Specs\n\nGossipsub is an implementation of pubsub based on meshsub and floodsub. You can read the specification [here](https://github.com/libp2p/specs/tree/master/pubsub/gossipsub).\n\n`libp2p-gossipsub` currently implements the [`v1.1`](https://github.com/libp2p/specs/blob/master/pubsub/gossipsub/gossipsub-v1.1.md) of the spec.\n\n## Install\n\n`npm install @chainsafe/libp2p-gossipsub`\n\n## Usage\n\n```javascript\nimport { gossipsub } from '@chainsafe/libp2p-gossipsub'\n\n\nconst libp2p = await createLibp2p({\n  // ...\n  services: {\n    pubsub: gossipsub(options)\n  }\n});\n\nlibp2p.services.pubsub.addEventListener('message', (message) =\u003e {\n  console.log(`${message.detail.topic}:`, new TextDecoder().decode(message.detail.data))\n})\n\nlibp2p.services.pubsub.subscribe('fruit')\n\nlibp2p.services.pubsub.publish('fruit', new TextEncoder().encode('banana'))\n```\n\n## API\n\n### Create a gossipsub implementation\n\n```js\nconst options = {…}\nconst gossipsub = gossipsub(options)(libp2p)\n```\n\nOptions is an optional object with the following key-value pairs:\n\n- **`emitSelf`**: boolean identifying whether the node should emit to self on publish, in the event of the topic being subscribed (defaults to **false**).\n- **`gossipIncoming`**: boolean identifying if incoming messages on a subscribed topic should be automatically gossiped (defaults to **true**).\n- **`fallbackToFloodsub`**: boolean identifying whether the node should fallback to the floodsub protocol, if another connecting peer does not support gossipsub (defaults to **true**).\n- **`floodPublish`**: boolean identifying if self-published messages should be sent to all peers, (defaults to **true**).\n- **`doPX`**: boolean identifying whether PX is enabled; this should be enabled in bootstrappers and other well connected/trusted nodes (defaults to **false**).\n- **`msgIdFn`**: a function with signature `(message) =\u003e string` defining the message id given a message, used internally to deduplicate gossip (defaults to `(message) =\u003e message.from + message.seqno.toString('hex')`)\n- **`signMessages`**: boolean identifying if we want to sign outgoing messages or not (default: `true`)\n- **`strictSigning`**: boolean identifying if message signing is required for incoming messages or not (default: `true`)\n- **`messageCache`**: optional, a customized `MessageCache` instance, see the implementation for the interface.\n- **`scoreParams`**: optional, a customized peer score parameters Object.\n- **`scoreThresholds`**: optional, a customized peer score thresholds Object.\n- **`directPeers`**: optional, an array of `AddrInfo` of peers with which we will maintain direct connections.\n\nFor the remaining API, see [@libp2p/interface-pubsub](https://github.com/libp2p/js-libp2p-interfaces/tree/master/packages/interface-pubsub).\n\n## Contribute\n\nThis module is actively under development. Please check out the issues and submit PRs!\n\n## License\n\nMIT © ChainSafe Systems\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FChainSafe%2Fjs-libp2p-gossipsub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FChainSafe%2Fjs-libp2p-gossipsub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FChainSafe%2Fjs-libp2p-gossipsub/lists"}