Run with Docker Compose
There are three out-of-the-box applications available in the Yaci Store repository:
- Yaci Store Utxo Indexer : Includes Utxo Store, Epoch Store, and Submit component
- Yaci Store All : Includes all stores
- Yaci Store Aggregation : Aggregates account balances
You can run out-of-the-box applications with Docker Compose. The Docker Compose YAML files for the applications are inside the docker (opens in a new tab) folder in GitHub repository.
- Please clone the repository (opens in a new tab) to access the Docker Compose files.
- Verify compose yaml file are pointing to the correct application image version.
Pre-requisites
- Docker
Environment Files
There are three configuration files available in docker folder:
env
- Environment variables like JAVA_OPTSapplication.properties
- Contains application specific properties. (e.g; Cardano node host, port, database info, store configuration etc.)application-aggr.properties
- Contains Aggregation application specific properties.
Please configure Cardano Host, Port, and Protocol magic in the application.properties
file.
Docker Compose Files
In the following sections, we will use *-monolith.yml
files. These files help to run both Postgres and the application
through a single Docker Compose file. If you want to run the application with an external database, you can use application-specific
Docker Compose files, such as yaci-store-all.yml
, yaci-store-utxo-indexer.yml
, or yaci-store-aggregation.yml
.
DB Indexes (After Initial Sync)
During the initial sync with the yaci-store-all or yaci-store-utxo-indexer apps, the app automatically removes all optional DB indexes to speed up the sync process. Once the sync is completed, you need to manually re-apply those missing indexes for faster queries.
The SQL file of indexes that need to be re-applied can be found in the GitHub repository:
- Yaci Store All App : create-index.sql (opens in a new tab)
- Utxo Indexer App : create-index.sql (opens in a new tab)
Run Yaci Store ALL application
This application includes all stores.
By default, the submit endpoint is disabled. You can refer to the Enable Submit Endpoint section for instructions on how to enable it.
One of the advantages of Yaci Store is that you can decide what data to store. If you want to disable any specific store or its API endpoints, you have that flexibility.
- To disable a specific store, you can set the
store.<store_name>.enabled
property tofalse
inapplication.properties
. - To disable a specific store's API endpoints, you can set the
store.<store_name>.api-enabled
environment variable tofalse
inapplication.properties
.
docker compose -f yaci-store-all-monolith.yml up -d
You can access swagger-ui at http://localhost:8080/swagger-ui/index.html (opens in a new tab)
Note: When a store is disabled, the store specific data will not be processed and stored in the database. However, the store specific tables will be created in the database. This will be fixed in the future release.
Account Aggregation : It also includes the account aggregation module, but it is disabled by default. Instead of enabling this module, it's recommended to run the aggregation-app separately for calculating account balances.
Run Utxo Indexer application
The Utxo Indexer application consists of the utxo store, epoch store, and submit component.
By default, the submit endpoint is disabled. You can refer to the Enable Submit Endpoint section for instructions on how to enable it.
docker compose -f yaci-store-utxo-indexer-monolith.yml up -d
Run Aggregation App to calculate account balances
Aggregation App is a separate application that calculates account balances by aggregating the UTXO store data.
docker compose -f yaci-store-aggregation-monolith.yml up -d
Enable Submit Endpoint
Both the yaci-store-all and yaci-store-utxo-indexer applications provide submit and script cost evaluation endpoints. However, these endpoints are disabled by default.
In application.properties
file :
- To enable the submit endpoint, you need to configure the
store.cardano.submit-api-url
endpoint. - To enable both the submit and script cost evaluation endpoints, you need to set the
store.cardano.ogmios-url
. - If both submit api url and ogmios url are configured, submit api url will be used for tx submission and ogmios url will be used for script cost evaluation.