-
Notifications
You must be signed in to change notification settings - Fork 119
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: listUploads includes parts property with list of links to CARs that contain it #2347
Conversation
…(e.g. when token is not a magic test mode token)
example upload list item (note {
"_id": "2",
"type": "Upload",
"name": "rand-07270196086601688",
"created": "2024-01-09T01:17:28.22+00:00",
"updated": "2024-01-09T01:17:28.22+00:00",
"cid": "QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR",
"dagSize": 1000,
"pins": [
[
null
]
],
"partOf": [
"ipfs://bagbaiera6xcx7hiicm7sc523axbjf2otuu5nptt6brdzt4a5ulgn6qcfdwea"
],
"deals": []
} |
packages/db/db-client-types.ts
Outdated
@@ -218,6 +219,8 @@ export type UploadItemOutput = { | |||
dagSize?: definitions['content']['dag_size'] | |||
pins: Array<PinItemOutput>, | |||
deals: Array<Deal> | |||
// array of links to things containing this Upload (e.g. CARs) | |||
partOf: Array<string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just pluralise as parts
? I like that this is similar to a partition content claim.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do.
Just to check my understanding. Do we ever expect there to be more than one CAR that the Upload is sharded across? In my light testing it looked like only CARs with all blocks included. So I was thinking we could make a slightly different claim than just 'it's spread across these parts' but instead 'it's entirely within this CAR, i.e. it is a subset/partOf these CARs'.
Just now, I did make the change to call it parts
as you suggested.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can be multiple. If they send another CAR with the same root CID it should be added to the list.
Website preview 🔗✨ |
…storage sunset and being in read-only mode
08927ed
to
29ca2fa
Compare
@alanshaw Thanks for the review. I think I made changes for each of your requests, and now the tests here are green. I'll work in a branch off of this to add support for the backup table, but would love to test this part in staging++ and see how it goes. |
This patch would add in support for the backup table #2352 |
Co-authored-by: Alan Shaw <alan.shaw@protocol.ai>
✅ tested on staging ⚡ npm -s start -w packages/w3 -- list --json | head -n1 | jq .
{
"_id": "315318962269342672",
"type": "Car",
"name": "Upload at 2024-01-22T19:10:44.048Z",
"created": "2024-01-22T19:10:44.048+00:00",
"updated": "2024-01-22T19:10:44.048+00:00",
"cid": "bafybeieevwnu57cbcp5u6jsy6wxpj2waq5gfq5gc4spss4skpzk34vvxyy",
"dagSize": 8848144,
"pins": [
{
"status": "Pinned",
"updated": "2024-01-22T19:10:44.048+00:00",
"peerId": "bafzbeibhqavlasjc7dvbiopygwncnrtvjd2xmryk5laib7zyjor6kf3avm",
"peerName": "elastic-ipfs",
"region": null
}
],
"parts": [
"bagbaierakuersmo7wndedhwk43e5xwcpzwenuda3dhpcsvkfibewg5gxl7oa"
],
"deals": []
} that part CID corresponds to https://bafybeieevwnu57cbcp5u6jsy6wxpj2waq5gfq5gc4spss4skpzk34vvxyy.ipfs-staging.w3s.link/ |
🤖 I have created a release *beep* *boop* --- ## [7.24.0](api-v7.23.0...api-v7.24.0) (2024-01-22) ### Features * listUploads includes parts property with list of links to CARs that contain it ([#2347](#2347)) ([b870346](b870346)) --- 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>
Motivation: * add support for backup urls from backup table to #2347
Uses same approach and naming (parts) as web3.storage changes: web3-storage/web3.storage#2347 Closes #2674
Motivation:
npx @web3-storage/w3 list --json
should show CAR CIDs containing the data CID where possible #2343Why touch the sql files?