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

refactor: ping tutorial using tokio #5559

Merged
merged 2 commits into from
Aug 21, 2024
Merged

refactor: ping tutorial using tokio #5559

merged 2 commits into from
Aug 21, 2024

Conversation

P1R
Copy link
Contributor

@P1R P1R commented Aug 14, 2024

Description

Solves issue #5554 also referenced first in #4449

Notes & open questions

Differences between the ping example and the ping tutorial

Cargo.toml

  • libp2p missing features from tutorial in the example: "tls", "dns" "websocket", and "macros".
  • using latest version of the dependencies .

src/main.rs

  • SwarmBuilder tcp config does not implement tcp but noise instead.
  • Ping timeout in the tutorial is 30 seconds while in the example is Duration::from_secs(u64::MAX).

Procedure

  • Reviewed tutorial procedures can be verified here
  • Tutorial is located at the following path: libp2p/src/tutorials/ping.rs
  • It builds when located at libp2p using the following command: cargo doc --open

Conclusion: Followed the example code for the new tutorial version to standardize.

Change checklist

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • A changelog entry has been made in the appropriate crates

Copy link
Member

@jxs jxs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM Thanks! Btw you mentioned that in the tutorial the timeout is 30 seconds but it's in both u64::MAX

@P1R
Copy link
Contributor Author

P1R commented Aug 20, 2024

Yes, my error. When I was doing the review /verification of the tutorial steps, I got an incorrect version. I was following this one: https://docs.rs/libp2p/0.53.2/libp2p/tutorials/ping/index.html. But after I did follow up on building and verifying with the cargo doc --open

@jxs jxs added the send-it label Aug 21, 2024
@mergify mergify bot merged commit 4dfc45b into libp2p:master Aug 21, 2024
73 checks passed
TimTinkers pushed a commit to unattended-backpack/rust-libp2p that referenced this pull request Sep 14, 2024
Solves issue libp2p#5554 also referenced first in libp2p#4449

Pull-Request: libp2p#5559.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants