Meilisearch Setup

The following information will provide all the details necessary to set up an instance of Meilisearch and connecting it to ARKScan. Before embarking on the installation process, you will need to acquire or gain access to a Virtual Private Server (VPS).

Requirements

  • A VPS to run Meilisearch on, we recommend at least 4GB of RAM and 60GB of disk space to fit the contents of the ARK mainnet database, but this will differ depending on your own needs

Setup

Install Meilisearch

First setup Meilisearch on your VPS. For this please have a look at the official documentation , as there are various ways to deploy it.

Connect ARKScan to Meilisearch

Once Meilisearch is setup, you should point your ARKScan instance to it. For this you need to adjust the following variables in your .env:

1SCOUT_DRIVER=meilisearch
2MEILISEARCH_HOST=http://<your-server-ip>
3MEILISEARCH_KEY=your-meilisearch-key

Index Data

After ARKScan has been updated with the Meilisearch credentials, it’s time to start the indexing process. This requires running various commands in order

Pause indexing tasks - First you want to ensure the indexing tasks are paused by running

1php artisan scout:pause-indexing "App\Models\Transaction" && php artisan scout:pause-indexing "App\Models\Wallet" && php artisan scout:pause-indexing "App\Models\Block"

This pauses the processes for the 3 types of data we’ll be indexing: Blocks, Transactions and Wallets.

Import models - Next up we’ll be importing the necessary data per model. Make sure to keep your terminal open until the process is completed and run them one by one. First off is the Wallet model, which will be the quickest of the models to index.

1php artisan scout:import "App\Models\Wallet"

Once the above command is finished, you can import the Transaction model by running

1php artisan scout:import "App\Models\Transaction"

Finally we’ll index the Block model by running

1php artisan scout:import "App\Models\Block"

Please note that indexing can take upwards of an hour for large datasets (for example the Blocks index). Make sure to keep your terminal open to see how it’s progressing and to know when it’s ready.

After the data has been indexed, we need to update the Meilisearch index settings. This can take upwards of 10 minutes for larger datasets, so be mindful of that before continuing.

1php artisan scout:sync-index-settings

You can query the Meilisearch API to check whether the setting sync jobs are doing. For this you should use the /tasks endpoint, which will return you an overview of the most recently queued tasks and their status. You want to wait for the tasks to have a status of succeeded.

Now that all the data has been added, indexing and prepared for new data, the only thing that remains is re-enabling the indexing jobs

1php artisan scout:resume-indexing "App\Models\Transaction" && php artisan scout:resume-indexing "App\Models\Wallet" && php artisan scout:resume-indexing "App\Models\Block"

With the above enabled, ARKScan will try to update the Meilisearch index every minute with new data since last time.

Disabling Meilisearch

Meilisearch is an optional addition to ARKScan. By default it is enabled, however, it can be disabled to make use of standard database searching. Simply set the scout driver to database to disable Meilisearch:

1SCOUT_DRIVER=database
Last updated 7 months ago
Edit Page
Share: