-
Notifications
You must be signed in to change notification settings - Fork 122
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
feat: add identify protocol example #537
base: main
Are you sure you want to change the base?
Conversation
Looking great, @acul71!
I've left a few notes throughout the code. Let me know what you think. |
TODO: Planning to add more tests
DONE
Changed name form protocol.py to identify.py as you suggested, removed comments. |
@acul71 @pacrob : This looks great. We will need to add the identify example along with the other 3 examples of py-libp2p. @pacrob : Thank you so much for your valuable guidance and helping us arrive at a good conclusion on Identify protocol example. The feedback shared is very helpful and will enable us to bootstrap other examples. Our longer term goal is to have atleast all the features and examples that we see at rust-libp2p(please visit https://github.com/libp2p/rust-libp2p/tree/master/examples ) and js-libp2p (please visit https://github.com/libp2p/js-libp2p-examples/tree/main/examples ). The feedback shared in this issue will be used in developing the other py-libp2p features and examples. @acul71 : Wish if you could also share a document adding @pacrob 's feedback and pointers (discussed in this pull request) for new devs interested in developing key examples in py-libp2p as shared above. |
py-libp2p Developer Guide: Feedback & Best Practices for ExamplesThis document compiles key feedback and pointers from recent code reviews and discussions. It is intended to serve as a reference for new contributors working on examples and core features for py-libp2p. Our goal is to align with the quality and functionality seen in rust-libp2p and js-libp2p examples. 1. Overview of py-libp2p Examplespy-libp2p aims to provide a Python implementation of libp2p protocols and features. Our longer-term goal is to match the breadth of features found in rust-libp2p examples and js-libp2p examples. The examples are not only demos but also act as living documentation for developers exploring protocol interactions. 2. Key Feedback from Recent Reviewsa. Testing and Quality Assurance
b. Code Organization and Naming Conventions
c. Examples and Demo Integration
3. Best Practices for Developing Examplesa. Consistency with Rust and JS Examples
b. Testing and Documentation
c. Feedback Incorporation Process
4. Next Steps for Contributors
5. Additional Resources
This guide should help streamline contributions and ensure consistency across the project. Please refer to it whenever you work on new examples or core features in py-libp2p. Let’s continue to build a robust and developer-friendly libp2p ecosystem in Python! |
I will add a video in the next days |
The Identify Protocol example was missing in
py-libp2p
, making it difficult for users to test and understand how the identify protocol works in a real peer-to-peer scenario.How was it fixed?
Added a standalone
identify.py
example demonstrating the Identify Protocol in action. The example sets up two hosts:The output includes details such as:
python identify.py First host listening. Run this from another console: python identify.py -p 8889 -d /ip4/0.0.0.0/tcp/8888/p2p/QmPF97e2nktakZVBzmn1uDGGZTaDyDLDtVR8MLLrH6UmYz Waiting for incoming identify request...
To-Do
Cute Animal Picture