-
Notifications
You must be signed in to change notification settings - Fork 160
feat: Implemented Bootstrap module in py-libp2p #711
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
base: main
Are you sure you want to change the base?
Conversation
@sumanjeet0012 : Huge thanks for this fantastic contribution! 🙌 Very much appreciate the effort you've put into implementing the Bootstrap module — this fills a critical gap in Also, thank you for taking the time to rebase the branch — once checked in, any remaining merge conflict issues can be resolved right away. Looking forward to reviewing the PR in detail soon — and let us know if you need any help there. |
5af1ff6
to
ddbd190
Compare
.gitignore
Outdated
bootstrap_instructions.txt | ||
.gitignore | ||
README.md |
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.
What are these about? If a bootstrap_instructions.txt is being generated somewhere, we should delete it rather than ignoring it.
I don't think we'd ever want to ignore a .gitignore or README.md file
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.
@pacrob The .gitignore file was pushed accidentally.
I was trying to create documentations using AI and accidently pushed it.
@pacrob I noticed that in js-libp2p, they include bootstrap node addresses such as Should I have checked the py-multiaddr repository and noticed that support for resolving DNS addresses has been recently added. However, I am unsure how to utilize this functionality within py-libp2p, as the resolve method does not currently appear to be available on the Multiaddress object. |
@sumanjeet0012 :Great question — and really appreciate you digging into how You're also spot-on about recent progress — the Right now, as you noticed, the
If you’re interested, we will be happy to help sketch out a small utility function to prototype this. Once we have that working, we could open a discussion or PR to integrate it more fully into the connection logic. Really excited to see you exploring this — it’s exactly the kind of cross-impl insight that strengthens the ecosystem. Let’s definitely move this forward! |
@sumanjeet0012 : Wish if you could add this to a new discussion page on bootstrap module. Me, @acul71 and @pacrob will discuss with you on py-multiaddrs there. Wish to keep the PR easy to navigate for new developers interested in contributing or extending your nice work on bootstrap module in py-libp2p. |
Hello @seetadev @sumanjeet0012
See here: |
@acul71 : Great, thank you so much for sharing. This is indeed very helpful. |
@acul71 Could you please try running the DNS resolution in py-libp2p using any example file? |
Since we don't still have access to py-multiaddr PyPi we have to find a way to use py-multiaddr not using dependency management via the standard PyPI mechanism (specifying the version in your project’s pyproject.toml or requirements.txt) requires an actual release.
|
@sumanjeet0012 Py-libp2p Multihash Compatibility Fix #751 |
…py-libp2p into feature/bootstrap
@sumanjeet0012 ERROR tests/core/crypto/test_ed25519.py - AttributeError: module 'multihash' ...
ERROR tests/core/crypto/test_rsa.py - AttributeError: module 'multihash' has ...
ERROR tests/core/crypto/test_ed25519.py - AttributeError: module 'multihash' ...
ERROR tests/core/crypto/test_rsa.py - AttributeError: module 'multihash' has ...
ERROR tests/core/crypto/test_secp256k1.py - AttributeError: module 'multihash...
ERROR tests/core/crypto/test_secp256k1.py - AttributeError: module 'multihash...
ERROR tests/core/examples/test_examples.py - AttributeError: module 'multihas...
ERROR tests/core/examples/test_examples.py - AttributeError: module 'multihas... should be caused by the new Do you have errors locally? |
@acul71 I have applied the patch locally and two tests were failing locally I will try to fix them. |
@sumanjeet0012 and @acul71 : Nice collaboration and great efforts indeed. Appreciate the continued momentum. Reviewing the PR in parallel as key changes are added. |
…py-libp2p into feature/bootstrap
What was wrong?
Bootstrap Module was not present in py-libp2p.
The py-libp2p library lacked a bootstrap discovery mechanism, which is essential for nodes to connect to predefined bootstrap peers when joining a network.
Issue #607
How was it fixed?
Implemented Bootstrap module in py-libp2p with the following key components:
1. Core Module Implementation
libp2p/discovery/bootstrap/
directory with:bootstrap.py
: MainBootstrapDiscovery
class that processes bootstrap peer addressesutils.py
: Address validation and peer info parsing utilities__init__.py
: Module exports2. Host Integration
bootstrap
parameter tonew_host()
function inlibp2p/__init__.py
BasicHost
andRoutedHost
classes to support bootstrap discovery3. Key Features
PeerInfo
objects4. Examples and Tests
examples/bootstrap/bootstrap.py
with CLI interfaceTo-Do
Cute Animal Picture