Specification of storage options for assets in Ocean Protocol.
Ocean does not handle the actual storage of files directly. The files are stored via other services which are then specified within the DDO.
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 (where "files" contains one or more storage objects):
The Interplanetary File System (IPFS) is a distributed file storage protocol that allows computers all over the globe to store and serve files as part of a giant peer-to-peer network. Any computer, anywhere in the world, can download the IPFS software and start hosting and serving files.
Parameters:
hash - The file hash,required
GraphQL
GraphQL
GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data.
Parameters:
url - Server endpoint URL, required
query - The query to be executed, required
headers - Additional HTTP headers, optional
Smart Contract Data
Use a smart contract as data source.
Parameters:
chainId - The chainId used to query the contract, required
address - The smartcontract address, required
abi - The function abi (NOT the entire contract abi), required
Arweave
Arweave is a decentralized data storage that allows permanently storing files over a distributed network of computers.
Parameters:
transactionId - The transaction identifier,required
First-class integrations supported in the future : FilecoinStorjSQL
A service can contain multiple files, using multiple storage types.
Example:
To get information about the files after encryption, the /fileinfo endpoint of the Provider returns based on a passed DID an array of file metadata (based on the file type):
This only concerns metadata about a file, but never the file URLs. The only way to decrypt them is to exchange at least 1 datatoken based on the respective service pricing scheme.