IPFS Primer
ipfs.ioIPFS Docs
  • Introduction
  • Tutorial: Install and Initialize IPFS
    • Lesson: Download and Install IPFS
    • Lesson: Initialize your IPFS Repository
  • Tutorial: Files on IPFS
    • Lesson: Add Content to IPFS and Retrieve It
    • Lesson: Wrap Filenames and Directory Info around Content
    • Lesson: Pinning - Tell IPFS to Keep a File
  • Tutorial: Going Online - Joining the Distributed Web
    • Lesson: Connect your node to the IPFS network
    • Lesson: Find Peers on the Network
    • Lesson: Retrieve content from a Peer
  • Tutorial: Interacting with the Classical (HTTP) Web
    • Lesson: Use an HTTP browser to retrieve files from local IPFS gateway
    • Lesson: Get content through the public ipfs.io gateway
    • Lesson: Access IPFS content through any IPFS gateway
  • Tutorial: The Myriad ways to Access and Distribute IPFS Content
    • The Power of Content-addressing
    • Retrieving content from a peer
    • Review these lessons from the Tutorial on Interacting with the Classical (HTTP) Web
      • Review: Using an HTTP browser to retrieve files from local IPFS gateway
      • Review: Using the public IPFS gateways at ipfs.io
      • Review: Access IPFS content through any IPFS gateway
    • Lesson: Access IPFS content through Tor gateways (experimental)
    • Lesson: Run IPFS over Tor transport (experimental)
    • Lesson: Access IPFS content through a browser extension
    • Lesson: Sneakernets - moving the data on USB Drives and other Hardware
  • Tutorial: Making Changes on the Permanent Web
    • Lesson: Create a Simple Webpage and Add It to IPFS
    • Lesson: View Your Webpage with IPFS and Publish to IPNS
    • Lesson: Modify Your Webpage and Republish to IPNS
    • Lesson: Generate and Use a New IPNS Name Keypair
  • Tutorial: Merkle Trees and the IPFS DAG
    • Lesson: Turn a File into a Tree of Hashes
    • Lesson: The Cryptographic Hash
    • Lesson: Build a Tree of Data in IPFS Using Cryptographic Hashes to Link the Pieces (a Merkle DAG)
    • Lesson: Explore the types of software that use hash trees to track data (to come)
  • Tutorial: Dynamic Content on IPFS
    • Disclaimer: Dynamic content on IPFS is a Work in Progress (to come)
    • Lesson: Add data to the DAG (locally) (to come)
    • Lesson: Tell peers about your Changes (to come)
    • Lesson: Use hashes to get someone's changes from IPFS (to come)
    • Lesson: Use a pub/sub strategy to pass around messages about changes (to come)
    • Lesson: Resolve conflicts with a merge strategy (CRDTs) (to come)
  • Privacy and Access Controls on the Distributed Web (to come)
    • Reader Privacy & Writer Privacy (to come)
    • Private Networks (to come)
    • Encrypting Content (to come)
    • More dynamic encryption: capabilities-based encryption (to come)
    • Comparing with the classic HTTP web (feudal security, etc) (to come)
  • Keeping Data Alive: Durable Data on the Permanent Web (to come)
    • IPFS Cluster (to come)
    • Filecoin (to come)
  • Distributed Computation (to come)
Powered by GitBook
On this page
  • Prerequisites
  • Goals
  • Steps
  • Step 1: Start the IPFS daemon
  • Step 2: Find peers that we are connected to
  • Step 3: Examine a connected peer
  • Step 4: Examine using the Web UI
  • Explanation
  • Next Lesson: Retrieve content from a Peer

Was this helpful?

Export as PDF
  1. Tutorial: Going Online - Joining the Distributed Web

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

$ ipfs daemon

Step 2: Find peers that we are connected to

You can use the command ipfs swarm peers to examine for connected peers:

$ ipfs swarm peers
/ip4/147.75.69.143/tcp/4001/ipfs/QmNn....GAJN
/ip4/147.75.83.83/tcp/4001/ipfs/QmbL....75Nb
/ip4/147.75.85.167/tcp/4001/ipfs/QmXA....qhfW
/ip6/2604:1380:0:c100::1/tcp/4001/ipfs/QmQC....uLTa
/ip6/2604:1380:3000:1f00::1/tcp/4001/ipfs/QmcZ....3dwt
/ip6/2604:1380:40b0:c00::3/tcp/4001/ipfs/QmYA....yYdN

Step 3: Examine a connected peer

You will use the ipfs id <hash> command to examine a connected peer:

$ ipfs id Qmf1...mx36
{
    "ID": "Qmf1....mx36",
    "PublicKey": "CAAS....AAE=",
    "Addresses": [
        "/ip4/127.0.0.1/tcp/4001",
        "/ip6/::1/tcp/4001",
        "/ip4/134.215.4.214/tcp/4001"
    ],
    "AgentVersion": "go-ipfs/0.4.21/8ca278f45",
    "ProtocolVersion": "ipfs/0.1.0"
}

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?

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

PreviousLesson: Connect your node to the IPFS networkNextLesson: Retrieve content from a Peer

Last updated 5 years ago

Was this helpful?

WebUI:

http://127.0.0.1:5001/webui