Lesson: Find Peers on the Network
This lesson shows how to find and examine the peers you connect to on the IPFS network. You will use the ipfs swarm
and ipfs id
tools for this purpose. The swarm is the component that opens, listens for, and maintains connections to other IPFS peers. You can also examine connected peers and the network using the Web UI.
Prerequisites
To do the steps in this lesson you must:
Be running the
ipfs daemon
Goals
After doing this Lesson you will be able to
Find and examine peers on the IPFS network
Steps
Step 1: Start the IPFS daemon
Start the IPFS daemon by running
Step 2: Find peers that we are connected to
You can use the command ipfs swarm peers
to examine for connected peers:
Step 3: Examine a connected peer
You will use the ipfs id <hash>
command to examine a connected peer:
Note: The "ID" field shown above is the Peer's ID, and this was also the hash that was shown when you ran ipfs swarm peers
. Peers are identified on the network directly by their Peer ID.
Step 4: Examine using the Web UI
The IPFS daemon also serves up a modern Web UI that you are able to open in a browser. Did you notice when you started the daemon that there was the following?
WebUI: http://127.0.0.1:5001/webui
Open the link above in your browser. You will see the Web UI displayed with sections on Status, Files, Explore, Peers, and Settings. Click on the Peers section and you will see a world map indicating the location of connected peers. Scroll down the page to see information on each of the peers, their country/city location, network latency, Peer ID, etc. Spend some time looking at the other different sections of the Web UI.
Explanation
Once you have connected to the IPFS network by running the daemon, other IPFS nodes (peers) will begin to connect and communicate with your node. Using the commands ipfs swarm
and ipfs id
allows you to examine the connected nodes. The Web UI also shows in-depth information about peers.
Next Lesson: Retrieve content from a Peer
Proceed to the next lesson to learn how to Retrieve content from a Peer
Last updated