Reference
Gateway API
An IPFS-style HTTP gateway over Portaldot. Every byte it returns has been checked against its CID.
Routes
GET /ipfs/<cid> | A file, verified. Raw leaves and UnixFS files. |
GET /ipfs/<cid>/ | A directory: index.html if present, otherwise a listing. |
GET /ipfs/<cid>/<path> | A file inside a directory, resolved one verified block per segment. |
?download=<name> | Adds Content-Disposition: attachment. |
?name=<name> | Picks the Content-Type from the extension. |
GET /api/file/<cid> | JSON: format, every block's (block, index, size), expiry and registry record. |
GET /api/stored | JSON: every TransactionStorage entry and the public registry records. |
GET /api/proofs | JSON: recent blocks' storage proofs and the next due block. |
Range requests
The gateway reads the UnixFS root's blockSizes, works out which leaves overlap the requested range, and fetches only those. A video can seek to minute 40 without downloading minutes 1 to 39. Responses over 32 MiB are served in windows with 206 Partial Content. Browsers continue with further ranges on their own.
Terminal
$ curl -sI -H "Range: bytes=5000000-5000099" https://potdrive.anshverma.tech/ipfs/bafykbzace…
HTTP/2 206
content-range: bytes 5000000-5000099/16777216
accept-ranges: bytes
x-potdrive-verified: blake2b-256Response headers
Content-Type | From ?name or the path extension, then the registry, then the first bytes. Sealed files are always application/octet-stream. |
Content-Security-Policy | sandbox allow-scripts … for HTML, SVG and JS. See the sandbox. |
Cache-Control | public, max-age=31536000, immutable. A CID never changes. |
ETag | The CID. If-None-Match gives 304. |
Access-Control-Allow-Origin | * |
X-Ipfs-Path | The resolved path, as IPFS gateways send it. |
Status codes
400 | Not a CIDv1 with a blake2b-256 multihash. |
404 | Not held by Portaldot (never stored, or expired), or no such path. |
416 | Range outside the file. |
502 | The node returned bytes that do not match the CID. Refused. |
503 | The Portaldot node did not answer. |