Skip to content

Add ability to update the local root MFS CID? #8100

@kallisti5

Description

@kallisti5

Situation:

  1. I have a workstation with an MFS root that 100 users are mirroring.
  2. My workstation disk explodes.

User:

I'd like to reinstall IPFS, and "recover" that root MFS CID. I know the CID, and the data (and filesystem layout) is available on all the other pinned nodes. I really can't "replicate" my original data structure without changing the MFS layout.

The closest we came in Matrix was:
ipfs files cp $(ipfs resolve -r /ipns/hpkg.haiku-os.org) /hpkg.haiku-os.org

This wouldn't work since it would place the data at /{cid-of-that-dnslink}:
ipfs files cp $(ipfs resolve -r /ipns/hpkg.haiku-os.org) /

@lidel brought up in matrix discussions...

ack, for what its worth, it is also problematic the other way, ipfs files cp /ipns/hpkg.haiku-os.org /hpkg.haiku-os.org would make users think they copied a living directory that will get updated when dnslink gets changed, which is not the case (what is copied is static snapshot)
by requiring an immutable path, at least there is no ambiguity 
Would be cool to have a way to "pin" /ipns/ addrs in a way that follows updates, but its tricky to make a distinction betwen mutable and immutable, when you start mixing them in MFS.
We may end up having a separate primitive for this (some ideas in: https://github.com/ipfs/go-ipfs/issues/4435).
Curiously, this topic got brought up recently in the context of remote pinning services. As we have more services that can be used with pin remote commands, we may look into having ability to "pin" IPNS addr remotely, and have service automatically repin new CID every time IPNS pointer changes. Details TBD, but this sounds like useful pattern for website and dataset hosting.

Others have complained about this before:
https://discuss.ipfs.io/t/update-mfs-root-cid/7644

It looks like someone wrote an external tool to do it:
https://github.com/hsanjuan/mfs-replace-root

Metadata

Metadata

Assignees

Labels

kind/enhancementA net-new feature or improvement to an existing feature

Type

No type

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions