@subql/indexer-coordinator

0.3.11 • Public • Published

INDEXER COORDINATOR

Start with Docker

Start all the services: db service coordinator service and proxy service together with docker compose command.

Run Docker Compose

docker-compose up

1

Indexer Management with Admin App

For the default configuration, open the indexer admin app with http://localhost:8000

2

Start With CLI

Install

npm install -g @subql/indexer-coordinator@0.1.1-10

Start Coordinator Service

Start a Postgres DB

Need to start a postgres DB server before run the coordinator service. The following is an example to start a service with docker:

# Install and start the db server
docker run --name "coordinator-server" -e POSTGRES_PASSWORD="postgres" \
    -e PGPASSWORD="postgres" \
    -p 5432:5432 \
    -d postgres

# Create db
docker exec -i "coordinator-server" psql -U postgres -c "create database \"coordinator\""

Run the Coordinator Command

  1. Show all the parameters
# Run the `help` command line
subql-coordinator -help

# All the parameters
Indexer Coordinator
  --network      Network type for the service
            [string] [choices: "local", "testnet", "mainnet"] [default: "local"]
  --ws-endpoint  Specify wss endpoint for this network       [string] [required]
  --port         Port the service will listen on        [number] [default: 8000]

Postgres
  --postgres-host      Postgres host                         [string] [required]
  --postgres-port      Postgres port                    [number] [default: 5432]
  --postgres-username  Postgres username          [string] [default: "postgres"]
  --postgres-password  Postgres password          [string] [default: "postgres"]
  --postgres-database  Postgres database name                [string] [required]

Options:
  --version  Show version number                                       [boolean]
  ---help
  1. Start coordinator service
subql-coordinator --network testnet \
    --ws-endpoint 'https://moonbeam-alpha.api.onfinality.io/public' \
    --postgres-host localhost \
    --postgres-database coordinator \
    --postgres-port 5432 \
    --port 8000
  1. Open Indexer Admin Dapp

Open the indexer-admin app with http://localhost:8000. The domain and port depends on the deployment.

Development

Run the following command to build the local image for the coordinator updates

yarn build:docker-compose

Then start all the services:

yarn start:docker-compose

Readme

Keywords

none

Package Sidebar

Install

npm i @subql/indexer-coordinator

Weekly Downloads

5

Version

0.3.11

License

Apache-2.0

Unpacked Size

19.4 MB

Total Files

152

Last publish

Collaborators

  • onfinality-admin
  • jay_ji