Wrapping my head around IPFS basics for newbies

I just downloaded ipfs and booted up a daemon. Fascinating software!!

I can see that I’m connected to 500+ peers around the world. If I add a file, will it be viewable to other peers, or only to those who have the address to the file?

When the file is added, is the data physically distributed or does it remain on my machine until others download a copy?

How can I view which files I’m hosting or delete files that I’ve added?

1 Like

Only those that have multihash for the file.I think there might be a way for people to monitor DHT traffic to find out which hashes your node is telling the DHT that you have, so I wouldn’t assume that anything added to IPFS with default settings is private.

It remains on your machine until others download a copy.

You can view items that you’ve pinned using ipfs pin ls (I typically use the --type=recursive option to only show things I’ve deliberately pinned.

If you want to remove any files that you’ve pinned you can do ipfs pin rm <multihash>. To remove anything you’ve downloaded but not pinned you can run the garbage collector using ipfs repo gc. I’m not sure if there’s a way or not to remove individual hashes that haven’t been pinned but have been cached on your node (without running the garbage collector).

1 Like

Good to know. So, I suppose you would want to encrypt any data that was to be shared within a smaller group of trusted nodes, if any files added with the ‘ipfs add’ command are publicly viewable with a bit of snooping.

The ipfs pin add command has the description “Stores an IPFS object(s) from a given path locally to disk.” while the ipfs get command has the description " Stores to disk the data contained [in] an IPFS or IPNS object(s) at the given path." These sound fairly similar.

Is it only the pin command that downloads a copy of an object to re-distribute upon subsequent peer requests?

Also… If I upload a folder, say of a website, then I want to update a few files in that folder, how would I go about updating those files, and how would I keep a reference pointing to the newest version of that folder?

ipfs pin add will add the data into IPFS’ local repository and pin it. ipfs get will download the file into your local filesystem and also cache it in the IPFS repo (but not pin it, so it could be garbage collected).

By default, doing an ipfs pin add, ipfs get or otherwise requesting content through IPFS will also make you a provider of the content. Pinning it just prevents the content from being garbage collected and will help ensure that the pinned content will remain alive on the network.

This can be done using IPNS. See the example below for some more information, but basically IPNS allows you to point a fixed IPNS address to an IPFS hash and publish new IPFS hashes to the fixed address over time as changes are made.

https://github.com/ipfs/examples/tree/master/examples/ipns

2 Likes

Hi - I am the same just started, I have uploaded a mp3 file that’s l an old song written by me in 1973 to play C&P the url in a new tab then it should play let me know -

http://localhost:8080/ipfs/QmdJqGKy8kXJDAk5WAay2zrrsAjY63K4ntuducxsNuT9bx

I used the GUI to upload the mp3 - http://localhost:5001/webui

also I have added - IPFS Station - to my google chrome, but it is not working

On macOS it plays fine in Safari, VLC, QuickTime Player 10 and even QuickTime Player 7, when opening/adding the URL.

Hi Jay when the mp3 is playing in VLC left double click VLC and you should see my picture let me know please

No embedded image, I’m afraid.

Thank you for looking.

IPFS Station just got a lot of love from @hacdias, check it out at https://github.com/ipfs-shipyard/station :slight_smile:

3 Likes