Let’s first solve Q1. So let’s say you have the following directory:
If you do
ipfs add -r my-directory from outside the directory, you should see output that looks like this:
added QmU2viJUREiEcFPgx5rzEVtB8psw1F49hYc5C7pS6pffpt my-directory/another-file.txt
added QmT78zSuBmuS4z925WZfrqQ1qHaJ56DQaTfyMUF7F8ff5o my-directory/index.html
added Qma2taWsdSfFHEWGZtN6XPdfNXCGdcGDoBgXERz4v1n9C9 my-directory
If you take the last hash,
Qma2taWsdSfFHEWGZtN6XPdfNXCGdcGDoBgXERz4v1n9C9 and load from your local node (by going to http://localhost:8080/ipfs/Qma2taWsdSfFHEWGZtN6XPdfNXCGdcGDoBgXERz4v1n9C9), you should see the contents of the
If that is working, but replacing
ipfs.io doesn’t load the
index.html file, you’re having some troubles with getting the public gateways to reach you. Make sure no firewalls are blocking port
4001 and it should be working.
If you can’t load locally added files from the gateway, something with your connection is not allowing IPFS to work properly and IPNS is probably not gonna work very well then either.