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

refactor: Move blob index logic from upload-api to blob-index lib #1434

Merged
merged 9 commits into from
May 14, 2024

Conversation

gammazero
Copy link
Contributor

The blob index logic should be an independent module as it will be used in both client and service code.

@gammazero gammazero marked this pull request as ready for review May 6, 2024 18:40
@gammazero gammazero requested a review from alanshaw May 6, 2024 18:40
@gammazero gammazero force-pushed the blob-index-lib branch 2 times, most recently from 124f574 to ddf591a Compare May 7, 2024 23:44
@gammazero gammazero changed the title Move blob index logic from upload-api to blob-index lib refactor: Move blob index logic from upload-api to blob-index lib May 8, 2024
packages/blob-index/src/sharded-dag-index.js Outdated Show resolved Hide resolved
packages/blob-index/src/sharded-dag-index.js Outdated Show resolved Hide resolved
packages/blob-index/src/sharded-dag-index.js Outdated Show resolved Hide resolved
packages/blob-index/package.json Show resolved Hide resolved
* @param {Uint8Array} carData
* @returns {Promise<ShardedDAGIndex>}
*/
export const fromArchive = async (carData) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what extract does above no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extract expects to read from a ReadableStream whereas fromArchive reads from a UInt8Array in memory. Does this mean that fromArchive should just convert the Uint8Array into a ReadableStream?

Also, extract will not know how to do things like discarding the overall dag shard from the encoded shards, before building the ShardedDAGIndex.

gammazero and others added 7 commits May 14, 2024 10:38
- Add fromArchive method
- Fix imports/exports
Co-authored-by: Alan Shaw <alan.shaw@protocol.ai>
Co-authored-by: Alan Shaw <alan.shaw@protocol.ai>
Co-authored-by: Alan Shaw <alan.shaw@protocol.ai>
@alanshaw alanshaw merged commit 797f628 into main May 14, 2024
15 checks passed
@alanshaw alanshaw deleted the blob-index-lib branch May 14, 2024 11:57
vasco-santos pushed a commit that referenced this pull request May 14, 2024
The blob index logic should be an independent module as it will be used
in both client and service code.

---------

Co-authored-by: Alan Shaw <alan.shaw@protocol.ai>
vasco-santos pushed a commit that referenced this pull request May 14, 2024
The blob index logic should be an independent module as it will be used
in both client and service code.

---------

Co-authored-by: Alan Shaw <alan.shaw@protocol.ai>
vasco-santos pushed a commit that referenced this pull request May 14, 2024
The blob index logic should be an independent module as it will be used
in both client and service code.

---------

Co-authored-by: Alan Shaw <alan.shaw@protocol.ai>
alanshaw pushed a commit that referenced this pull request May 14, 2024
🤖 I have created a release *beep* *boop*
---


## 1.0.0 (2024-05-14)


### Features

* move blob index logic from upload-api to blob-index lib
([#1434](#1434))
([797f628](797f628))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Alan Shaw <alan.shaw@protocol.ai>
travis added a commit that referenced this pull request May 14, 2024
🤖 I have created a release *beep* *boop*
---


##
[14.0.0](upload-api-v13.0.2...upload-api-v14.0.0)
(2024-05-14)


### ⚠ BREAKING CHANGES

* deprecate issuer
([#1344](#1344))

### Features

* add "plan/create-admin-session" capability
([#1411](#1411))
([50eeeb5](50eeeb5))
* add blob protocol to upload-client
([#1425](#1425))
([49aef56](49aef56))
* deprecate issuer
([#1344](#1344))
([afbbde3](afbbde3))
* move blob index logic from upload-api to blob-index lib
([#1434](#1434))
([797f628](797f628))
* remove issuer row
([#1345](#1345))
([cf5b0db](cf5b0db))


### Fixes

* `encodeURIComponent` on bucket origin
([#1448](#1448))
([5618644](5618644))
* add format specifier to blob location claim URL
([#1445](#1445))
([9982d12](9982d12))
* test against actual api
([#1438](#1438))
([f8132ca](f8132ca))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Travis Vachon <travis.vachon@protocol.ai>
fforbeck pushed a commit to storacha/upload-service that referenced this pull request Dec 19, 2024
🤖 I have created a release *beep* *boop*
---


## 1.0.0 (2024-12-02)


### Features

* move blob index logic from upload-api to blob-index lib
([storacha#1434](https://github.com/storacha/upload-service/issues/1434))
([797f628](797f628))
* router ([#11](#11))
([c810735](c810735))


### Fixes

* check for blob/accept receipts before blob/add is concluded
([storacha#1459](https://github.com/storacha/upload-service/issues/1459))
([462518c](462518c))
* missing blob-index deps
([storacha#1467](https://github.com/storacha/upload-service/issues/1467))
([deb8cc9](deb8cc9))
* repo URLs
([storacha#1550](https://github.com/storacha/upload-service/issues/1550))
([e02ddf3](e02ddf3))
* trigger release
([0bf74f4](0bf74f4))
* upload API test fixes
([6b0d72d](6b0d72d))
* use one-webcrypto from npm
([storacha#1525](https://github.com/storacha/upload-service/issues/1525))
([9345c54](9345c54))


### Other Changes

* Add `pnpm dev` to watch-build all packages
([storacha#1533](https://github.com/storacha/upload-service/issues/1533))
([07970ef](07970ef))
* **main:** release blob-index 1.0.0
([storacha#1449](https://github.com/storacha/upload-service/issues/1449))
([094442b](094442b))
* **main:** release blob-index 1.0.1
([storacha#1452](https://github.com/storacha/upload-service/issues/1452))
([3d9809f](3d9809f))
* **main:** release blob-index 1.0.2
([storacha#1468](https://github.com/storacha/upload-service/issues/1468))
([fb6e5a1](fb6e5a1))
* **main:** release blob-index 1.0.3
([storacha#1489](https://github.com/storacha/upload-service/issues/1489))
([fc71d31](fc71d31))
* **main:** release blob-index 1.0.4
([storacha#1526](https://github.com/storacha/upload-service/issues/1526))
([a79ea18](a79ea18))
* package renames
([0f797ed](0f797ed))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

2 participants