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

GET /slice/:blake3_hash/:slice_index/:slice_range HTTP route #18

Open
cryptoquick opened this issue Mar 6, 2023 · 0 comments
Open

GET /slice/:blake3_hash/:slice_index/:slice_range HTTP route #18

cryptoquick opened this issue Mar 6, 2023 · 0 comments
Assignees

Comments

@cryptoquick
Copy link
Member

cryptoquick commented Mar 6, 2023

This allows storage clients to request a minimal subset of storage data.

This can optimize by the fact that slices are always 1KB, and segments are always 1MB, so only the specific segments needed will be verifiable.

Use this method for retrieving the slice: https://docs.rs/carbonado/latest/carbonado/fn.extract_slice.html

For now, let's only support a slice range of 1, since extract_slice only returns 1KB at a time.

The test for this should then take this slice data and run it through this method:
https://docs.rs/carbonado/latest/carbonado/fn.verify_slice.html

It will need to verify against the bao hash, not the blake hash, which corresponds to the segment. So, the catalog file will first be needed, which can be parsed using read_catalog, and then the bao hash corresponding to the slice index can be found.

Except for the last file, there should be 1024 slices to a segment, divide by 1024, the result should be the segment, and the remainder is the index within that segment.

The error for requesting a slice range other than one also will need to be handled.

@cryptoquick cryptoquick changed the title /slice/:blake3_hash/:slice_index/:slice_range GET HTTP route /slice/:blake3_hash/:slice_index/:slice_range GET HTTP route Mar 6, 2023
@cryptoquick cryptoquick changed the title /slice/:blake3_hash/:slice_index/:slice_range GET HTTP route GET /slice/:blake3_hash/:slice_index/:slice_range HTTP route Mar 7, 2023
@rustchain64 rustchain64 self-assigned this Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants