1
0
mirror of https://github.com/oceanprotocol/docs.git synced 2024-06-29 00:58:02 +02:00

Update DDO spec to v4.1.0 (#1029)

* update to ddo 4.1.0 and add headers for url types

* update all refs to 4.1.0
This commit is contained in:
Alex Coseru 2022-06-21 15:35:19 +03:00 committed by GitHub
parent 63780c0a16
commit bd97c3b979
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,7 +5,7 @@ slug: /concepts/did-ddo/
section: concepts section: concepts
--- ---
**v4.0.0** **v4.1.0**
## Overview ## Overview
@ -80,7 +80,7 @@ A DDO in Ocean has these required attributes:
| ----------------- | --------------------------- | -------------------------------------------------------------------------------------------------------------- | | ----------------- | --------------------------- | -------------------------------------------------------------------------------------------------------------- |
| **`@context`** | Array of `string` | Contexts used for validation. | | **`@context`** | Array of `string` | Contexts used for validation. |
| **`id`** | `string` | Computed as `sha256(address of ERC721 contract + chainId)`. | | **`id`** | `string` | Computed as `sha256(address of ERC721 contract + chainId)`. |
| **`version`** | `string` | Version information in [SemVer](https://semver.org) notation referring to this DDO spec version, like `4.0.0`. | | **`version`** | `string` | Version information in [SemVer](https://semver.org) notation referring to this DDO spec version, like `4.1.0`. |
| **`chainId`** | `number` | Stores chainId of the network the DDO was published to. | | **`chainId`** | `number` | Stores chainId of the network the DDO was published to. |
| **`nftAddress`** | `string` | NFT contract linked to this asset | | **`nftAddress`** | `string` | NFT contract linked to this asset |
| **`metadata`** | [Metadata](#metadata) | Stores an object describing the asset. | | **`metadata`** | [Metadata](#metadata) | Stores an object describing the asset. |
@ -202,7 +202,17 @@ Example:
} }
``` ```
During the publish process, file URLs must be encrypted with a respective _Provider_ API call before storing the DDO on-chain. For this an array of objects defining the storage access details are sent. During the publish process, file URLs must be encrypted with a respective _Provider_ API call before storing the DDO on-chain. For this, you need to send the following object to Provider:
```json
{
"datatokenAddress":"0x1",
"nftAddress": "0x2",
"files": [
...
]
}
```
where "files" contains one or more storage objects.
Type of objects supported : Type of objects supported :
@ -221,7 +231,12 @@ Type of objects supported :
{ {
"type": "url", "type": "url",
"url": "https://url.com/file1.csv", "url": "https://url.com/file1.csv",
"method": "GET" "method": "GET",
"headers":
[
{"Authorization": "Bearer 123"},
{"APIKEY": "124"},
]
} }
] ]
``` ```
@ -263,17 +278,21 @@ A service can contain multiple files, using multiple storage types.
Example: Example:
```json ```json
[ {
{ "datatokenAddress":"0x1",
"type": "url", "nftAddress": "0x2",
"url": "https://url.com/file1.csv", "files": [
"method": "GET" {
}, "type": "url",
{ "url": "https://url.com/file1.csv",
"type": "ipfs", "method": "GET"
"hash": "XXXX" },
} {
] "type": "ipfs",
"hash": "XXXX"
}
]
}
``` ```
To get information about the files after encryption, the `/fileinfo` endpoint of _Provider_ returns based on a passed DID an array of file metadata (based on the file type): To get information about the files after encryption, the `/fileinfo` endpoint of _Provider_ returns based on a passed DID an array of file metadata (based on the file type):
@ -741,7 +760,7 @@ Example:
{ {
"@context": ["https://w3id.org/did/v1"], "@context": ["https://w3id.org/did/v1"],
"id": "did:op:ACce67694eD2848dd683c651Dab7Af823b7dd123", "id": "did:op:ACce67694eD2848dd683c651Dab7Af823b7dd123",
"version": "4.0.0", "version": "4.1.0",
"chainId": 1, "chainId": 1,
"nftAddress": "0x123", "nftAddress": "0x123",
"metadata": { "metadata": {