mirror of
https://github.com/oceanprotocol/docs.git
synced 2024-11-26 19:49:26 +01:00
GITBOOK-605: change request with no subject merged in GitBook
This commit is contained in:
parent
5c3145e0c4
commit
848ec65079
@ -32,7 +32,7 @@
|
||||
* [Harvest More Yield Data Farming](user-guides/how-to-data-farm.md)
|
||||
* [Claim Rewards Data Farming](user-guides/claim-ocean-rewards.md)
|
||||
* [Liquidity Pools \[deprecated\]](user-guides/remove-liquidity-pools.md)
|
||||
* [👨💻 Developers](developers/README.md)
|
||||
* [👨💻 👨💻 Developers](developers/README.md)
|
||||
* [Architecture Overview](developers/architecture.md)
|
||||
* [Contracts](developers/contracts/README.md)
|
||||
* [Data NFTs](developers/contracts/data-nfts.md)
|
||||
|
@ -2,203 +2,570 @@
|
||||
|
||||
### About Aquarius
|
||||
|
||||
Aquarius is an off-chain component with caches the asset metadata published on-chain. By deploying own Aquarius, developers can control which assets are visible in their marketplace. For example, having a custom Aquarius instance allows assets only from specific addresses to be visible on the marketplace. This tutorial will provide the steps to deploy Aquarius. Ocean Protocol provides Aquarius docker images which can be viewed [here](https://hub.docker.com/r/oceanprotocol/aquarius/tags). Visit [this](https://github.com/oceanprotocol/aquarius) page to view Aquarius source code.
|
||||
Aquarius is an off-chain component that caches the asset's metadata published on-chain. By deploying their own instance of Aquarius, developers can control which assets are visible in their DApp. For example, having a custom Aquarius instance allows only the assets from specific addresses to be visible in the DApp.
|
||||
|
||||
Aquarius consists of two parts:\
|
||||
\- **API:** The Aquarius API offers a convenient way to access the medatata without scanning the chain yourself.\
|
||||
\- **Event monitor:** Aquarius continually monitors the chains for MetadataCreated and MetadataUpdated events, processes these events and adds them to the database.
|
||||
This tutorial will provide the steps to deploy Aquarius. Ocean Protocol provides Aquarius Docker images which can be viewed [here](https://hub.docker.com/r/oceanprotocol/aquarius/tags). Visit [this](https://github.com/oceanprotocol/aquarius) page to view the Aquarius source code.
|
||||
|
||||
Aquarius consists of two parts:
|
||||
|
||||
* **API:** The Aquarius API provides a user with a convenient way to access the metadata without scanning the chain itself.
|
||||
* **Event monitor:** Aquarius continually monitors the chains for MetadataCreated and MetadataUpdated events, processes these events, and adds them to the database.
|
||||
|
||||
As mentioned in the [Setup a Server](setup-server.md) document, all Ocean components can be deployed in two configurations: simple, based on Docker Engine and Docker Compose, and complex, based on Kubernetes with Docker Engine. This document will present how to deploy Provider in each of these configurations.
|
||||
|
||||
|
||||
|
||||
## Deploying Aquarius using Docker Engine and Docker Compose
|
||||
|
||||
This guide will deploy Aquarius, including Elasticsearch as a single systemd service.
|
||||
|
||||
### Prerequisites
|
||||
|
||||
* A server for hosting Aquarius. See [this guide](setup-server.md) on creating a server.
|
||||
* Docker and Docker compose are installed. Click [here](https://docs.docker.com/engine/install/) to view guide on installing docker.
|
||||
* [Obtain an API key](http://localhost:5000/o/mTcjMqA4ylf55anucjH8/s/zQlpIJEeu8x5yl0OLuXn/)
|
||||
* A server for hosting Aquarius. See [this guide](setup-server.md) for how to create a server;
|
||||
* Docker Compose and Docker Engine are installed and configured on the server. See [this guide](setup-server.md#install-docker-engine-and-docker-compose) for how to install these products.
|
||||
* The RPC URLs and API keys for each of the networks to which the Aquarius will be connected. See[ this guide](https://app.gitbook.com/o/mTcjMqA4ylf55anucjH8/s/BTXXhmDGzR0Xgj13fyfM/\~/changes/548/developers/obtaining-api-keys-for-blockchain-access) for how to obtain the URL and the API key.
|
||||
|
||||
### Create a working directory
|
||||
### Steps
|
||||
|
||||
```
|
||||
mkdir Aquarius
|
||||
cd Aquarius
|
||||
```
|
||||
|
||||
### Create a \`.env\` file
|
||||
|
||||
Copy the below content into the \`.env\` file and edit the values as needed.
|
||||
#### 1. Create the /etc/docker/compose/aquarius/docker-compose.yml file
|
||||
|
||||
{% code title=".env" %}
|
||||
```
|
||||
# check the available versions: https://hub.docker.com/repository/docker/oceanprotocol/aquarius
|
||||
AQUARIUS_VERSION=latest
|
||||
ALLOWED_PUBLISHERS='[""]'
|
||||
# Elastic search credentials
|
||||
DB_USERNAME=username
|
||||
DB_PASSWORD=password
|
||||
From a terminal console, create /etc/docker/compose/aquarius/docker-compose.yml file, then copy and paste the following content to it. Check the comments in the file and replace the fields with the specific values of your implementation. The following example is for deploying Aquarius for Goerli network. 
|
||||
|
||||
# Replace below value with the API provider of your choice
|
||||
EVENTS_RPC_POLYGON=<polygon-key>
|
||||
EVENTS_RPC_MAINNET=<mainnet-key>
|
||||
```
|
||||
{% endcode %}
|
||||
For each other network in which you want to deploy Aquarius, add to the file a section similar to "aquarius-events-goerli" included in this example and update the corresponding parameters (i.e. EVENTS\_RPC, OCEAN\_ADDRESS, SUBGRAPH\_URLS) specific to that network. \
|
||||
|
||||
### Create docker-compose file
|
||||
|
||||
{% code title="docker-compose.yml" %}
|
||||
```yaml
|
||||
version: '3'
|
||||
version: '3.9'
|
||||
services:
|
||||
elasticsearch:
|
||||
image: elasticsearch:6.8.17
|
||||
elasticsearch:
|
||||
image: elasticsearch:8.7.0
|
||||
container_name: elasticsearch
|
||||
restart: on-failure
|
||||
environment:
|
||||
ES_JAVA_OPTS: "-Xms512m -Xmx512m"
|
||||
MAX_MAP_COUNT: "64000"
|
||||
discovery.type: "single-node"
|
||||
ELASTIC_PASSWORD: "changeme"
|
||||
xpack.security.enabled: "false"
|
||||
xpack.security.http.ssl.enabled: "false"
|
||||
volumes:
|
||||
- data:/usr/share/elasticsearch/data
|
||||
ports:
|
||||
- 9200:9200
|
||||
networks:
|
||||
- ocean_backend
|
||||
aquarius:
|
||||
image: oceanprotocol/aquarius:${AQUARIUS_VERSION}
|
||||
- backend
|
||||
aquarius:
|
||||
image: oceanprotocol/aquarius:v5.1.2
|
||||
container_name: aquarius
|
||||
restart: on-failure
|
||||
ports:
|
||||
- 5000:5000
|
||||
networks:
|
||||
- ocean_backend
|
||||
- backend
|
||||
depends_on:
|
||||
- elasticsearch
|
||||
environment:
|
||||
DB_MODULE: elasticsearch
|
||||
DB_HOSTNAME: elasticsearch
|
||||
DB_HOSTNAME: http://elasticsearch
|
||||
DB_PORT: 9200
|
||||
DB_USERNAME: ${DB_USERNAME}
|
||||
DB_PASSWORD: ${DB_PASSWORD}
|
||||
DB_USERNAME: elastic
|
||||
DB_PASSWORD: changeme
|
||||
DB_NAME: aquarius
|
||||
DB_SCHEME: http
|
||||
DB_SSL : "false"
|
||||
LOG_LEVEL: "DEBUG"
|
||||
AQUARIUS_BIND_URL : "http://0.0.0.0:5000"
|
||||
AQUARIUS_WORKERS : "8"
|
||||
LOG_LEVEL: "INFO"
|
||||
AQUARIUS_URL: "http://0.0.0.0:5000"
|
||||
AQUARIUS_WORKERS : "4"
|
||||
RUN_AQUARIUS_SERVER: "1"
|
||||
AQUARIUS_CONFIG_FILE: "config.ini"
|
||||
EVENTS_ALLOW: 0
|
||||
RUN_EVENTS_MONITOR: 0
|
||||
ALLOWED_PUBLISHERS: ${ALLOWED_PUBLISHERS}
|
||||
volumes:
|
||||
data:
|
||||
driver: local
|
||||
networks:
|
||||
ocean_backend:
|
||||
driver: bridge
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
### Create events monitor docker compose file
|
||||
|
||||
{% tabs %}
|
||||
{% tab title="Events monitor - Mainnet" %}
|
||||
{% code title="docker-compose-events-mainnet.yml" %}
|
||||
```yaml
|
||||
version: '3'
|
||||
services:
|
||||
aquarius-events-mainnet:
|
||||
image: oceanprotocol/aquarius:${AQUARIUS_VERSION}
|
||||
container_name: aquarius-events-mainnet
|
||||
ALLOWED_PUBLISHERS: '[""]'
|
||||
aquarius-events-goerli:
|
||||
image: oceanprotocol/aquarius:v5.1.2
|
||||
container_name: aquarius-events-goerli
|
||||
restart: on-failure
|
||||
networks:
|
||||
- ocean_backend
|
||||
- backend
|
||||
depends_on:
|
||||
- elasticsearch
|
||||
environment:
|
||||
DB_MODULE: elasticsearch
|
||||
DB_HOSTNAME: elasticsearch
|
||||
DB_HOSTNAME: http://elasticsearch
|
||||
DB_PORT: 9200
|
||||
DB_USERNAME: ${DB_USERNAME}
|
||||
DB_PASSWORD: ${DB_PASSWORD}
|
||||
DB_USERNAME: elastic
|
||||
DB_PASSWORD: changeme
|
||||
DB_NAME: aquarius
|
||||
DB_SCHEME: http
|
||||
DB_SSL : "false"
|
||||
LOG_LEVEL: "DEBUG"
|
||||
AQUARIUS_BIND_URL: "http://0.0.0.0:5000"
|
||||
LOG_LEVEL: "INFO"
|
||||
AQUARIUS_URL: "http://0.0.0.0:5000"
|
||||
AQUARIUS_WORKERS : "1"
|
||||
RUN_AQUARIUS_SERVER : "0"
|
||||
AQUARIUS_CONFIG_FILE: "config.ini"
|
||||
NETWORK_NAME: "mainnet"
|
||||
EVENTS_RPC: ${EVENTS_RPC_MAINNET}
|
||||
ALLOWED_PUBLISHERS: '[""]'
|
||||
NETWORK_NAME: "goerli"
|
||||
EVENTS_RPC: "https://goerli.infura.io/v3/<infura_id>"
|
||||
METADATA_UPDATE_ALL : "0"
|
||||
OCEAN_ADDRESS : "0x967da4048cD07aB37855c090aAF366e4ce1b9F48"
|
||||
EVENTS_ALLOW: 0
|
||||
OCEAN_ADDRESS : 0xcfdda22c9837ae76e0faa845354f33c62e03653a
|
||||
RUN_EVENTS_MONITOR: 1
|
||||
BLOCKS_CHUNK_SIZE: "5000"
|
||||
SUBGRAPH_URLS: "5: https://v4.subgraph.goerli.oceanprotocol.com"
|
||||
volumes:
|
||||
data:
|
||||
driver: local
|
||||
networks:
|
||||
ocean_backend:
|
||||
backend:
|
||||
driver: bridge
|
||||
```
|
||||
{% endcode %}
|
||||
{% endtab %}
|
||||
|
||||
{% tab title="Events monitor - Polygon" %}
|
||||
{% code title="docker-compose-events-ploygon.yml" %}
|
||||
#### 2. Create the /etc/systemd/system/docker-compose@aquarius.service file
|
||||
|
||||
Create the _/etc/systemd/system/docker-compose@aquarius.service_ file then copy and paste the following content to it. This example file could be customized if needed.
|
||||
|
||||
```
|
||||
[Unit]
|
||||
Description=%i service with docker compose
|
||||
Requires=docker.service
|
||||
After=docker.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=true
|
||||
Environment="PROJECT=ocean"
|
||||
WorkingDirectory=/etc/docker/compose/%i
|
||||
ExecStartPre=/usr/bin/env docker-compose -p $PROJECT pull
|
||||
ExecStart=/usr/bin/env docker-compose -p $PROJECT up -d --remove-orphans
|
||||
ExecStop=/usr/bin/env docker-compose -p $PROJECT stop
|
||||
ExecStopPost=/usr/bin/env docker-compose -p $PROJECT down
|
||||
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
```
|
||||
|
||||
#### 3. Reload the systemd manager configuration
|
||||
|
||||
Run the following command to reload the systemd manager configuration
|
||||
|
||||
```bash
|
||||
sudo systemctl daemon-reload
|
||||
```
|
||||
|
||||
Optionally, you can enable the services to start at boot, using the following command:
|
||||
|
||||
```bash
|
||||
sudo systemctl enable docker-compose@aquarius.service
|
||||
```
|
||||
|
||||
#### 4. Start Aquarius service
|
||||
|
||||
To start the Aquarius service, run the following command:
|
||||
|
||||
```bash
|
||||
sudo systemctl start docker-compose@aquarius.service
|
||||
```
|
||||
|
||||
#### 5. Check the service's status
|
||||
|
||||
Check the status of the service by running the following commands:
|
||||
|
||||
```bash
|
||||
sudo systemctl status docker-compose@aquarius.service
|
||||
```
|
||||
|
||||
#### 6. Confirm Aquarius is accessible
|
||||
|
||||
Run the following commands to access Aquarius The output should be similar to the one displayed here. 
|
||||
|
||||
<pre class="language-bash"><code class="lang-bash">$ curl localhost:9200
|
||||
<strong>{
|
||||
</strong> "name" : "a93d989293ac",
|
||||
"cluster_name" : "docker-cluster",
|
||||
"cluster_uuid" : "Bs16cyCwRCOIbmaBUEj5fA",
|
||||
"version" : {
|
||||
"number" : "8.7.0",
|
||||
"build_flavor" : "default",
|
||||
"build_type" : "docker",
|
||||
"build_hash" : "09520b59b6bc1057340b55750186466ea715e30e",
|
||||
"build_date" : "2023-03-27T16:31:09.816451435Z",
|
||||
"build_snapshot" : false,
|
||||
"lucene_version" : "9.5.0",
|
||||
"minimum_wire_compatibility_version" : "7.17.0",
|
||||
"minimum_index_compatibility_version" : "7.0.0"
|
||||
},
|
||||
"tagline" : "You Know, for Search"
|
||||
}
|
||||
</code></pre>
|
||||
|
||||
```bash
|
||||
$ curl localhost:5000
|
||||
{"plugin":"module","software":"Aquarius","version":"5.1.2"}
|
||||
```
|
||||
|
||||
#### 7. Use Docker CLI to check the Aquarius service's logs
|
||||
|
||||
If needed, use docker CLI to check Aquarius' service logs.
|
||||
|
||||
First, identify the container id:
|
||||
|
||||
```bash
|
||||
$ docker ps
|
||||
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
||||
355baee34d50 oceanprotocol/aquarius:v5.1.2 "/aquarius/docker-en…" About a minute ago Up About a minute 5000/tcp aquarius-events-goerli
|
||||
f1f97d6f146f oceanprotocol/aquarius:v5.1.2 "/aquarius/docker-en…" About a minute ago Up About a minute 0.0.0.0:5000->5000/tcp, :::5000->5000/tcp aquarius
|
||||
a93d989293ac elasticsearch:8.7.0 "/bin/tini -- /usr/l…" About a minute ago Up About a minute 0.0.0.0:9200->9200/tcp, :::9200->9200/tcp, 9300/tcp elasticsearch
|
||||
|
||||
```
|
||||
|
||||
Then, check the logs from the Aqauarius' Docker containers:
|
||||
|
||||
```bash
|
||||
$ docker logs aquarius [--follow]
|
||||
$ docker logs aquarius-events-goerli [--follow]
|
||||
```
|
||||
|
||||
|
||||
|
||||
## Deploying Aquarius using Kubernetes with Docker Engine
|
||||
|
||||
Aquarius depends on the backend database and in this example we will deploy the following resources:
|
||||
|
||||
* Elasticsearch.
|
||||
* Aquarius ([Deployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/))
|
||||
|
||||
Templates (yaml files) are provided and could be customized based on the environment's specifics.
|
||||
|
||||
### Prerequisites
|
||||
|
||||
* A server for hosting Aquarius. See [this guide](setup-server.md) for how to create a server;
|
||||
* Kubernetes with Docker Engine is installed and configured on the server. See [this chapter](setup-server.md#install-kubernetes-with-docker-engine) for information on installing Kubernetes.
|
||||
* The RPC URLs and API keys for each of the networks to which the Aquarius will be connected. See[ this guide](https://app.gitbook.com/o/mTcjMqA4ylf55anucjH8/s/BTXXhmDGzR0Xgj13fyfM/\~/changes/548/developers/obtaining-api-keys-for-blockchain-access) for how to obtain the URL and the API key.
|
||||
|
||||
### Steps
|
||||
|
||||
|
||||
|
||||
1. [Deploy Elasticsearch service](deploying-aquarius.md#1.-deploy-elasticsearch)
|
||||
2. [Deploy Aquarius service](deploying-aquarius.md#2.-deploy-aquarius)
|
||||
|
||||
#### 1. Deploy Elasticsearch
|
||||
|
||||
It is recommended to deploy Elasticsearch through Helm [chart](https://github.com/elastic/cloud-on-k8s).
|
||||
|
||||
a. Once the Elasticsearch pods are running, the database service should be available:
|
||||
|
||||
```bash
|
||||
$ kubectl port-forward --namespace ocean svc/elasticsearch-master 9200:9200
|
||||
Forwarding from 127.0.0.1:9200 -> 9200
|
||||
Forwarding from [::1]:9200 -> 9200
|
||||
```
|
||||
|
||||
b. Check that the Elasticsearch service is accessible:
|
||||
|
||||
```
|
||||
$ curl localhost:9200
|
||||
{
|
||||
"name" : "elasticsearch-master-2",
|
||||
"cluster_name" : "elasticsearch",
|
||||
"cluster_uuid" : "KMAfL5tVSJWFfmCOklT0qg",
|
||||
"version" : {
|
||||
"number" : "8.5.2",
|
||||
"build_flavor" : "default",
|
||||
"build_type" : "docker",
|
||||
"build_hash" : "a846182fa16b4ebfcc89aa3c11a11fd5adf3de04",
|
||||
"build_date" : "2022-11-17T18:56:17.538630285Z",
|
||||
"build_snapshot" : false,
|
||||
"lucene_version" : "9.4.1",
|
||||
"minimum_wire_compatibility_version" : "7.17.0",
|
||||
"minimum_index_compatibility_version" : "7.0.0"
|
||||
},
|
||||
"tagline" : "You Know, for Search"
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
|
||||
#### 2. Deploy Aquarius
|
||||
|
||||
Aquarius supports indexing multiple chains using a single instance to serve API requests and one instance for each chain that must be indexed.
|
||||
|
||||
<figure><img src="https://user-images.githubusercontent.com/54084524/128821016-f2f2b98d-a62d-469a-9bca-dfd2164df3ae.png" alt=""><figcaption><p>Aquarius</p></figcaption></figure>
|
||||
|
||||
The following deployment templates could be used for guidance. Some parameters are [optional](https://github.com/oceanprotocol/aquarius) and the template could be adjusted based on these considerations. Common cases are the deployments for one/multiple multiple Ethereum networks:
|
||||
|
||||
* Mainnet
|
||||
* Goerli
|
||||
* Mumbai
|
||||
|
||||
a. Create a YAML file for Aquarius configuration.
|
||||
|
||||
The following templates (annotated) could be edited and used for deployment.
|
||||
|
||||
* [_aquarius-deployment.yaml_](https://github.com/oceanprotocol/aquarius/blob/update-deploy-docs/deployment/aquarius-deployment.yaml) (annotated): this deployment is responsible for serving API requests
|
||||
|
||||
```yaml
|
||||
version: '3'
|
||||
services:
|
||||
aquarius-events-polygon:
|
||||
image: oceanprotocol/aquarius:${AQUARIUS_VERSION}
|
||||
container_name: aquarius-events-polygon
|
||||
restart: on-failure
|
||||
networks:
|
||||
- ocean_backend
|
||||
depends_on:
|
||||
- elasticsearch
|
||||
environment:
|
||||
DB_MODULE: elasticsearch
|
||||
DB_HOSTNAME: elasticsearch
|
||||
DB_PORT: 9200
|
||||
DB_USERNAME: ${DB_USERNAME}
|
||||
DB_PASSWORD: ${DB_PASSWORD}
|
||||
DB_NAME: aquarius
|
||||
DB_SCHEME: http
|
||||
DB_SSL : "false"
|
||||
LOG_LEVEL: "DEBUG"
|
||||
AQUARIUS_BIND_URL: "http://0.0.0.0:5000"
|
||||
AQUARIUS_WORKERS : "1"
|
||||
RUN_AQUARIUS_SERVER : "0"
|
||||
AQUARIUS_CONFIG_FILE: "config.ini"
|
||||
NETWORK_NAME: "polygon"
|
||||
EVENTS_RPC: ${EVENTS_RPC_POLYGON}
|
||||
METADATA_UPDATE_ALL: "0"
|
||||
OCEAN_ADDRESS: "0x282d8efCe846A88B159800bd4130ad77443Fa1A1"
|
||||
EVENTS_ALLOW: 0
|
||||
RUN_EVENTS_MONITOR: 1
|
||||
METADATA_CONTRACT_ADDRESS: "0x80E63f73cAc60c1662f27D2DFd2EA834acddBaa8"
|
||||
BLOCKS_CHUNK_SIZE: "5000"
|
||||
volumes:
|
||||
data:
|
||||
driver: local
|
||||
networks:
|
||||
ocean_backend:
|
||||
driver: bridge
|
||||
```
|
||||
{% endcode %}
|
||||
{% endtab %}
|
||||
{% endtabs %}
|
||||
|
||||
### Start Aquarius
|
||||
|
||||
```
|
||||
docker-compose \
|
||||
-f docker-compose.yml \
|
||||
-f docker-compose-events-mainnet.yml \
|
||||
-f docker-compose-events-polygon.yml \
|
||||
--env-file .env \
|
||||
-d \
|
||||
up
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
annotations:
|
||||
labels:
|
||||
app: aquarius
|
||||
name: aquarius
|
||||
spec:
|
||||
progressDeadlineSeconds: 600
|
||||
replicas: 1
|
||||
revisionHistoryLimit: 5
|
||||
selector:
|
||||
matchLabels:
|
||||
app: aquarius
|
||||
strategy:
|
||||
rollingUpdate:
|
||||
maxSurge: 25%
|
||||
maxUnavailable: 25%
|
||||
type: RollingUpdate
|
||||
template:
|
||||
metadata:
|
||||
creationTimestamp: null
|
||||
labels:
|
||||
app: aquarius
|
||||
spec:
|
||||
containers:
|
||||
- env:
|
||||
- name: LOG_LEVEL
|
||||
value: DEBUG
|
||||
- name: AQUARIUS_URL
|
||||
value: http://0.0.0.0:5000
|
||||
- name: AQUARIUS_WORKERS
|
||||
value: "4"
|
||||
- name: DB_HOSTNAME
|
||||
value: < ES service hostname >
|
||||
- name: DB_MODULE
|
||||
value: elasticsearch
|
||||
- name: DB_NAME
|
||||
value: aquarius
|
||||
- name: DB_PORT
|
||||
value: "9200"
|
||||
- name: DB_SCHEME
|
||||
value: http
|
||||
- name: DB_USERNAME
|
||||
value: < ES username >
|
||||
- name: DB_PASSWORD
|
||||
value: < ES password >
|
||||
- name: DB_SSL
|
||||
value: "false"
|
||||
- name: RUN_AQUARIUS_SERVER
|
||||
value: "1"
|
||||
- name: RUN_EVENTS_MONITOR
|
||||
value: "0"
|
||||
- name: EVENTS_ALLOW
|
||||
value: "0"
|
||||
- name: CONFIG_FILE
|
||||
value: config.ini
|
||||
- name: ALLOWED_PUBLISHERS
|
||||
value: '[""]'
|
||||
image: oceanprotocol/aquarius:v5.1.2 => check the available versions: https://hub.docker.com/repository/docker/oceanprotocol/aquarius/tags?page=1&ordering=last_updated
|
||||
imagePullPolicy: Always
|
||||
livenessProbe:
|
||||
failureThreshold: 3
|
||||
httpGet:
|
||||
path: /
|
||||
port: 5000
|
||||
scheme: HTTP
|
||||
initialDelaySeconds: 20
|
||||
periodSeconds: 10
|
||||
successThreshold: 1
|
||||
timeoutSeconds: 2
|
||||
name: aquarius
|
||||
ports:
|
||||
- containerPort: 5000
|
||||
protocol: TCP
|
||||
readinessProbe:
|
||||
failureThreshold: 3
|
||||
httpGet:
|
||||
path: /
|
||||
port: 5000
|
||||
scheme: HTTP
|
||||
initialDelaySeconds: 20
|
||||
periodSeconds: 10
|
||||
successThreshold: 1
|
||||
timeoutSeconds: 1
|
||||
resources:
|
||||
limits:
|
||||
cpu: 800m
|
||||
memory: 1Gi
|
||||
requests:
|
||||
cpu: 800m
|
||||
memory: 1Gi
|
||||
terminationMessagePath: /dev/termination-log
|
||||
terminationMessagePolicy: File
|
||||
dnsPolicy: ClusterFirst
|
||||
restartPolicy: Always
|
||||
schedulerName: default-scheduler
|
||||
terminationGracePeriodSeconds: 30ya
|
||||
```
|
||||
|
||||
After pulling all the asset metadata from the blockchain, Aquarius can be used to query the assets using Elasticsearch query. Aquarius REST API are documented here.
|
||||
|
||||
|
||||
Example deployment for _Mumbai_ (Polygon testenet):
|
||||
|
||||
* [aquarius-events-mumbai-deployment.yaml](https://github.com/oceanprotocol/aquarius/blob/update-deploy-docs/deployment/aquarius-events-mumbai-deployment.yaml) (annotated) - this deployment will be responsible for indexing the block and storing the metadata published on-chain:
|
||||
|
||||
```yaml
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
annotations:
|
||||
labels:
|
||||
app: aquarius-events-mumbai
|
||||
name: aquarius-events-mumbai
|
||||
spec:
|
||||
progressDeadlineSeconds: 600
|
||||
replicas: 1
|
||||
revisionHistoryLimit: 5
|
||||
selector:
|
||||
matchLabels:
|
||||
app: aquarius-events-mumbai
|
||||
strategy:
|
||||
rollingUpdate:
|
||||
maxSurge: 25%
|
||||
maxUnavailable: 25%
|
||||
type: RollingUpdate
|
||||
template:
|
||||
metadata:
|
||||
creationTimestamp: null
|
||||
labels:
|
||||
app: aquarius-events-mumbai
|
||||
spec:
|
||||
containers:
|
||||
- env:
|
||||
- name: LOG_LEVEL
|
||||
value: DEBUG
|
||||
- name: AQUARIUS_URL
|
||||
value: http://0.0.0.0:5000
|
||||
- name: AQUARIUS_WORKERS
|
||||
value: "1"
|
||||
- name: DB_HOSTNAME
|
||||
value: < ES service hostname >
|
||||
- name: DB_MODULE
|
||||
value: elasticsearch
|
||||
- name: DB_NAME
|
||||
value: aquarius
|
||||
- name: DB_PORT
|
||||
value: "9200"
|
||||
- name: DB_SCHEME
|
||||
value: http
|
||||
- name: DB_USERNAME
|
||||
value: < ES username >
|
||||
- name: DB_PASSWORD
|
||||
value: < ES password >
|
||||
- name: DB_SSL
|
||||
value: "false"
|
||||
- name: RUN_AQUARIUS_SERVER
|
||||
value: "0"
|
||||
- name: RUN_EVENTS_MONITOR
|
||||
value: "1"
|
||||
- name: CONFIG_FILE
|
||||
value: config.ini
|
||||
- name: ALLOWED_PUBLISHERS
|
||||
value: '[""]'
|
||||
- name: NETWORK_NAME
|
||||
value: mumbai
|
||||
- name: EVENTS_RPC
|
||||
value: https://polygon-mumbai.infura.io/v3/< INFURA ID > => or another RPC service for this network
|
||||
- name: METADATA_UPDATE_ALL
|
||||
value: "0"
|
||||
- name: ASSET_PURGATORY_URL
|
||||
value: https://raw.githubusercontent.com/oceanprotocol/list-purgatory/main/list-assets.json
|
||||
- name: ACCOUNT_PURGATORY_URL
|
||||
value: https://raw.githubusercontent.com/oceanprotocol/list-purgatory/main/list-accounts.json
|
||||
- name: PURGATORY_UPDATE_INTERVAL
|
||||
value: "60"
|
||||
- name: OCEAN_ADDRESS
|
||||
value: 0xd8992Ed72C445c35Cb4A2be468568Ed1079357c8
|
||||
- name: SUBGRAPH_URLS
|
||||
value: |
|
||||
{"80001": "https://v4.subgraph.mumbai.oceanprotocol.com"} => or your own deployed Ocean Subgraph service for this network
|
||||
- name: BLOCKS_CHUNK_SIZE
|
||||
value: "3500"
|
||||
- name: EVENTS_HTTP
|
||||
value: "1"
|
||||
image: oceanprotocol/aquarius:v5.1.2 => check the available versions: https://hub.docker.com/repository/docker/oceanprotocol/aquarius/tags?page=1&ordering=last_updated
|
||||
imagePullPolicy: Always
|
||||
livenessProbe:
|
||||
failureThreshold: 3
|
||||
httpGet:
|
||||
path: /
|
||||
port: 5001
|
||||
scheme: HTTP
|
||||
initialDelaySeconds: 20
|
||||
periodSeconds: 10
|
||||
successThreshold: 1
|
||||
timeoutSeconds: 1
|
||||
name: aquarius-events-mumbai
|
||||
ports:
|
||||
- containerPort: 5000
|
||||
protocol: TCP
|
||||
readinessProbe:
|
||||
failureThreshold: 3
|
||||
httpGet:
|
||||
path: /
|
||||
port: 5001
|
||||
scheme: HTTP
|
||||
initialDelaySeconds: 20
|
||||
periodSeconds: 10
|
||||
successThreshold: 1
|
||||
timeoutSeconds: 1
|
||||
resources:
|
||||
limits:
|
||||
cpu: 500m
|
||||
memory: 1Gi
|
||||
requests:
|
||||
cpu: 500m
|
||||
memory: 1Gi
|
||||
terminationMessagePath: /dev/termination-log
|
||||
terminationMessagePolicy: File
|
||||
dnsPolicy: ClusterFirst
|
||||
restartPolicy: Always
|
||||
schedulerName: default-scheduler
|
||||
terminationGracePeriodSeconds: 30
|
||||
```
|
||||
|
||||
Tip: before deployment you can [validate](https://github.com/instrumenta/kubeval) the yaml file.
|
||||
|
||||
|
||||
|
||||
b. Deploy the configuration
|
||||
|
||||
Deploy the configuration in Kubernetes using the following commands.
|
||||
|
||||
```bash
|
||||
$ kubectl apply -f aquarius-deployment.yaml
|
||||
$ kubectl apply -f aquarius-events-rinkeby-deployment.yaml
|
||||
|
||||
|
||||
kubectl get pods -l app=aquarius
|
||||
NAME READY STATUS RESTARTS AGE
|
||||
aquarius-6fd9cc975b-fxr4d 1/1 Running 0 1d
|
||||
|
||||
kubectl get pods -l app=aquarius-events-mumbai
|
||||
NAME READY STATUS RESTARTS AGE
|
||||
aquarius-events-mumbai-8748976c4-mh24n 1/1 Running 0 1d
|
||||
```
|
||||
|
||||
Check the logs for newly deployed Aquarius by running the following command:
|
||||
|
||||
```bash
|
||||
$ kubectl logs aquarius-6fd9cc975b-fxr4d [--follow]
|
||||
|
||||
$ kubectl logs aquarius-events-mumbai-8748976c4-mh24n [--follow]
|
||||
```
|
||||
|
||||
|
||||
|
||||
c. Create a Kubernetes service
|
||||
|
||||
The next step is to create a Kubernetes service (eg. ClusterIP, NodePort, Loadbalancer, ExternalName) for this deployment, depending on the environment specifications. Follow [this link](https://kubernetes.io/docs/concepts/services-networking/service/) for details on how to create a Kubernetes service.
|
||||
|
||||
|
@ -18,7 +18,7 @@ In this guide, we will deploy Provider for two chains: Goerli (Ethereum test net
|
||||
|
||||
### Prerequisites
|
||||
|
||||
* A server for hosting Ocean Marketplace. See [this guide](setup-server.md) for how to create a server;
|
||||
* A server for hosting Provider. See [this guide](setup-server.md) for how to create a server;
|
||||
* Docker Compose and Docker Engine are installed and configured on the server. See [this guide](setup-server.md#install-docker-engine-and-docker-compose) for how to install these products.
|
||||
* The RPC URLs and API keys for each of the networks to which the Provider will be connected. See[ this guide](https://app.gitbook.com/o/mTcjMqA4ylf55anucjH8/s/BTXXhmDGzR0Xgj13fyfM/\~/changes/548/developers/obtaining-api-keys-for-blockchain-access) for how to obtain the URL and the API key.
|
||||
* The private key which will be used by Provider to encrypt/decrypt URLs.
|
||||
@ -39,7 +39,7 @@ The steps to deploy the Provider using Docker Engine and Docker Compose are:
|
||||
|
||||
#### 1. Create the /etc/docker/compose/provider/docker-compose.yml file
|
||||
|
||||
From a terminal console, create /etc/docker/compose/provider/docker-compose.yml file, the copy and paste the following content to it. Check the comments in the file and replace the fields with the specific values of your implementation. 
|
||||
From a terminal console, create /etc/docker/compose/provider/docker-compose.yml file, then copy and paste the following content to it. Check the comments in the file and replace the fields with the specific values of your implementation. 
|
||||
|
||||
```yaml
|
||||
version: '3'
|
||||
@ -115,6 +115,8 @@ sudo systemctl enable docker-compose@provider.service
|
||||
|
||||
#### 4. Start the Provider service
|
||||
|
||||
To start the Provider service, run the following command:
|
||||
|
||||
```bash
|
||||
sudo systemctl start docker-compose@provider.service
|
||||
```
|
||||
@ -170,7 +172,7 @@ CONTAINER ID IMAGE COMMAND CREAT
|
||||
|
||||
```
|
||||
|
||||
Then, check the logs from the Provider's docker container
|
||||
Then, check the logs from the Provider's docker container:
|
||||
|
||||
```bash
|
||||
$ docker logs --follow provider
|
||||
@ -205,25 +207,23 @@ In this example, we will run Provider as a Kubernetes deployment resource. We wi
|
||||
|
||||
* A server for hosting Ocean Marketplace. See [this guide](setup-server.md) for how to create a server;
|
||||
* Kubernetes with Docker Engine is installed and configured on the server. See [this chapter](setup-server.md#install-kubernetes-with-docker-engine) for information on installing Kubernetes.
|
||||
* The RPC URLs and API keys for each of the networks to which the Provider will be connected. See <mark style="background-color:red;">this guide</mark> for how to obtain the URL and the API key.
|
||||
* The private key which will be used by Provider to encrypt/decrypt URLs.
|
||||
* The RPC URLs and API keys for each of the networks to which the Provider will be connected. See[ this guide](https://app.gitbook.com/o/mTcjMqA4ylf55anucjH8/s/BTXXhmDGzR0Xgj13fyfM/\~/changes/548/developers/obtaining-api-keys-for-blockchain-access) for how to obtain the URL and the API key.
|
||||
* The private key that will be used by Provider to encrypt/decrypt URLs.
|
||||
* Aquarius is up and running
|
||||
|
||||
### Steps
|
||||
|
||||
The steps to deploy the Provider in Kubernetes are:
|
||||
|
||||
1\.
|
||||
[1. Create a YAML file for Provider configuration.](deploying-provider.md#1.-create-an-yaml-file-for-provider-configuration.)
|
||||
|
||||
2\.
|
||||
[2. Deploy the configuration.](deploying-provider.md#2.-deploy-the-configuration)
|
||||
|
||||
[3. Create a Kubernetes service.](deploying-provider.md#3.-create-a-kubernetes-service)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
1. Create an YAML file for Provider configuration.
|
||||
#### 1. Create a YAML file for Provider configuration.
|
||||
|
||||
From a terminal window, create a YAML file (in our example the file is named provider-deploy.yaml) then copy and paste the following content. Check the comments in the file and replace the fields with the specific values of your implementation (RPC URLs, the private key etc.). 
|
||||
|
||||
@ -300,11 +300,11 @@ spec:
|
||||
terminationGracePeriodSeconds: 30
|
||||
```
|
||||
|
||||
Tip: before deployment you can [validate](https://github.com/instrumenta/kubeval) the yaml file.
|
||||
Tip: before deployment, you can [validate](https://github.com/instrumenta/kubeval) the yaml file.
|
||||
|
||||
|
||||
|
||||
2. Deploy the configuration
|
||||
#### 2. Deploy the configuration
|
||||
|
||||
Deploy the configuration in Kubernetes using the following commands.
|
||||
|
||||
@ -320,7 +320,7 @@ provider-865cb8cf9d-r9xm4 1/1 Running 0 67s
|
||||
|
||||
|
||||
|
||||
3. Create a Kubernetes service
|
||||
#### 3. Create a Kubernetes service
|
||||
|
||||
The next step is to create a Kubernetes service (eg. ClusterIP, NodePort, Loadbalancer, ExternalName) for this deployment, depending on environment specifications. Follow [this link](https://kubernetes.io/docs/concepts/services-networking/service/) for details on how to create a Kubernetes service.
|
||||
The next step is to create a Kubernetes service (eg. ClusterIP, NodePort, Loadbalancer, ExternalName) for this deployment, depending on the environment specifications. Follow [this link](https://kubernetes.io/docs/concepts/services-networking/service/) for details on how to create a Kubernetes service.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user