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

protocols/relay/examples: Add client server instructions #2060

Merged
merged 5 commits into from May 10, 2021

Conversation

mxinden
Copy link
Member

@mxinden mxinden commented Apr 28, 2021

Add instructions on how to run a three node example where a listening
relay client listens via a relay server and a dialing relay client dials
the listening relay client via the relay server.

//CC @r-zig

Add instructions on how to run a three node example where a listening
relay client listens via a relay server and a dialing relay client dials
the listening relay client via the relay server.
Copy link
Contributor

@r-zig r-zig left a comment

Choose a reason for hiding this comment

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

I think that the 3 client (the dial one) command should be with client-dial argument instead of client-listen and add /p2p/ before the listening client peer id:
`cargo run --example relay -- client-dial/p2p//p2p-circuit/p2p/

//! - `<peer-id-relay-server>` is replaced by the peer id of the relay server.
//!
//! 3. To start the dialing relay client run `cargo run --example relay -- client-listen
//! <addr-relay-server>/p2p/<peer-id-relay-server>/p2p-circuit/<peer-id-listening-relay-client>` in
Copy link
Contributor

Choose a reason for hiding this comment

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

suppose that the relay peer id is: QmRelay and the relay peer address is /ip6/::1/tcp/54443
the listening peer id is: QmListenPeer

cargo run --example relay -- client-dial /ip6/::1/tcp/54443/p2p/QmRelay/p2p-circuit/p2p/QmListenPeer

@mxinden
Copy link
Member Author

mxinden commented Apr 29, 2021

Good catch @r-zig. I pushed another commit. Want to take another look?

@mxinden
Copy link
Member Author

mxinden commented May 4, 2021

@vmx could you give this pull request a review as a member of the libp2p Rust team?

//! 2. To start the listening relay client run `cargo run --example relay -- client-listen
//! <addr-relay-server>/p2p/<peer-id-relay-server>/p2p-circuit` in a second terminal where:
//!
//! - `<addr-relay-server>` is replaced by one of the listening addresses of the relay server.
Copy link
Contributor

Choose a reason for hiding this comment

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

This is a language thing. I read "is replaced" as "it will automatically be replaced". I would write something like

  • <addr-relay-server>: one of the addresses the relay server is listening on
  • <peer-id-relay-server>: the local peer id of the relay server

This would also repeat the exact words the output of step 1 is using:

Local peer id: PeerId("12D3KooWAP5X5k9DS94n7AsiUAsaiso59Kioh14j2c13fCiudjdZ")
Listening on "/ip6/::1/tcp/36537"


(such example output could also be added to step 1).

@mxinden
Copy link
Member Author

mxinden commented May 10, 2021

@vmx thanks for the review as well as testing this out! Would you mind taking another look?

Copy link
Contributor

@vmx vmx left a comment

Choose a reason for hiding this comment

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

Nice! To me that reads really clear now.

@mxinden mxinden merged commit 43a8ad8 into libp2p:master May 10, 2021
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

Successfully merging this pull request may close these issues.

None yet

3 participants