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

feat: Implement wnfs-unixfs-file crate for encoding big byte arrays in IPLD #375

Merged
merged 22 commits into from
Nov 30, 2023

Conversation

matheus23
Copy link
Member

This adopts some code from iroh-unixfs (from the beetle codebase, previously called "iroh").

The WNFS spec uses UnixFS files as the byte array encoding for public WNFS files.

We've previously put the burden on anyone using rs-wnfs to encode byte arrays and get a CID themselves, now we've got a mechanism inside rs-wnfs to do that. (E.g. previously we've done byte array en/decoding from javascript via js-ipfs-unixfs)

@matheus23 matheus23 self-assigned this Nov 29, 2023
@matheus23 matheus23 requested a review from a team as a code owner November 29, 2023 22:28
Copy link

codecov bot commented Nov 30, 2023

Codecov Report

Merging #375 (9e78912) into main (98d43cb) will increase coverage by 0.05%.
The diff coverage is n/a.

❗ Current head 9e78912 differs from pull request most recent head bf4f949. Consider uploading reports for the commit bf4f949 to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #375      +/-   ##
==========================================
+ Coverage   56.89%   56.95%   +0.05%     
==========================================
  Files          45       45              
  Lines        3334     3334              
  Branches      830      830              
==========================================
+ Hits         1897     1899       +2     
+ Misses        884      883       -1     
+ Partials      553      552       -1     

see 1 file with indirect coverage changes

@matheus23 matheus23 merged commit ce292b5 into main Nov 30, 2023
8 checks passed
@matheus23 matheus23 deleted the matheus23/unixfs branch November 30, 2023 21:16
matheus23 added a commit that referenced this pull request Dec 5, 2023
Previously we only had a CID-based API that just "set" the file CID to some value.

This now requires public files to encode their content as byte arrays.

Now the public and private APIs are very similar, both operate on the byte-array level for files.

Made possible through #375 

* feat: Write public files using bytes/streams instead of CID

* feat: Support wasm32 target (non-`Send` futures) in unixfs

* feat: Write wasm bindings for public file content r&w

* fix: Write exchange key itself, instead of CID of it

* chore: Write missing docs
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

Successfully merging this pull request may close these issues.

1 participant