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
Conversation
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.
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.
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/
protocols/relay/examples/relay.rs
Outdated
//! - `<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 |
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.
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
Good catch @r-zig. I pushed another commit. Want to take another look? |
@vmx could you give this pull request a review as a member of the libp2p Rust team? |
protocols/relay/examples/relay.rs
Outdated
//! 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. |
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.
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).
@vmx thanks for the review as well as testing this out! Would you mind taking another look? |
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.
Nice! To me that reads really clear now.
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