Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moving Qri's IPFS repo into the .qri folder #1319

Closed
1 of 6 tasks
b5 opened this issue Apr 29, 2020 · 4 comments · Fixed by #1398
Closed
1 of 6 tasks

Moving Qri's IPFS repo into the .qri folder #1319

b5 opened this issue Apr 29, 2020 · 4 comments · Fixed by #1398
Assignees
Labels
qfs qri filesystem persistence issues (includes IPFS persistence issues) refactor A code change that neither fixes a bug nor adds a feature
Milestone

Comments

@b5
Copy link
Member

b5 commented Apr 29, 2020

Background for why we're doing this: #1225

Migrating Qri's configuration

We should time these changes with our overhaul of qri's configuration, updating the config RFC to talk about removing support for IPFS_PATH. Instead the ipfs repo path should be part of the new filesystem configuration, specific to the local IPFS qfs.Filestore. Doing it this way both removes configuration ambiguity, and allows users to get the old behavior back by specifying ~/.ipfs as the repo path.

To make this transition as clean as possible, I think we should use a completely new IPFS config, with a new keypair. This'll mean users running on the libp2p network won't appear as the same peer. Yet another reason I'm thankful we connected user data to a separate keypair held by Qri.

Moving Qri data from one IPFS repo to another

We're going to need a tool for detangling the hashes in an IPFS repo that Qri relies on, both to move those hashes to another repo, and to unpin those hashes from the original repo.

Using non-default ports for IPFS configuration

The other part of privatizing our IPFS instance is to move off of the default port configurations for our IPFS node.

We can leverage this move to a private configuration to set ports to non-standard ones. One option is to use 0 for port numbers, which defaults to an open port.

Steps to complete:

note: need to finish this list

  • ratify the latest config RFC: RFC: overhaul configuration rfcs#51.
  • write an IPFS repo migration tool for moving data between repositories
  • write an IPFS-repo-move function:
    • create a new IPFS repo at .qri/ipfs, new keypair and all
    • edit port configuration to use nonstandard ports
    • run the IPFS repo migration, moving over any Qri hashes to the new repo
  • write a qri config migration that also triggers the move
  • remove support for IPFS_PATH env var
  • add documentation that for users that want to customize IPFS behavior: they need to edit the config within .qri/ipfs.
@b5 b5 added the refactor A code change that neither fixes a bug nor adds a feature label Apr 29, 2020
@b5 b5 added this to the v0.9.9 milestone Apr 29, 2020
@b5 b5 mentioned this issue Apr 29, 2020
8 tasks
@b5 b5 added the qfs qri filesystem persistence issues (includes IPFS persistence issues) label Apr 29, 2020
@dustmop
Copy link
Contributor

dustmop commented Apr 30, 2020

We're going to need a tool for detangling the hashes in an IPFS repo that Qri relies on, both to move those hashes to another repo, and to unpin those hashes from the original repo.

My vote for this is to keep the implementation simple. Copy everything from the old ~/.ipfs to ~/.qri/ipfs and hope that we get qri storage clean implemented soon. The only case where this causes problems is a user who has stored a ton in IPFS already then starts using qri before the migration happens, and the only negative consequence is that they temporarily lose some disk space. I would bet implementing a smarter alternative would take more work than implementing qri storage clean.

@b5
Copy link
Member Author

b5 commented Apr 30, 2020

very into that idea. Sounds far less error prone

@Arqu
Copy link
Contributor

Arqu commented Apr 30, 2020

My only concern here is while we are going to heavily test the migration suite, issues can still occur. One thing I'd definitely want in this is a rollback mechanism and maybe dual compatibility for a while until we get over the hump with some sort of sunset period.

Currently a curse and a blessing that we don't have too many heavy users to make such a large change.

@feep
Copy link
Contributor

feep commented May 4, 2020

I like keeping .qri’s stuff together.

...but.

I am not sure what is in ~/.ipfs from reading filenames, it looks like configuration and one or both of cache & user data.

That’s a complicated case, but there are official places for those bits.

I put more about this in #1319.

It’s complicated, but now is probably the best time to consider it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
qfs qri filesystem persistence issues (includes IPFS persistence issues) refactor A code change that neither fixes a bug nor adds a feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants