Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

track: IPFS Repo #51

Closed
3 of 15 tasks
daviddias opened this issue Jan 14, 2016 · 9 comments
Closed
3 of 15 tasks

track: IPFS Repo #51

daviddias opened this issue Jan 14, 2016 · 9 comments
Labels
exp/expert Having worked on the specific codebase is important exp/novice Someone with a little familiarity can pick up help wanted Seeking public contribution on this issue

Comments

@daviddias
Copy link
Member

daviddias commented Jan 14, 2016

IPFS Repo is the storage driver for IPFS.

To learn more about the repo, you can

Implementation Roadmap

@daviddias daviddias added exp/novice Someone with a little familiarity can pick up help wanted exp/expert Having worked on the specific codebase is important labels Jan 26, 2016
@daviddias daviddias changed the title feature: repo repo Feb 23, 2016
@daviddias
Copy link
Member Author

Updated this issue

@daviddias daviddias mentioned this issue Feb 23, 2016
Closed
5 tasks
@hackergrrl
Copy link
Contributor

Hey @diasdavid. I have some questions about js-ipfs repo init that I could use some clarification on:

  1. What specifically does js-ipfs repo init need to do? I'm unclear on where repo init differs from ipfs init in this case. Do things like key generation happen here, or is that a separate non-repo init step? Some help on understanding the boundaries between repo initialization and general node init would be appreciated.
  2. According to the current API the user must specify an FS path to the IPFSRepo constructor: doesn't this lock the js-ipfs repo to the fs-repo implementation? What if I want an in-memory repo or something on S3?

Thanks!

@daviddias
Copy link
Member Author

Starting from the bottom:

According to the current API the user must specify an FS path to the IPFSRepo constructor: doesn't this lock the js-ipfs repo to the fs-repo implementation? What if I want an in-memory repo or something on S3?

You can find on the Architecture diagram on the README of js-ipfs-repo that an IPFS repo is constructed by several 'subrepos' or blob-store instances, to enable the user to have a repo running on fs, an in memory db, indexeddb, even a networkDB or mixed :)

The benefit of using abstract-blob-store is that paths are handled as keys and the blob store implementation deals with them. An fs-blob-store will deal with the key as a path, an level-blob-store will handle the key as a key. You can find other varieties here https://github.com/maxogden/abstract-blob-store#some-modules-that-use-this

In fact, you can see that js-ipfs-repo already has tests that run (with locks included) both in Node.js (with fs-blob-store) and in the browser (with indexedDB-blob-store) https://github.com/ipfs/js-ipfs-repo/tree/master/tests.

What specifically does js-ipfs repo init need to do? I'm unclear on where repo init differs from ipfs init in this case. Do things like key generation happen here, or is that a separate non-repo init step? Some help on understanding the boundaries between repo initialization and general node init would be appreciated.

repo init needs to ensure that a repo can be mounted with that base path/key and the blob-stores passed (making sure a repo doesn't exist there yet, for example)

ipfs init, will run repo init and then generate the peer Id (with respective private and pub key) and store the config object, the default blocks on the blockstore, etc.

I hope this makes it more clear, let me know if there are still questions :)

@hackergrrl
Copy link
Contributor

That helps, @diasdavid.

Doesn't this mean that all of the repo's stores must share the same key? What if that doesn't make sense in all implementations? E.g. I wish to store keys in fs-repo but the rest in index-db. I have to use an FS path like /home/stephen/ipfs/ to make fs-repo work, but this means the name in index-db will also be /home/stephen/ipfs/. You could imagine other combinations of stores where choosing a common repo path would be impossible (e.g. required vs disallowed chars).

Wouldn't it make more sense to either a) allow each store to specify its own key, or b) just use one store for the whole repo?

@daviddias
Copy link
Member Author

I made it this way because go-ipfs uses flatfs and levelDB simultaneously, which invalidates option b). On option a), fine by me, it didn't hurt anyone so far, but if you have a reason to add that to the API, I'm happy to take that PR :)

@hackergrrl
Copy link
Contributor

"repo root" has no meaning in js-ipfs then, correct? The repo here is defined as a map of abstract-blob-stores. Since there is no common store there can be no "root". It sounds like "repo init" is just "make sure that exists() fails on all stores".

@hackergrrl
Copy link
Contributor

Another question!

Why should we exposed ipfs repo init? Is there any reason why we'd want users to use this? Doesn't ipfs init cover this?

@daviddias
Copy link
Member Author

re: ipfs repo init yeah, we don't really need to expose that one :) (It was added to the list of features on the API spec some time ago)

@daviddias daviddias added help wanted Seeking public contribution on this issue and removed help wanted labels Apr 4, 2016
@daviddias
Copy link
Member Author

It would make sense to upgrade https://github.com/ipfs/js-ipfs-repo to be able to tell stats about the repo.

repo gc still requires the pinning still :)

@daviddias daviddias changed the title repo track: jsipfs repo Aug 15, 2016
@daviddias daviddias added status/ready Ready to be worked and removed js-ipfs-backlog labels Dec 5, 2016
@daviddias daviddias changed the title track: jsipfs repo track: IPFS Repo Jan 9, 2017
@daviddias daviddias added status/deferred Conscious decision to pause or backlog and removed status/ready Ready to be worked labels Jan 29, 2017
@daviddias daviddias removed the status/deferred Conscious decision to pause or backlog label Jul 7, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
exp/expert Having worked on the specific codebase is important exp/novice Someone with a little familiarity can pick up help wanted Seeking public contribution on this issue
Projects
None yet
Development

No branches or pull requests

2 participants