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

Allow to download blocks of other types as raw block. #7158

Closed
ivan386 opened this issue Apr 14, 2020 · 3 comments
Closed

Allow to download blocks of other types as raw block. #7158

ivan386 opened this issue Apr 14, 2020 · 3 comments
Labels
kind/feature A new feature

Comments

@ivan386
Copy link
Contributor

ivan386 commented Apr 14, 2020

This allow to download file from gateways by blocks and check it hashes by simple fetch.

Example:

  1. Original CID:
    Qmd3Gk5XmBrywwV5sdg8K24FqwQj6qmUMrin9tTvfaJdEc - return file
  2. Change to CID Base16 and Version 1:
    f01 70 1220da6b97d622ca3a8eca04f50438984eaad72c1d3f39a7a4678d8249ba038a68dd - return file
  3. Change Type from MerkleDAG protobuf(0x70) to raw binary(0x55):
    f01 55 1220da6b97d622ca3a8eca04f50438984eaad72c1d3f39a7a4678d8249ba038a68dd - must return block with that hash

Gateway have block with that hash* but return "504 Gateway Time-out"

*sha2-256-da6b97d622ca3a8eca04f50438984eaad72c1d3f39a7a4678d8249ba038a68dd

@ivan386 ivan386 added the kind/feature A new feature label Apr 14, 2020
@Stebalien
Copy link
Member

Use the block API on the read-only gateway: GATEWAY/api/v0/block/get/Qm....

@ivan386
Copy link
Contributor Author

ivan386 commented Apr 14, 2020

@Stebalien api not available on most public gateways. Only ipfs.io and gateway.ipfs.io give access to api. Others return 401, 403, 404, 502 errors.

But point is that type of block is only information for gateway how to read it. And if gateway have that block with other type why do not return it as raw block if we ask it as raw block?

I can download that block and upload it as raw but this wrong way.

@Stebalien
Copy link
Member

Stebalien commented Apr 14, 2020

We're not going to add a feature specifically to allow abusing the gateway's file endpoint to download raw blocks. If the user has blocked the read-only API and only allows the /ipfs endpoint, that's their decision.

Anyways, this hack will likely "just work" once we address ipfs/specs#242. However, I don't consider this to be a desired feature of the ipfs gateway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature A new feature
Projects
None yet
Development

No branches or pull requests

2 participants