Lesson: Connect your node to the IPFS network
This lesson shows how to connect the IPFS node on your local computer to the IPFS network, or “the swarm”. Everything that you have done so far has been done locally. Now it gets a lot more interesting!
Prerequisites
To do the steps in this lesson you must:
Be familiar with using the command line
Install and Initialize IPFS on your local machine
Goals
After doing this Lesson you will be able to
Start the IPFS daemon to connect your local node to the IPFS network
Steps
Step 1: Start the IPFS daemon
Start the IPFS daemon by running
You will see output from the daemon like the following:
Notice that if you added files before running the daemon, the blocks will be advertised after a few seconds when the reprovider runs.
Step 2: Examine your ipfs node id info
Let's look at the details of your connections made by the daemon with ipfs id
. Open up another command line and run:
Note: The hashes above have been shortened for readability.
The "ID" field is your Peer ID, used to uniquely identify your node on the IPFS network. The "PublicKey" field goes along with your Peer ID, used under-the-hood by IPFS for public key cryptography. The "Addresses" shown are an array of IP addresses used for IPFS network traffic. Addresses using TCP port 4001 are known as "swarm addresses" that your local daemon will listen on for connections from other IPFS peers.
Step 3: Shutdown the daemon
You may shut down the daemon by typing Ctrl-C in the command line that you started with:
Note: You may run the IPFS daemon as a background process using the command ipfs daemon &
. If you want to stop the background process just type fg
(foreground) to bring that process to the foreground and stop it with Ctrl-C.
Explanation
You run the IPFS daemon in order to have your local IPFS node become part of the IPFS network and listen to other IPFS peers.
Next Lesson: Find Peers on the Network
Proceed to the next lesson to learn how to Find Peers on the Network
Last updated