Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement needed functionality in JS libp2p libraries #11

Closed
8 tasks
Mikerah opened this issue Jan 18, 2019 · 7 comments
Closed
8 tasks

Implement needed functionality in JS libp2p libraries #11

Mikerah opened this issue Jan 18, 2019 · 7 comments

Comments

@Mikerah
Copy link
Contributor

Mikerah commented Jan 18, 2019

I posted an issue in the libp2p github to tell them that we will be adding some extra functionality to some of the JS libp2p libraries in order to make them work like the same Go libp2p libraries.

These are the libraries that we will need to work on (may be extended):

  • js-libp2p-connection-manager with go-libp2p-connmgr and corresponding interface

    • Peers in the JS implementation aren't tagged

    • JS implementation doesn't have a grace period

    • JS implementation has a different peer weighting mechanism than the Go implementation. Also the ranges of the weights differ.

    • Go implementation has a trimming heuristic for removing extra peer connections. JS implementation evicts connections on demand. There's an issue discussing these differences.

  • js-libp2p-peer-info. There isn't an associated Go module but there is the js-libp2p module uses this in addition to the peer store for managing information about peers. The Go equivalent is go-libp2p-host.

  • [ x ] The creation of a separate router module. The concept of a router doesn't really get introduced until gossipsub. In floodsub, we can get away without using a router. There is a go-libp2p-pubsub-router module that manages this for the Go implementations of pubsub protocols.

  • Add support for determining the protocol a peer supports to js-peer-info. This issue addresses this problem. We might have to add this functionality to the swarm (inconsistently, called switch in JS) module since it handles dialling into peers.

  • Add interoperability tests with go-libp2p-pubsub. The interoperability repository is still in development.

@Mikerah
Copy link
Contributor Author

Mikerah commented Jan 22, 2019

After the call with the libp2p team, they will be extracting the base protocol from js-libp2p-floodsub so that it can be used to build other protocols on top of the base protocol.

They are also in the process of writing interoperability tests for libp2p modelled on the ipfs interoperability tests. In the meantime, we can use the js-libp2p-daemon and go-libp2p-daemon.

They are still working out the details of the connection manager. So, the work on that can be done later.

@raulk
Copy link

raulk commented Jan 22, 2019

CC @vasco-santos @jacobheun

@vasco-santos
Copy link
Collaborator

I will keep you posted regarding the base protocol and interop tests moves!

@vasco-santos
Copy link
Collaborator

libp2p/js-libp2p-pubsub got its inital release and there is a PR for integrating it wth floodsub implementation libp2p/js-libp2p-floodsub#69.

We now can iterate on js-libp2p-pubsub implementation, according to other needs of gossipsub, as well as to improve documentation and add an example, as gossipsub is being implemented.

Important note: we will have to migrate both codebases (floodsub and pubsub) to use async iterators, instead of callbacks, and by then level up our documentation. When I get to the async iterators, I will have to prioritize the DHT, but in the second step I will go with the pubsub modules. Anyway, I would recommend that you guys start with async iterators if you are confortable, otherwise you will need to refactor this implementation afterward.

@raulk
Copy link

raulk commented Jan 25, 2019

@vasco-santos beautiful! Thanks for getting on this so quickly 💪

@Mikerah
Copy link
Contributor Author

Mikerah commented Jan 25, 2019

Thank you very much @vasco-santos and @raulk. We will definitely be using async iterators moving forward and I will continue to give feedback to the js-libp2p-pubsub module.

@Mikerah
Copy link
Contributor Author

Mikerah commented May 21, 2019

Done..

@Mikerah Mikerah closed this as completed May 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants