Skip to content

Conversation

alanshaw
Copy link
Member

@alanshaw alanshaw commented Sep 3, 2025

Implements storacha/RFC#65

This PR adds filepack data archive sharding as the default sharding format for uploadFile and uploadDirectory. A filepack data archive is just the concatenated bytes of all blocks of the DAG. The index makes sense of the data. Using a filepack data archive saves space, making uploads faster as well as making retrievals faster, since file bytes are mostly contiguous within an archive.

uploadCAR still uses the CAR sharder - I feel like uploading a CAR should always upload a CAR...

🎥 Demo

BREAKING CHANGE: There is a small change to upload/add. Previously it accepted only shards with the CAR IPLD codec, but now it also accepts shards with raw IPLD codec (i.e. filepack archives).

Additionally uploadFile and uploadDirectory will use filepack format by default for shards. This behaviour is configurable - you can pass sharder: (options) => new CARShardingStream(options) as an option in order to use the CAR sharder.

@alanshaw alanshaw changed the title feat filepack feat: filepack Sep 3, 2025
@alanshaw alanshaw marked this pull request as ready for review September 6, 2025 07:24
@alanshaw alanshaw requested a review from travis as a code owner September 6, 2025 07:24
@alanshaw alanshaw requested a review from a team September 6, 2025 07:25
@alanshaw alanshaw changed the title feat: filepack feat!: use filepack format for encoding shards by default for uploadFile and uploadDirectory Sep 8, 2025
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