Configuration with Docker

How to configure Lisk Service.

Show current configuration

To show the current configuration of Lisk Service, execute the following command:

make print-config
Result for the default config, which will connect Lisk Service to the Lisk Mainnet
networks:
  core_network: {}
  services_network: {}
services:
  core:
    depends_on:
    - postgres_core
    - redis_common
    - redis_core
    environment:
      ENV_LISK_DB_DATABASE: lisk
      ENV_LISK_DB_PASSWORD: password
      ENV_LISK_DB_USER: lisk
      GEOIP_JSON: https://geoip.lisk.io/json
      LISK_CORE_HTTP: https://mainnet.lisk.io
      LISK_CORE_WS: wss://mainnet.lisk.io
      LISK_STATIC: https://static-data.lisk.io
      SERVICE_BROKER: redis://redis_common:6379/0
      SERVICE_CORE_POSTGRES: postgres://lisk:password@postgres_core:5432/lisk
      SERVICE_CORE_REDIS: redis://redis_core:6379/0
      SERVICE_LOG_CONSOLE: "false"
      SERVICE_LOG_FILE: "false"
      SERVICE_LOG_GELF: "false"
      SERVICE_LOG_LEVEL: debug
      SERVICE_LOG_STDOUT: "true"
    image: lisk/service_core
    networks:
      core_network: {}
      services_network: {}
    restart: always
  gateway:
    depends_on:
    - core
    environment:
      HOST: 0.0.0.0
      PORT: '9901'
      SERVICE_BROKER: redis://redis_common:6379/0
      SERVICE_LOG_CONSOLE: "false"
      SERVICE_LOG_FILE: "false"
      SERVICE_LOG_GELF: "false"
      SERVICE_LOG_LEVEL: debug
      SERVICE_LOG_STDOUT: "true"
    healthcheck:
      test: curl --fail http://gateway:9901/api/v1/transactions
    image: lisk/service_gateway
    networks:
      services_network: {}
    ports:
    - 127.0.0.1:9901:9901/tcp
    restart: always
  postgres_core:
    image: postgres:10-alpine
    networks:
      core_network: {}
    restart: always
    volumes:
    - postgres_core_vol:/var/lib/postgresql/data:rw
  redis_common:
    command: redis-server /etc/redis/redis.conf
    healthcheck:
      test: redis-cli ping
    image: redis:5-alpine
    networks:
      services_network: {}
    restart: always
    volumes:
    - /Users/mona/git/lisk-service/docker/redis/redis.volatile.conf:/etc/redis/redis.conf:ro
  redis_core:
    command: redis-server /etc/redis/redis.conf
    healthcheck:
      test: redis-cli ping
    image: redis:5-alpine
    networks:
      core_network: {}
    restart: always
    volumes:
    - /Users/mona/git/lisk-service/docker/redis/redis.persistent.conf:/etc/redis/redis.conf:ro
version: '3.0'
volumes:
  postgres_core_vol: {}

Default configurations

Lisk Service provides different ready-to-use configuration files, which are located in the docker/ folder of Lisk Service.

lisk-service/docker/
├── custom.env
├── docker-compose.betanet.yml
├── docker-compose.custom.yml
├── docker-compose.devnet.yml
├── docker-compose.mainnet.yml
└── docker-compose.testnet.yml

To connect to any of the networks displayed in the snippet above, simply change line 9 in the Makefile file:

Example: How to update the Makefile, to connect to the Betanet with Lisk Service
.PHONY: clean coldstart mrproper up
all: up

compose := docker-compose \
	-f docker-compose.yml \
	-f lisk_service/docker-compose.core.yml \
	-f lisk_service/docker-compose.gateway.yml \
	-f lisk_service/docker-compose.gateway-ports.yml \
	-f docker-compose.betanet.yml (1)
1 Update this line from -f docker-compose.mainnet.yml to -f docker-compose.NETWORK.yml, where NETWORK can be either:
  • betanet

  • custom

  • devnet

  • mainnet

  • testnet

After updating the Makefile as described above, start Lisk Service again:

make up

Lisk Service should now be connected to the desired network.

Custom configuration

.1. The custom.env file

First, open the file docker/custom.env .

The following contents below will be displayed:

## Lisk Service custom configuration

# Lisk Core node
LISK_CORE_HTTP=https://mainnet.lisk.io
LISK_CORE_WS=wss://mainnet.lisk.io

The two existing options LISK_CORE_HTTP and LISK_CORE_WS are examples of how to set config options in this file.

To see a list of the most important options, check out the preconfigured env files in the docker/lisk-service/env/network folder.

To check and view the complete list of all available config options of Lisk Service, go to the configuration reference.

.2. Update the Makefile

How to update the Makefile to use a custom configuration
.PHONY: clean coldstart mrproper up
all: up

compose := docker-compose \
	-f docker-compose.yml \
	-f lisk_service/docker-compose.core.yml \
	-f lisk_service/docker-compose.gateway.yml \
	-f lisk_service/docker-compose.gateway-ports.yml \
	-f docker-compose.custom.yml (1)
1 Update this line from -f docker-compose.mainnet.yml to -f docker-compose.custom.yml.

.3. Start Lisk Service

All that is now remaining is to start Lisk Service again:

In the lisk-service root folder
make up