Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into feat/access-revamp
Browse files Browse the repository at this point in the history
  • Loading branch information
Gozala committed Jan 22, 2024
2 parents ff71d1b + 4f08972 commit 6e4bff5
Show file tree
Hide file tree
Showing 2 changed files with 90 additions and 2 deletions.
50 changes: 48 additions & 2 deletions w3-filecoin.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,11 @@ The issued receipt MUST have a `fx.fork` [effect] that links to the [`filecoin/s
}
```

##### Implementations

- `@web3-storage/capabilities` [`filecoin/offer` capability validator](https://github.com/web3-storage/w3up/blob/adb24424d1faf50daf2339b77c22fdd44faa236a/packages/capabilities/src/filecoin/storefront.js#L20)
- `@web3-storage/filecoin-api` [storefront `filecoin/offer` method](https://github.com/web3-storage/w3up/blob/e34eed1fa3d6ef24ce2c01982764f2012dbf30d8/packages/filecoin-api/src/storefront/service.js#L20)

#### `filecoin/accept`

This task is effectively a shortcut allowing an observer to find out the result of the [`filecoin/offer`] task chain without having to follow each step. The [Storefront] MUST issue a signed receipt with a [`DataAggregationProof`] result or an error.
Expand Down Expand Up @@ -298,6 +303,11 @@ This task is effectively a shortcut allowing an observer to find out the result
}
```

##### Implementations

- `@web3-storage/capabilities` [`filecoin/accept` capability validator](https://github.com/web3-storage/w3up/blob/adb24424d1faf50daf2339b77c22fdd44faa236a/packages/capabilities/src/filecoin/storefront.js#L82)
- `@web3-storage/filecoin-api` [storefront `filecoin/accept` method](https://github.com/web3-storage/w3up/blob/e34eed1fa3d6ef24ce2c01982764f2012dbf30d8/packages/filecoin-api/src/storefront/service.js#L123)

#### `filecoin/submit`

The task MUST be invoked by the [Storefront] which MAY be used to verify the offered content piece before propagating it through the pipeline.
Expand Down Expand Up @@ -365,6 +375,11 @@ If the added piece is invalid, the reason for the failure is also reported:
}
```

##### Implementations

- `@web3-storage/capabilities` [`filecoin/submit` capability validator](https://github.com/web3-storage/w3up/blob/adb24424d1faf50daf2339b77c22fdd44faa236a/packages/capabilities/src/filecoin/storefront.js#L50)
- `@web3-storage/filecoin-api` [storefront `filecoin/submit` method](https://github.com/web3-storage/w3up/blob/e34eed1fa3d6ef24ce2c01982764f2012dbf30d8/packages/filecoin-api/src/storefront/service.js#L82)

#### `filecoin/info`

An agent MAY invoke the `filecoin/info` capability to request known information about content piece in Filecoin. See [schema](#filecoininfo-schema).
Expand Down Expand Up @@ -455,6 +470,11 @@ An agent MAY invoke the `filecoin/info` capability to request known information
}
```

##### Implementations

- `@web3-storage/capabilities` [`filecoin/info` capability validator](https://github.com/web3-storage/w3up/blob/adb24424d1faf50daf2339b77c22fdd44faa236a/packages/capabilities/src/filecoin/storefront.js#L114)
- `@web3-storage/filecoin-api` [storefront `filecoin/info` method](https://github.com/web3-storage/w3up/blob/e34eed1fa3d6ef24ce2c01982764f2012dbf30d8/packages/filecoin-api/src/storefront/service.js#L239)

### _Aggregator_ Capabilities

#### `piece/offer`
Expand Down Expand Up @@ -506,6 +526,11 @@ An [Aggregator] MUST issue a signed receipt to acknowledge the received request.

See the [`piece/accept`] section for the subsequent task.

##### Implementations

- `@web3-storage/capabilities` [`piece/offer` capability validator](https://github.com/web3-storage/w3up/blob/e34eed1fa3d6ef24ce2c01982764f2012dbf30d8/packages/filecoin-client/src/aggregator.js#L22)
- `@web3-storage/filecoin-api` [aggregator `piece/offer` method](https://github.com/web3-storage/w3up/blob/main/packages/filecoin-api/src/aggregator/service.js#L19)

#### `piece/accept`

An [Aggregator] MUST issue a receipt for the [`piece/accept`] task for the offered piece that was included in an aggregate. The receipt MUST contain an [`InclusionProof`] in the result and an `fx.join` [effect] linking to [`aggregate/offer`] task, or an error detailing the reason.
Expand Down Expand Up @@ -542,6 +567,11 @@ An [Aggregator] MUST issue a receipt for the [`piece/accept`] task for the offer
}
```

##### Implementations

- `@web3-storage/capabilities` [`piece/accept` capability validator](https://github.com/web3-storage/w3up/blob/e34eed1fa3d6ef24ce2c01982764f2012dbf30d8/packages/filecoin-client/src/aggregator.js#L66)
- `@web3-storage/filecoin-api` [aggregator `piece/accept` method](https://github.com/web3-storage/w3up/blob/e34eed1fa3d6ef24ce2c01982764f2012dbf30d8/packages/filecoin-api/src/aggregator/service.js#L62)

### _Dealer_ Capabilities

#### `aggregate/offer`
Expand Down Expand Up @@ -611,7 +641,13 @@ The [Dealer] MUST issue a signed receipt to acknowledge the request. The issued

See the [`aggregate/accept`](#aggregateaccept) section for the subsequent task.

### `aggregate/accept`
##### Implementations

- `@web3-storage/capabilities` `aggregate/offer` [capability validator](https://github.com/web3-storage/w3up/blob/e34eed1fa3d6ef24ce2c01982764f2012dbf30d8/packages/capabilities/src/filecoin/dealer.js#L20)
- `@web3-storage/filecoin-api` [`piece/accept` method creates `aggregate/offer` delegation](https://github.com/web3-storage/w3up/blob/e34eed1fa3d6ef24ce2c01982764f2012dbf30d8/packages/filecoin-api/src/aggregator/service.js#L91)
- `@web3-storage/filecoin-api` [dealer service `aggregate/offer` method](https://github.com/web3-storage/w3up/blob/e34eed1fa3d6ef24ce2c01982764f2012dbf30d8/packages/filecoin-api/src/dealer/service.js#L14)

#### `aggregate/accept`

The [Dealer] MUST issue a receipt for the [`aggregate/accept`] task once it arranges deals with Storage Providers and they are live on the Filecoin chain. The receipt MUST either succeed with the [`DataAggregationProof`] or fail (with an `error` describing the problem with the `aggregate`).

Expand Down Expand Up @@ -670,6 +706,12 @@ If a deal fails due to an invalid piece, the issued receipt MUST contain `fx.for
}
```

##### Implementations

- `@web3-storage/capabilities` [`aggregate/accept` capability validator](https://github.com/web3-storage/w3up/blob/e34eed1fa3d6ef24ce2c01982764f2012dbf30d8/packages/capabilities/src/filecoin/dealer.js#L48)
- `@web3-storage/filecoin-api` [dealer `aggregate/offer` method ➡ `aggregate/accept` effect](https://github.com/web3-storage/w3up/blob/e34eed1fa3d6ef24ce2c01982764f2012dbf30d8/packages/filecoin-api/src/dealer/service.js#L69)
- `@web3-storage/filecoin-api` [dealer `aggregate/accept` method](https://github.com/web3-storage/w3up/blob/e34eed1fa3d6ef24ce2c01982764f2012dbf30d8/packages/filecoin-api/src/dealer/service.js#L92)

### _Deal Tracker_ Capabilities

#### `deal/info`
Expand Down Expand Up @@ -751,6 +793,11 @@ The invocation to the [Deal Tracker] MUST fail if the deal information for the a
}
```

##### Implementations

- `@web3-storage/capabilities` `deal/info` [capability validator](https://github.com/web3-storage/w3up/blob/e34eed1fa3d6ef24ce2c01982764f2012dbf30d8/packages/capabilities/src/filecoin/deal-tracker.js#L17)
- `@web3-storage/filecoin-api` [deal-tracker service `deal/info` method](https://github.com/web3-storage/w3up/blob/e34eed1fa3d6ef24ce2c01982764f2012dbf30d8/packages/filecoin-api/src/deal-tracker/service.js#L15)

## Schema

### Base types
Expand Down Expand Up @@ -784,7 +831,6 @@ type DealCapability union {
discriminantKey "can"
}


type PieceRef struct {
piece PieceLink
}
Expand Down
42 changes: 42 additions & 0 deletions w3-store.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,11 @@ If `status == 'upload'`, the response will include additional fields containing

The client should then make an HTTP `PUT` request to the `url` specified in the response, attaching all the included `headers`. The body of the request MUST be CAR data, whose size exactly equals the size specified in the `store/add` invocation's `size` caveat. Additionally, the CID of the uploaded CAR must match the invocation's `link` caveat. In other words, attempting to upload any data other than that authorized by the `store/add` invocation will fail.

#### Implementations

- @web3-storage/capabilities [`store/add` capability validator](https://github.com/web3-storage/w3up/blob/main/packages/capabilities/src/store.js#L30)
- @web3-storage/upload-api [`store/add` method](https://github.com/web3-storage/w3up/blob/5d52e447c14e7f7fd334e7ff575e032b7b0d89d7/packages/upload-api/src/store/add.js#L12)

### `store/get`

> Get metadata about a CAR shard from a space
Expand Down Expand Up @@ -205,6 +210,11 @@ interface StoreListItem {
}
```

#### Implementations

- @web3-storage/capabilities [store/get validator](https://github.com/web3-storage/w3up/blob/5d52e447c14e7f7fd334e7ff575e032b7b0d89d7/packages/capabilities/src/store.js#L90)
- @web3-storage/upload-api [store/get method](https://github.com/web3-storage/w3up/blob/5d52e447c14e7f7fd334e7ff575e032b7b0d89d7/packages/upload-api/src/store/get.js)

### `store/remove`

> Remove a stored CAR from a space
Expand Down Expand Up @@ -251,6 +261,11 @@ If a failure occurs, the response will have an `error` field with a value of `tr

On success, the response object will be empty.

#### Implementations

- @web3-storage/capabilities [store/remove validator](https://github.com/web3-storage/w3up/blob/5d52e447c14e7f7fd334e7ff575e032b7b0d89d7/packages/capabilities/src/store.js#L106)
- @web3-storage/upload-api [store/remove method](https://github.com/web3-storage/w3up/blob/5d52e447c14e7f7fd334e7ff575e032b7b0d89d7/packages/upload-api/src/store/remove.js#L11)

### `store/list`

> Obtain a list of stored CARs
Expand Down Expand Up @@ -327,6 +342,11 @@ interface StoreListItem {
}
```

#### Implementations

- @web3-storage/capabilities [store/list validator](https://github.com/web3-storage/w3up/blob/5d52e447c14e7f7fd334e7ff575e032b7b0d89d7/packages/capabilities/src/store.js#L126)
- @web3-storage/upload-api [store/list method](https://github.com/web3-storage/w3up/blob/5d52e447c14e7f7fd334e7ff575e032b7b0d89d7/packages/upload-api/src/store/list.js#L10)

## `upload/` namespace

The `upload/` namespace contains capabilities relating to "uploads", which represent user data that is contained in one or more CAR files that have previously been stored using [`store/add`](#storeadd).
Expand Down Expand Up @@ -402,6 +422,11 @@ interface UploadAddResponse {
}
```

#### Implementations

- @web3-storage/capabilities [upload/add validator](https://github.com/web3-storage/w3up/blob/5d52e447c14e7f7fd334e7ff575e032b7b0d89d7/packages/capabilities/src/upload.js#L54)
- @web3-storage/upload-api [upload/add method](https://github.com/web3-storage/w3up/blob/5d52e447c14e7f7fd334e7ff575e032b7b0d89d7/packages/upload-api/src/upload/add.js#L12)

### `upload/get`

> Get metadata about a upload from a space
Expand Down Expand Up @@ -464,6 +489,11 @@ interface UploadListItem {
}
```

#### Implementations

- @web3-storage/capabilities [upload/list validator](https://github.com/web3-storage/w3up/blob/5d52e447c14e7f7fd334e7ff575e032b7b0d89d7/packages/capabilities/src/upload.js#L142)
- @web3-storage/upload-api [upload/list method](https://github.com/web3-storage/w3up/blob/5d52e447c14e7f7fd334e7ff575e032b7b0d89d7/packages/upload-api/src/upload/list.js#L10)

### `upload/remove`

> Remove an upload from a space.
Expand Down Expand Up @@ -510,6 +540,11 @@ If a failure occurs, the response will have an `error` field with a value of `tr

On success, the response object will be empty.

#### Implementations

- @web3-storage/capabilities [upload/remove validator](https://github.com/web3-storage/w3up/blob/5d52e447c14e7f7fd334e7ff575e032b7b0d89d7/packages/capabilities/src/upload.js#L117)
- @web3-storage/upload-api [upload/remove method](https://github.com/web3-storage/w3up/blob/5d52e447c14e7f7fd334e7ff575e032b7b0d89d7/packages/upload-api/src/upload/remove.js#L11)

### `upload/list`

> Obtain a list of uploaded data items.
Expand Down Expand Up @@ -584,5 +619,12 @@ interface UploadListItem {
}
```

#### Implementations

- @web3-storage/capabilities [upload/list validator](https://github.com/web3-storage/w3up/blob/5d52e447c14e7f7fd334e7ff575e032b7b0d89d7/packages/capabilities/src/upload.js#L142)
- @web3-storage/upload-api [upload/list method](https://github.com/web3-storage/w3up/blob/5d52e447c14e7f7fd334e7ff575e032b7b0d89d7/packages/upload-api/src/upload/list.js#L10)

<!-- references -->

[ucan-spec-top]: https://github.com/ucan-wg/spec#52-top
[invocation-spec-pr]: https://github.com/web3-storage/specs/pull/34

0 comments on commit 6e4bff5

Please sign in to comment.