Deploy Aquarius

About Aquarius

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.

This tutorial will provide the steps to deploy Aquarius. Ocean Protocol provides Aquarius Docker images which can be viewed here. Visit this 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 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 Aquarius 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 for how to create a server;

  • Docker Compose and Docker Engine are installed and configured on the server. See this guide 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 for how to obtain the URL and the API key.

Steps

1. Create the /etc/docker/compose/aquarius/docker-compose.yml file

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.

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.

2. Create the /etc/systemd/system/[email protected] file

Create the /etc/systemd/system/[email protected] file then copy and paste the following content to it. This example file could be customized if needed.

3. Reload the systemd manager configuration

Run the following command to reload the systemd manager configuration

Optionally, you can enable the services to start at boot, using the following command:

4. Start Aquarius service

To start the Aquarius service, run the following command:

5. Check the service's status

Check the status of the service by running the following commands:

6. Confirm Aquarius is accessible

Run the following commands to access Aquarius The output should be similar to the one displayed here.

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:

Then, check the logs from the Aqauarius' Docker containers:

Deploying Aquarius using Kubernetes

Aquarius depends on the backend database and in this example we will deploy the following resources:

Templates (yaml files) are provided and could be customized based on the environment's specifics.

Prerequisites

  • A server for hosting Aquarius. See this guide for how to create a server;

  • Kubernetes with Docker Engine is installed and configured on the server. See this chapter 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 for how to obtain the URL and the API key.

Steps

1. Deploy Elasticsearch

It is recommended to deploy Elasticsearch through Helm chart.

a. Once the Elasticsearch pods are running, the database service should be available:

b. Check that the Elasticsearch service is accessible:

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.

Aquarius deployment - multiple chains indexing

The following deployment templates could be used for guidance. Some parameters are optional and the template could be adjusted based on these considerations. Common cases are the deployments for one/multiple Ethereum networks:

  • Mainnet

  • Sepolia

a. Create a YAML file for Aquarius configuration.

The following templates (annotated) could be edited and used for deployment.

Example deployment for Sepoia (Polygon testnet):

Tip: before deployment, you can validate the yaml file.

b. Deploy the configuration

Deploy the configuration in Kubernetes using the following commands.

Check the logs for newly deployed Aquarius by running the following command:

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 for details on how to create a Kubernetes service.

Last updated

Was this helpful?