src/tutorials/hole-punching: Clarify use of libp2p-lookup & server IP (#2616)

This commit is contained in:
Wink Saville 2022-04-18 05:41:25 -07:00 committed by GitHub
parent c427bb3958
commit 0c1ac781a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -67,28 +67,53 @@
//! ``` //! ```
//! //!
//! Now let's make sure that the server is public, in other words let's make sure one can reach it //! Now let's make sure that the server is public, in other words let's make sure one can reach it
//! through the Internet. From the dialing client: //! through the Internet. First, either manually replace `$RELAY_SERVER_IP` in the following
//! commands or `export RELAY_SERVER_IP=ipaddr` with the appropriate relay server `ipaddr` in
//! the dailing client and listening client.
//!
//! Now, from the dialing client:
//! //!
//! 1. Test that you can connect on Layer 3 (IP). //! 1. Test that you can connect on Layer 3 (IP).
//! //!
//! ``` bash //! ``` bash
//! ping $RELAY_SERVER_IP //! ping $RELAY_SERVER_IP
//! ``` //! ```
//! //!
//! 2. Test that you can connect on Layer 4 (TCP). //! 2. Test that you can connect on Layer 4 (TCP).
//! //!
//! ``` bash //! ``` bash
//! telnet $RELAY_SERVER_IP 4001 //! telnet $RELAY_SERVER_IP 4001
//! ``` //! ```
//! //!
//! 3. Test that you can connect via libp2p using [`libp2p-lookup`](https://github.com/mxinden/libp2p-lookup). //! 3. Test that you can connect via libp2p using [`libp2p-lookup`](https://github.com/mxinden/libp2p-lookup).
//! //!
//! ``` bash //! ``` bash
//! ## For IPv4 //! ## For IPv4
//! libp2p-lookup direct --address /ip4/$RELAY_SERVER_IP //! libp2p-lookup direct --address /ip4/$RELAY_SERVER_IP/tcp/4001
//! ## For IPv6 //! ## For IPv6
//! libp2p-lookup direct --address /ip6/$RELAY_SERVER_IP //! libp2p-lookup direct --address /ip6/$RELAY_SERVER_IP/tcp/4001
//! ``` //! ```
//!
//! The libp2p-lookup output should look something like:
//!
//! ``` bash
//! $ libp2p-lookup direct --address /ip4/111.11.111.111/tcp/4001
//! Lookup for peer with id PeerId("12D3KooWDpJ7As7BWAwRMfu1VU2WCqNjvq387JEYKDBj4kx6nXTN") succeeded.
//!
//! Protocol version: "/TODO/0.0.1"
//! Agent version: "rust-libp2p/0.36.0"
//! Observed address: "/ip4/22.222.222.222/tcp/39212"
//! Listen addresses:
//! - "/ip4/127.0.0.1/tcp/4001"
//! - "/ip4/111.11.111.111/tcp/4001"
//! - "/ip4/10.48.0.5/tcp/4001"
//! - "/ip4/10.124.0.2/tcp/4001"
//! Protocols:
//! - "/libp2p/circuit/relay/0.2.0/hop"
//! - "/ipfs/ping/1.0.0"
//! - "/ipfs/id/1.0.0"
//! - "/ipfs/id/push/1.0.0"
//! ```
//! //!
//! ## Setting up the listening client //! ## Setting up the listening client
//! //!