mirror of
https://github.com/oceanprotocol/docs.git
synced 2024-11-26 19:49:26 +01:00
Merge pull request #1137 from oceanprotocol/feature/data_storages
Added GraphQL, Arweave & On-Chain data storage types
This commit is contained in:
commit
27d1ad7fab
@ -219,39 +219,111 @@ During the publish process, file URLs must be encrypted with a respective _Provi
|
||||
|
||||
where "files" contains one or more storage objects.
|
||||
|
||||
Type of objects supported :
|
||||
**Type of objects supported:**
|
||||
|
||||
| Type | Description | Example |
|
||||
| ----- | ---------------------------------------- | ----------------------------------------------------------------- |
|
||||
| `url` | Static URL. Contains url and HTTP method | <pre class="language-json"><code class="lang-json">[</code></pre> |
|
||||
| { | | |
|
||||
**`URL`**
|
||||
|
||||
Static URLs.
|
||||
|
||||
Parameters:
|
||||
* `url` - File url
|
||||
* `method` - The HTTP method
|
||||
* `headers` - Additional HTTP headers
|
||||
|
||||
```
|
||||
"type": "url",
|
||||
"url": "https://url.com/file1.csv",
|
||||
"method": "GET",
|
||||
"headers":
|
||||
[
|
||||
{"Authorization": "Bearer 123"},
|
||||
{"APIKEY": "124"},
|
||||
]
|
||||
{
|
||||
"type": "url",
|
||||
"url": "https://url.com/file1.csv",
|
||||
"method": "GET",
|
||||
"headers":
|
||||
[
|
||||
{"Authorization": "Bearer 123"},
|
||||
{"APIKEY": "124"},
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
**`IPFS`**
|
||||
|
||||
The [Interplanetary File System](https://ipfs.tech/) (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
|
||||
|
||||
```
|
||||
{
|
||||
"type": "ipfs",
|
||||
"hash": "XXX"
|
||||
}
|
||||
```
|
||||
|
||||
**`GraphQL`**
|
||||
|
||||
[GraphQL](https://graphql.org/) is a query language for APIs and a runtime for fulfilling those queries with your existing data.
|
||||
|
||||
Parameters:
|
||||
* `url` - Server endpoint url
|
||||
* `query` - The query to be executed
|
||||
|
||||
```
|
||||
{
|
||||
"type": "graphql",
|
||||
"url": "http://172.15.0.15:8000/subgraphs/name/oceanprotocol/ocean-subgraph",
|
||||
"query": """query{
|
||||
nfts(orderBy: createdTimestamp,orderDirection:desc){
|
||||
id
|
||||
symbol
|
||||
createdTimestamp
|
||||
}
|
||||
}"""
|
||||
}
|
||||
```
|
||||
|
||||
**`On-Chain`**
|
||||
|
||||
Use a smart contract as data source.
|
||||
|
||||
Parameters:
|
||||
|
||||
* `chainId` - The chainId used to query the contract
|
||||
* `address` - The smartcontract address
|
||||
* `abi` - The function abi (NOT the entire contract abi)
|
||||
|
||||
```
|
||||
{
|
||||
"type": "smartcontract",
|
||||
"address": "0x8149276f275EEFAc110D74AFE8AFECEaeC7d1593",
|
||||
"abi": {
|
||||
"inputs": [],
|
||||
"name": "swapOceanFee",
|
||||
"outputs": [{"internalType": "uint256", "name": "", "type": "uint256"}],
|
||||
"stateMutability": "view",
|
||||
"type": "function",
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
**`Arweave`**
|
||||
|
||||
[Arweave](https://www.arweave.org/) is a decentralized data storage that allows to permanently store files over a distributed network of computers.
|
||||
|
||||
Parameters:
|
||||
* `transactionId` - The transaction identifier
|
||||
|
||||
```
|
||||
{
|
||||
{
|
||||
"type": "arweave",
|
||||
"transactionId": "a4qJoQZa1poIv5guEzkfgZYSAD0uYm7Vw4zm_tCswVQ",
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
} ] |
|
||||
|
||||
First class integrations supported in the future :
|
||||
|
||||
| Type | Description | Example |
|
||||
| ------ | ----------- | ----------------------------------------------------------------- |
|
||||
| `ipfs` | IPFS files | <pre class="language-json"><code class="lang-json">[</code></pre> |
|
||||
| { | | |
|
||||
|
||||
```
|
||||
"type": "ipfs",
|
||||
"hash": "XXX"
|
||||
```
|
||||
|
||||
} ] | | `filecoin` | Filecoin storage | | | `arwave` | Arwave | | | `storj` | Storj | | | `sql` | Sql connection, dataset is generated by a query | |
|
||||
**`Filecoin`**
|
||||
**`Storj`**
|
||||
**`SQL`**
|
||||
|
||||
A service can contain multiple files, using multiple storage types.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user