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

README stored on disk is out of date/confusing #103

Open
aschmahmann opened this issue Feb 16, 2022 · 0 comments
Open

README stored on disk is out of date/confusing #103

aschmahmann opened this issue Feb 16, 2022 · 0 comments
Labels
exp/intermediate Prior experience is likely helpful kind/bug A bug in existing code (including security flaws) P2 Medium: Good to have, but can wait until someone steps up topic/docs Documentation

Comments

@aschmahmann
Copy link
Contributor

The README is misleading

go-ds-flatfs/readme.go

Lines 3 to 33 in f075020

var README_IPFS_DEF_SHARD = `This is a repository of IPLD objects. Each IPLD object is in a single file,
named <base32 encoding of cid>.data. Where <base32 encoding of cid> is the
"base32" encoding of the CID (as specified in
https://github.com/multiformats/multibase) without the 'B' prefix.
All the object files are placed in a tree of directories, based on a
function of the CID. This is a form of sharding similar to
the objects directory in git repositories. Previously, we used
prefixes, we now use the next-to-last two characters.
func NextToLast(base32cid string) {
nextToLastLen := 2
offset := len(base32cid) - nextToLastLen - 1
return str[offset : offset+nextToLastLen]
}
For example, an object with a base58 CIDv1 of
zb2rhYSxw4ZjuzgCnWSt19Q94ERaeFhu9uSqRgjSdx9bsgM6f
has a base32 CIDv1 of
BAFKREIA22FLID5AJ2KU7URG47MDLROZIH6YF2KALU2PWEFPVI37YLKRSCA
and will be placed at
SC/AFKREIA22FLID5AJ2KU7URG47MDLROZIH6YF2KALU2PWEFPVI37YLKRSCA.data
with 'SC' being the last-to-next two characters and the 'B' at the
beginning of the CIDv1 string is the multibase prefix that is not
stored in the filename.
`

FlatFS does not know anything about CIDs, blocks or IPLD and actually is being used by different projects in the ecosystem in different ways. In particular some key their IPLD blocks by CIDs and some by multihashes, but FlatFS doesn't really care. All the text around base32 encoding, CIDs, etc. should be removed and placed into the docs of the applications that use them (e.g. go-ipfs docs).

@aschmahmann aschmahmann added the need/triage Needs initial labeling and prioritization label Feb 16, 2022
@aschmahmann aschmahmann added topic/docs Documentation kind/bug A bug in existing code (including security flaws) P2 Medium: Good to have, but can wait until someone steps up exp/intermediate Prior experience is likely helpful and removed need/triage Needs initial labeling and prioritization labels Feb 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exp/intermediate Prior experience is likely helpful kind/bug A bug in existing code (including security flaws) P2 Medium: Good to have, but can wait until someone steps up topic/docs Documentation
Projects
None yet
Development

No branches or pull requests

1 participant