orbitdb / field-manual

The Offical User's Guide to OrbitDB
207 stars 43 forks source link

Why do we need to specify the database path if the manifest contains it? #58

Closed hazae41 closed 2 years ago

hazae41 commented 5 years ago

Or I didn't understand how it works?

phillmac commented 5 years ago

How did you get a manifest?

hazae41 commented 5 years ago

Here https://github.com/orbitdb/orbit-db/blob/master/GUIDE.md#manifest

phillmac commented 5 years ago

In most cases you are given the orbitdb address to begin with, then you have to fetch the manifest afterwards

hazae41 commented 5 years ago

Yes, so why do we need to add the path in the address if only the hash is needed?

RichardLitt commented 5 years ago

Are you talking about the first-database section in the /orbitdb/Qmd8TmZrWASypEp4Er9tgWP4kCNQnW4ncSnvjvyHQ3EVSU/first-database address?

hazae41 commented 4 years ago

Yes

aphelionz commented 4 years ago

Good question @hazae41 - the database name is required because it's used in the algorithm that generates that very hash. The (very crude) formula for the manifest hash is:

Database Name + ACL + database type.

So it allows you to have multiple databases of the same type, using the same ACL (typically maps to your OrbitDB instance or IPFS node).

However, we should go into more detail about this so I'm going to transfer this issue to the field manual repo for more writing.