Colossus/route to ipfs gateway #1343
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Storage Node:
Route new asset URL/asset/v1/{contentID}to the IPFS HTTP Gateway running on the storage node.Routing
/asset/v0/{contentId}path to the IPFS HTTP Gateway running on the storage node.Currently the way the
/asset/v0/api works, handles range requests very inefficiently. Colossus opens a readable file stream and must read the stream to the point where it needs to 'seek' to return the requested range of bytes. This is due to a limitation in the streams api and lack of support for seeking in that stream. This was causing the storage node to consume a large amount of memory especially.So the alternative solution was to just proxy the http requests for accessing content to the IPFS HTTP gateway.
Pioneer, Helios and the storage cli tool was updated to use the new endpoint.
For correct functioning of the proxy middle ware the ipfs gateway needs to be configured to use paths and not subdomains which is the default config.
The recommended configuration when used with colossus can be applied with this command. (daemon should be restarted to take affect):
ipfs config --json Gateway.PublicGateways '{"localhost": null }'