2022-07-11 12:32:52 +02:00
|
|
|
# Deploying Provider
|
|
|
|
|
|
|
|
### About Provider
|
|
|
|
|
2023-04-04 08:15:27 +02:00
|
|
|
Provider encrypts the URL and metadata during publish and decrypts the URL when the dataset is downloaded or a compute job is started.
|
|
|
|
It enables the access to data assets by streaming data (and never the URL).
|
|
|
|
It performs checks on chain for buyer permissions and payments. It also Provides compute services (connects to C2D environment).
|
|
|
|
It is a multichain component, meaning that with the proper configurations it can handle these tasks on multiple chains.
|
|
|
|
The source code of Provider can be access from [here](https://github.com/oceanprotocol/provider).
|
2022-07-11 15:57:54 +02:00
|
|
|
|
2022-07-11 12:32:52 +02:00
|
|
|
### Prerequisites
|
|
|
|
|
|
|
|
* Docker and Docker compose are installed. Click [here](https://docs.docker.com/engine/install/) to view guide on installing docker.
|
2022-08-03 12:59:05 +02:00
|
|
|
* [Obtain an API key](../using-ocean-libraries/configuration.md#obtaining-api-key-for-ethereum-node-provider)
|
2022-07-11 12:32:52 +02:00
|
|
|
|
|
|
|
### Create a working directory
|
|
|
|
|
|
|
|
```
|
|
|
|
mkdir Provider
|
|
|
|
cd Provider
|
|
|
|
```
|
|
|
|
|
|
|
|
### Create a \`.env\` file
|
|
|
|
|
|
|
|
Copy the below content into the \`.env\` file and edit the values as needed.
|
|
|
|
|
|
|
|
{% code title=".env" %}
|
|
|
|
```
|
|
|
|
# Mandatory variables
|
|
|
|
|
|
|
|
# Update the value to the appropriate tag from here: https://hub.docker.com/r/oceanprotocol/provider-py/tags
|
|
|
|
PROVIDER_VERSION=latest
|
|
|
|
PROVIDER_PRIVATE_KEY=<private-key>
|
|
|
|
NETWORK_URL=<api-key>
|
|
|
|
AQUARIUS_URL=<aquarius-url>
|
|
|
|
```
|
|
|
|
{% endcode %}
|
|
|
|
|
|
|
|
### Create docker-compose file
|
|
|
|
|
2022-09-23 15:13:28 +02:00
|
|
|
{% hint style="info" %}
|
|
|
|
Set the value of OCEAN\_PROVIDER\_WORKERS to 2 or more to avoid a race condition when provider checks whether it should call a remote provider or not.
|
|
|
|
{% endhint %}
|
|
|
|
|
2022-07-11 12:32:52 +02:00
|
|
|
{% code title="docker-compose.provider.yml" %}
|
|
|
|
```yaml
|
|
|
|
version: '3'
|
|
|
|
services:
|
|
|
|
provider:
|
|
|
|
image: oceanprotocol/provider-py:v1.0.20
|
|
|
|
container_name: provider
|
|
|
|
ports:
|
|
|
|
- 8030:8030
|
|
|
|
networks:
|
|
|
|
- ocean_backend
|
|
|
|
environment:
|
2023-04-04 08:15:27 +02:00
|
|
|
# the NETWORK_URL and PROVIDER_PRIVATE_KEY settings can be defined for multiple chains
|
|
|
|
# as the JSON encoding e.g. {"chain_id1": "network_url_1", "chain_id2": "network_url_2"}
|
|
|
|
NETWORK_URL: '{"8996": "${NETWORK_URL}"}'
|
|
|
|
PROVIDER_PRIVATE_KEY: '{"8996": "${PROVIDER_PRIVATE_KEY}"}'
|
|
|
|
# defines the key to use where no chain id is applicable (e.g. for auth tokens)
|
|
|
|
UNIVERSAL_PRIVATE_KEY: ${PROVIDER_PRIVATE_KEY}
|
2022-07-11 12:32:52 +02:00
|
|
|
LOG_LEVEL: DEBUG
|
|
|
|
OCEAN_PROVIDER_URL: "http://0.0.0.0:8030"
|
2022-09-23 15:13:28 +02:00
|
|
|
OCEAN_PROVIDER_WORKERS: "2"
|
2022-07-11 12:32:52 +02:00
|
|
|
OCEAN_PROVIDER_TIMEOUT: "9000"
|
2023-04-04 08:15:27 +02:00
|
|
|
# Defining OPERATOR_SERVICE_URL is optional. Set the value only if Provider should support Compute-to-data.
|
2022-07-11 12:32:52 +02:00
|
|
|
OPERATOR_SERVICE_URL: "<operator-service-url>"
|
2023-04-04 08:15:27 +02:00
|
|
|
# Defining IPFS_GATEWAY is optional. Set the value if Provider should support resolving IPFS urls.
|
2022-07-11 12:32:52 +02:00
|
|
|
IPFS_GATEWAY: "<ipfs-url>"
|
|
|
|
AQUARIUS_URL: ${AQUARIUS_URL}
|
|
|
|
volumes:
|
|
|
|
data:
|
|
|
|
driver: local
|
|
|
|
networks:
|
|
|
|
ocean_backend:
|
|
|
|
driver: bridge
|
|
|
|
```
|
|
|
|
{% endcode %}
|
|
|
|
|
|
|
|
### Start Provider
|
|
|
|
|
|
|
|
```
|
|
|
|
docker-compose \
|
|
|
|
-f docker-compose.provider.yml
|
|
|
|
--env-file .env \
|
|
|
|
-d \
|
|
|
|
up
|
2022-07-11 16:00:21 +02:00
|
|
|
```
|