-
-
Notifications
You must be signed in to change notification settings - Fork 276
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
[WIP] Integrating libp2p into Lodestar #154
Conversation
Just quickly glanced, we should be probably importing a libp2p library rather than a bunch of individual ones? |
@GregTheGreek The way it works is that if you don't need any specialized transports, multiplexers, etc and you can use the ones provided by libp2p, you need to add them to the project individually. The one that might be optional is FloodSub but I still imported so that when GossipSub is done, I can just replace the import. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very exciting, starting to take shape :)
@GregTheGreek I think this is as it should be re: importing libraries for now. libp2p takes a veeery modular approach, and we need all of these libraries to weave everything together properly. In fact, we probably will be adding even more libp2p libraries in the future! Its probably easier to start here, monorepo style, and once we've got things more solid, pull out into a separate repo/ repos, if it makes sense. |
@wemeetagain Fair enough, I iguess we have a lot to trimfrom the package.json anyways. |
@Mikerah would you be willing to do minor cleanup and plan on merging as is? |
@wemeetagain I can do minor cleanups and separate the TODO as separate PRs. My main bottleneck right now is that all the tests break due to odd compilation issues. Before merging, I would like to confirm that this is just an issue on my end and not everybody else's. |
I think what you're seeing is a result of our If you're using an IDE (or vim w/ plugins like typescript-vim and YouCompleteMe), it may be much easier, because the errors will be called out in the editor and potentially can be auto-fixed. |
The basics are in here and I will be opening subsequent PRs. @mpetrunic got the types working. |
Codecov Report
@@ Coverage Diff @@
## master #154 +/- ##
===========================================
- Coverage 52.79% 32.29% -20.51%
===========================================
Files 85 47 -38
Lines 1305 737 -568
Branches 123 64 -59
===========================================
- Hits 689 238 -451
+ Misses 590 499 -91
+ Partials 26 0 -26 |
The build is now passing. Awaiting approval... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few small async based comments, but also theres a lot of callback hell going on, using promisify
would really help
@GregTheGreek I think leaving the |
I think the point is we don't wan't both async an promisify librarys since they both do same job |
It looks like |
@wemeetagain |
You can remove the Edit: you should take a look at the typescript checking too ( |
This is currently a work in progress and breaks tests.
I have started integrating libp2p into Lodestar. A simple libp2p bundle has been created and is subject to change as more components get built out.
Here's a current TODO list:
Have a working basic server for managing peers
(Optional) Change part of the service API
Add RPC over libp2p to start integrating the ETH2.0 Wire Protocol
Add BDD tests to make sure networking is fine.