This repository was archived by the owner on Jul 22, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 58
Finished an initial version of GossipSub #15
Merged
Merged
Changes from 129 commits
Commits
Show all changes
131 commits
Select commit
Hold shift + click to select a range
fba4dee
Added README skeleton
Mikerah 5739dfd
Added skeleton Gossipsub class based on libp2p's floodsub class struc…
Mikerah 76cdd26
Added message directory and changed the rpc protobuf format
Mikerah bf78ed6
Created messageCache.js
Mikerah 72a11d4
Added dependencies for using protobufs and fixed the protobuf file fo…
Mikerah affafc8
Added peer.js and utils.js from js-libp2p-floodsub and added appropri…
Mikerah 33c9c54
Completed an initial implementation of the message cache for gossipsu…
Mikerah 112ed3a
Some preliminary refactoring
Mikerah b74ecc4
started implementation of control message handlers
Mikerah ceaea5f
More preliminary refactoring
Mikerah 6a46922
Added functions from js-libp2p-floodsub that might be relevant for im…
Mikerah c6a625d
Fixed some minor bugs
Mikerah bdf3228
Changed the return type of the get function in the message cache data…
Mikerah 8bbb62f
Completed handleIWant and handleIhave functions. Will do some tests l…
Mikerah a970bbb
Completed handleGraft
Mikerah 0e5d249
Completed all handle functions for the different ctrl msgs
Mikerah 2f55dbb
Changed code design. Decided to have GossipSub be a subclass of Flood…
Mikerah beae133
Did a little bit of clean up, added documentation and fixed non-worki…
Mikerah 74d186a
Added 2 helper functions from js-libp2p-floodsub
Mikerah ba72c5d
Completed subscribe function
Mikerah 56c3bed
Completed publish, subscribe and unsubscribe
Mikerah c7fd88a
Fixed constructor in messageCache.js
Mikerah 94e97d3
Completed initial version of heartbeat for managing the mesh
Mikerah e1e0dcb
Completed heartbeat functionality.
Mikerah 4b4dad4
updated package.json
Mikerah dfe820f
Updated repo structure
Mikerah 1570cd0
Started message cache tests and updated package.json
Mikerah 6757b14
All tests for the message cache except for shifting pass. Debugged me…
Mikerah bebeebf
Completed messageCache tests. Resolves #3
Mikerah 9167bb7
Renamed messageCache functions and made design changes regarding enco…
Mikerah 24851d6
Made changes to the README based on Vasco's suggestions
Mikerah 34e5d5a
Removed uneeded dependency in package.json
Mikerah eef548e
Made changes that Vasco suggested to the message cache data structure
Mikerah 0206925
Made changes to protobuf files as per Vasco's suggestions
Mikerah 2436b05
Renamed tests to test
Mikerah f5c6e6e
Added a constants.js file and updated index.js accordingly
Mikerah 9ad06cd
Minor edit to description of the fanout mapping.
vasco-santos 47930f4
Removed dependency from package.json
Mikerah dc2f1fc
Changed when heartbeatTimer is called and overrode both start and sto…
Mikerah ecfb30c
Switch from using setImmediate to nextTick as per Vasco's suggestion
Mikerah 91e5d42
Simplified conditionals statements as per Vasco's suggestions
Mikerah 5075903
Re-implemented heartbeat timer functionality.
Mikerah 11834c8
Updated package.json
Mikerah 7fa5df3
More debugging and started writing tests
Mikerah 24b3543
Updated package.json
Mikerah 7a5f16c
Fixed scoping bug affecting heartbeat function
Mikerah d8fa84c
Fixed typos
Mikerah 1edb911
Finally got a hold of starting to fix the subscribe functionality.
Mikerah 3da46f1
Updated comment for fanout map
vasco-santos 5e20f38
Updated comments
Mikerah 8786e25
Added changes requested by Vasco and Greg
Mikerah f1b11c0
Merge branch 'gossip_implementation' of github.com:ChainSafeSystems/g…
Mikerah bc0447e
Fixed conflicts
Mikerah 8b890db
linted 2-nodes.js
Mikerah 2ad2c05
linted constants.js
Mikerah 78e66f6
updated package.json
Mikerah 0b93b94
linted and bug fixes
Mikerah df7a597
Added Cayman's suggestions
Mikerah f953ad5
Fixed and debugged subscribe functionality
Mikerah 1bc3198
Debugged removing of peers once a connection ends
Mikerah 4144639
Updated package.json to include Vasco's suggestions
Mikerah b5313fd
Rewrote messageCache tests so that each test case is independent of e…
Mikerah c10747f
Add override tag to _onDial
vasco-santos 03bd5cb
Changed undefined tag to void tag
vasco-santos 26cc50f
Merge branch 'gossip_implementation' of github.com:ChainSafe/gossipsu…
Mikerah ecf7b7f
Changed the require statement for the rpc protobufs
vasco-santos 73b3adf
Fix heartbeatTimer
wemeetagain de8ea9c
Use rpc.RPC
wemeetagain 2b2b7db
Fix linter issues
wemeetagain ab0ab2f
Update libp2p-pubsub to 0.0.3
wemeetagain 1a173f1
Clean up packages version / lock
wemeetagain a2dc1cc
Clean up 2-node tests
wemeetagain 005ac63
Clean up _removePeer
wemeetagain e53e129
Clean up _rpcWithControl
wemeetagain cbe2db8
Clean up _handlePrune
wemeetagain 52cad48
Replace _nowInNano with _now
wemeetagain f157015
Add _sendRpc and piggyback functions
wemeetagain d6e3aee
Clean up subscribe/unsubscribe
wemeetagain 5fdac8e
Clean up publish
wemeetagain b0177b5
Clean up _heartbeat
wemeetagain e46f5a1
Clean up _processRpcMessages
wemeetagain 13b6d3d
Clean up _onRpc
wemeetagain 5cfa016
Clean up _handleIHave
wemeetagain fad2c9f
Clean up _handleIWant
wemeetagain b74ea23
Clean up _handleGraft
wemeetagain fefdef5
Clean up _sendGraft
wemeetagain b162fb5
Clean up _sendPrune
wemeetagain a912b6c
Fix stop comment
wemeetagain f527ae8
Clean up multiple-node tests
wemeetagain 3b9aa4d
Remove browser test
wemeetagain 03c518a
Move promisify to devDependencies
wemeetagain f82f474
Update libp2p-pubsub to 0.0.4
wemeetagain d776f16
Move devDependencies
wemeetagain 287dc05
Use newer style import for MessageCache
wemeetagain 8606234
Replace lets with consts
wemeetagain 916a2a6
Clean up rpc handling functions
wemeetagain fb3a7b5
Clean up start
wemeetagain 0488d47
Clean up stop
wemeetagain de067ad
Clean up subscribe
wemeetagain b476cc4
Clean up unsubscribe
wemeetagain 65d09f2
Add assert to publish
wemeetagain 369e929
Clean up piggyback
wemeetagain 4ccf644
Clean up _getPeers
wemeetagain ded7ef3
Clean up _sendGraftPrune
wemeetagain 1f350a7
Clean up rpc functions
wemeetagain 89c50a4
Clean up testing
wemeetagain 4ea637d
Add flush of gossip and control to heartbeat
wemeetagain d1e0e35
Refactor basic pubsub functionality
wemeetagain 37e3ca7
Remove travis commitlint step
wemeetagain f4e296e
Refactor heartbeat
wemeetagain bf1f731
Add message signing
wemeetagain f945810
Fix/simplify heartbeat
wemeetagain 7094830
Add heartbeat tests
wemeetagain 289cda2
Add mesh overlay tests
wemeetagain 40ca723
Fix gossiping
wemeetagain 6841dee
Add gossip tests
wemeetagain b89fe3f
Add messageCache test
wemeetagain f3d1b21
Fix gossip/control piggyback
wemeetagain e9dd2cc
Add piggyback test
wemeetagain 19bd1d4
Tweak multiple node test
wemeetagain a4c3937
Extend mesh timeout
wemeetagain 471a618
Extend heartbeat test margin of error
wemeetagain 55368cf
Fix mesh test check
wemeetagain 2c7123b
Update src/heartbeat.js
wemeetagain 3c76300
Update heartbeat error callback
wemeetagain 665a74c
Change pubsub noops to error throws
wemeetagain c9410bf
Bound test timeouts
wemeetagain 298ebd7
Remove file-wide eslint disables, lint
wemeetagain 10aa17c
Update readme
wemeetagain 8cba0c7
Increase test timeouts
wemeetagain 34f5c09
Increase test timeouts
wemeetagain File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,3 @@ | ||
| .idea/ | ||
| node_modules/ | ||
| package-lock.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,53 @@ | ||
| # gossipsub-js | ||
| [](https://travis-ci.com/ipfs/aegir) | ||
| Javascript implementation of Gossipsub | ||
|
|
||
|
Mikerah marked this conversation as resolved.
|
||
| ## Lead Maintainer | ||
|
|
||
| [Vasco Santos](https://github.com/vasco-santos) | ||
|
|
||
| ## Table of Contents | ||
|
|
||
| * [Specs](#specs) | ||
| * [Install](#Install) | ||
| * [Usage](#Usage) | ||
| * [API](#API) | ||
| * [Contribute](#Contribute) | ||
| * [License](#License) | ||
|
|
||
| ## Specs | ||
| Gossipsub 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). | ||
|
|
||
| ## Install | ||
|
|
||
| `npm install libp2p-gossipsub` | ||
|
|
||
| ## Usage | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you please complete the README.md first? References:
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it looks like the API documentation was autogenerated in both cases. |
||
|
|
||
| ```javascript | ||
| const Gossipsub = require('libp2p-gossipsub') | ||
|
|
||
| const gsub = new Gossipsub(node) | ||
|
|
||
| gsub.start((err) => { | ||
| if (err) { | ||
| console.log('Upsy', err) | ||
| } | ||
| gsub.on('fruit', (data) => { | ||
| console.log(data) | ||
| }) | ||
| gsub.subscribe('fruit') | ||
|
|
||
| gsub.publish('fruit', new Buffer('banana')) | ||
| }) | ||
|
|
||
| ``` | ||
|
|
||
| ## API | ||
|
|
||
| ## Contribute | ||
|
|
||
| This module is actively under development. Please check out the issues and submit PRs! | ||
|
|
||
| ## License | ||
|
|
||
| MIT © Protocol Labs | ||
Empty file.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.