diff --git a/docs/.vuepress/config.ts b/docs/.vuepress/config.ts index 669ea81578a..3834e62cb45 100644 --- a/docs/.vuepress/config.ts +++ b/docs/.vuepress/config.ts @@ -717,6 +717,7 @@ function getSidebar(locale: string): SidebarOptions { `${locale}/subquery_network/indexers/become-an-indexer.md`, `${locale}/subquery_network/indexers/install-indexer-locally.md`, `${locale}/subquery_network/indexers/install-indexer-linux.md`, + `${locale}/subquery_network/indexers/separated-db.md`, `${locale}/subquery_network/indexers/indexer-security-guide.md`, `${locale}/subquery_network/indexers/index-project.md`, `${locale}/subquery_network/indexers/dictionary-restore.md`, diff --git a/docs/subquery_network/indexers/become-an-indexer.md b/docs/subquery_network/indexers/become-an-indexer.md index b19324cf208..d39ea709eae 100644 --- a/docs/subquery_network/indexers/become-an-indexer.md +++ b/docs/subquery_network/indexers/become-an-indexer.md @@ -67,7 +67,7 @@ Login to your VM and create a folder, such as `kepler-indexer` 2. Run the follow cmd to download the latest `docker-compose.yml`: ```sh -curl https://raw.githubusercontent.com/subquery/indexer-services/kepler/docker-compose.yml -o docker-compose.yml +curl https://raw.githubusercontent.com/subquery/network-indexer-services/main/deploy/docker-compose.yml -o docker-compose.yml ``` This will overwrite the existing docker-compose.yml file. Always use the latest versions (use pre-release versions at your own risk). diff --git a/docs/subquery_network/indexers/install-indexer-linux.md b/docs/subquery_network/indexers/install-indexer-linux.md index 400fc694682..a441f59e672 100644 --- a/docs/subquery_network/indexers/install-indexer-linux.md +++ b/docs/subquery_network/indexers/install-indexer-linux.md @@ -59,7 +59,7 @@ Run the following command: ```bash mkdir subquery-indexer && cd subquery-indexer -curl https://raw.githubusercontent.com/subquery/indexer-services/kepler/docker-compose.yml -o docker-compose.yml +curl https://raw.githubusercontent.com/subquery/network-indexer-services/main/deploy/docker-compose.yml -o docker-compose.yml ``` ::: warning Important diff --git a/docs/subquery_network/indexers/install-indexer-locally.md b/docs/subquery_network/indexers/install-indexer-locally.md index a35646685c1..3f200ce422a 100644 --- a/docs/subquery_network/indexers/install-indexer-locally.md +++ b/docs/subquery_network/indexers/install-indexer-locally.md @@ -25,11 +25,11 @@ Now, let's explore how to run the Indexing Service Locally step-by-step. ```bash mkdir subquery-indexer && cd subquery-indexer -curl https://raw.githubusercontent.com/subquery/indexer-services/kepler/docker-compose.yml -o docker-compose.yml +curl https://raw.githubusercontent.com/subquery/network-indexer-services/main/deploy/docker-compose.yml -o docker-compose.yml # extra steps to use local ipfs node mkdir ipfs -curl https://raw.githubusercontent.com/subquery/indexer-services/kepler/ipfs/ipfs.sh -o ipfs/ipfs.sh +curl https://raw.githubusercontent.com/subquery/network-indexer-services/main/deploy/ipfs/ipfs.sh -o ipfs/ipfs.sh chmod +x ipfs/ipfs.sh ``` @@ -79,4 +79,6 @@ We highly recommend setting up SSL on your new server. [Follow the guide here](. :::tip Tip Having trouble running a command or setting up the service? Got stuck in the process? Find your solutions [here](../indexers/troubleshooting-indexers.md). + +If you want to use a separated database for the Indexing service, you can follow [this guide](./separated-db.md) to set up the database and install the Indexing service. ::: diff --git a/docs/subquery_network/indexers/separated-db.md b/docs/subquery_network/indexers/separated-db.md new file mode 100644 index 00000000000..a02a8f96302 --- /dev/null +++ b/docs/subquery_network/indexers/separated-db.md @@ -0,0 +1,92 @@ +# Install Indexing Service With Separated Database + +If you want to use a separated database for the Indexing service, you can follow this guide to set up the database and install the Indexing service. + +## Initial Preparation + +- [Docker](https://docs.docker.com/get-docker/) - It contains all the required images to run the entire Web3 application. + +## Setup Database + +### Install PostgreSQL With Docker Compose + +- Create a `docker-compose.yml` file with the following content: + +```bash +version: '3' + +services: + postgres: + image: postgres:16-alpine + container_name: indexer_db + restart: always + ports: + - 5432:5432 + volumes: + - .data/postgres:/var/lib/postgresql/data + environment: + POSTGRES_PASSWORD: + healthcheck: + test: ['CMD-SHELL', 'pg_isready -U postgres'] + interval: 5s + timeout: 5s + retries: 5 +``` + +- Run the following command to start the PostgreSQL service: + +```bash +docker compose up -d +``` + +### Datebase Safety + +Install and setup your firewall to only allow connections from the IP address of the machine running the Indexing service. + +```bash +sudo ufw allow from to any port 5432 +``` + +## Install Indexer Service + +### Step 1 - Download the Indexer Service file + +- Donwloand indexing services `docker-compose.yml` file to you machine, which consists of all the images to build and start the various applications. + +```bash +mkdir subquery-indexer && cd subquery-indexer +curl https://raw.githubusercontent.com/subquery/network-indexer-services/main/deploy/docker-compose.yml -o docker-compose.yml + +# extra steps to use local ipfs node +mkdir ipfs +curl https://raw.githubusercontent.com/subquery/network-indexer-services/main/deploy/ipfs/ipfs.sh -o ipfs/ipfs.sh +chmod +x ipfs/ipfs.sh +``` + +### Step 2 - Update the Indexer Service file with Separated Database Information + +- Update the `docker-compose.yml` file with the database information. + +```bash +# 1. remove or commment the postgres section + # postgres: + # image: postgres:16-alpine + # container_name: indexer_db + # ... + +# 2. update the following fields in coordinator section +- --postgres-host= +- --postgres-password= +``` + +### Step 3 - Start the Indexing Service + +Run the following command to start the Indexing service: + +```bash +docker compose up -d +``` + +:::tip Tip +For extra information about starting the Indexing service, please visit from [this section](./install-indexer-locally.md#step-2-start-the-indexing-service). +::: \ No newline at end of file