bee icon indicating copy to clipboard operation
bee copied to clipboard

feat: feed wrapping

Open nugaon opened this issue 1 year ago • 0 comments

This feature drops the JSON structure with CAC reference and timestamp in feed payload in order to be capable of wrapping a whole content addressed chunk instead. The feed payload resolution is backward compatible by checking the span + ts + swarmHash size in content and trying to retrieve the content under swarmHash.

Because the SOC content needs to be resolved in one request and there is no ts attribute of a feed anymore, the Feed API must be updated and it has breaking change on its GET endpoint. Additionally, at parameter is no longer in use at sequential feeds.

Since now feed endpoint can return content bigger than one chunk and that can be erasure coded, erasure-code related request headers have been added. Some application may use this endpoint to simply get the latest index of a sequential feed, for that new header is introduced swarm-only-root-chunk which is a boolean type and if it is true then Bee does not retrieve the whole chunk tree.

GET /soc/{owner}/{id} method is introduced with required path parameters owner and id which are hex encoded strings. This new method handles root chunk as a Single Owner Chunk by default and resolves and returns content similarly as GET /feed. Both endpoints return newly introduced header swarm-soc-signature which encodes the signature of the Single Owner Chunk in question.

  • [x] init joiner by root chunk
  • [x] update bootstrap
  • [x] update bzz and feeds api

Checklist

  • [x] I have read the coding guide.
  • [x] My change requires a documentation update, and I have done it.
  • [x] I have added tests to cover my changes.
  • [x] I have filled out the description and linked the related issues.

Description

Open API Spec Version Changes (if applicable)

Motivation and Context (Optional)

Related Issue (Optional)

Screenshots (if appropriate):

nugaon avatar May 15 '24 20:05 nugaon