5

IPFS provides useful caching mechanism. My goal is to use IPFS caching mechanism without providing an online access.

Even I do not share the ipfs-hash of the file with other users, I want to disable probability for other users to access/pull that file I stored on my local IPFS directory, somehow if they find out the ipfs-hash of the file/folder.

=> If I don't run ipfs daemon would it be a solution? If yes, the problem is for some files I may need to use ipfs daemon to share them with other users or I also may need to pull files from other nodes. The problem rises that when I start running ipfs daemon this will enable access to all the files that is stored on the local ipfs folder.

[Q] So basically I want to use IPFS as a offline caching tool and do not provide outside access for some specific folders that I store in IPFS. Even ipfs daemon was running, could I disable online access for specific files/folders that I decide?

For example, I have multiple folders and I want to store them under local IPFS folder, where who ever has their ipfs-hash will not be get able to pull those files. Even ipfs daemon is running could I force those folders that is stored in local IPFS folder to have no outside access? and provide online access for some other folders.


As a solution, on my machine could I run two different IPFS processes having different local repository. First one is open to outside and can pull from other nodes etc. (running ipfs daemon); but other does not have any access to outside and no-one can access to its files.

alper
  • 2,919
  • 9
  • 53
  • 102

2 Answers2

6

You can run the daemon in offline-mode meaning it won't make any outside connections. You can do this by running ipfs daemon --offline and confirming that there is no swarm addresses outputted after starting the daemon.

Victor Bjelkholm
  • 2,177
  • 9
  • 28
  • 50
  • 1
    I want to use IPFS's caching mechanism to store files and folders for a purpose of a project I am working on. By default I want to store all the files as offline mode. Later, if it is required I want to give access to some specific files distributed to different nodes, while keeping others offline mode. Your answer `ipfs daemon --offline` lets all the files remain in offline mode no matter what. How could I allow some specific files able to be distributed on different nodes? Is it possible? – alper Oct 16 '18 at 20:15
3

In addition to the offline mode mentioned by Victor Bjelkholm, you can look into setting up a private swarm. For instructions, see https://github.com/ipfs/go-ipfs/blob/master/docs/experimental-features.md#private-networks

That way you have a node that can be connected to other nodes of yours with the same swarm key, it is absolutely impossible for this node to intentionally or accidentally connect to the public IPFS network.

Rüdiger Klaehn
  • 12,445
  • 3
  • 41
  • 57