Skip to content

Latest commit

 

History

History
159 lines (135 loc) · 3.62 KB

configuration.md

File metadata and controls

159 lines (135 loc) · 3.62 KB

Configuration

BCD configuration is stored in yml files: you can expand environment variables.

Each service has its very own section in the config file and also they share several common sections. There are predefined configs for production, development, sandbox and staging environments.

Production config ./configs/production.yml

rpc

List of RPC nodes with base urls and connection timeouts

rpc:
    mainnet:
        uri: https://mainnet-tezos.giganode.io
        timeout: 20
        requests_per_second: 10

db

PostgreSQL connection string

storage:
  pg: 
    host: ${DB_HOSTNAME:-db}
    port: 5432
    user: ${POSTGRES_USER}
    dbname: ${POSTGRES_DB:-bcd}
    password: ${POSTGRES_PASSWORD}
    sslmode: disable
  timeout: 10
  log_queries: ${POSTGRES_LOG_QUERIES:-false}

sentry

Sentry configuration

sentry:
  environment: production
  uri: ${SENTRY_DSN}
  front_uri: ${SENTRY_DSN_FRONT}
  debug: false

share_path

Folder to store cached contract sources

share_path: /etc/bcd

services

Some third-party services

  services:
    mainnet:
        mempool: https://mempool.dipdup.net/v1/graphql

api

API service settings

api:
  project_name: api
  bind: ":14000"
  cors_enabled: false
  sentry_enabled: true
  seed_enabled: false
  page_size: ${PAGE_SIZE:-10}
  frontend:
    ga_enabled: true
    mempool_enabled: true
    sandbox_mode: false
    rpc:
      mainnet: https://rpc.tzkt.io/mainnet
  networks:
    - mainnet
  connections:
    max: 50
    idle: 10

indexer

Indexer service settings.

indexer:
  project_name: indexer
  sentry_enabled: true
  networks:
    mainnet:
      receiver_threads: ${MAINNET_THREADS:-1}
  connections:
    max: 5
    idle: 5

scripts

Scripts settings for data migrations and AWS S3 snapshot registry

scripts:
  networks:
    - mainnet
  connections:
    max: 5
    idle: 5

Docker settings docker-compose.yml

Connects all the services together. The compose file is pretty straightforward and universal, although there are several settings you may want to change:

  • Container names
  • Ports
  • Shared paths

If you are altering these settings make sure you are in sync with your .yml configuration file.

Local RPC node

A typical problem is to access service running on the host machine from inside a docker container. Currently there's no universal (cross-platform) way to do it (should be fixed in docker 20). A suggested way is the following:

  1. Expose your node at 172.17.0.1:8732 (docker gateway)
  2. For each docker service that needs to access RPC add to compose file:
    extra_hosts:
        sandbox: 172.17.0.1
  3. Now you can update configuration:
    rpc:
        sandboxnet:
            uri: http://sandbox:8732
            timeout: 20     

Environment variables .env

About env files: https://docs.docker.com/compose/env-file/

System config required

  • BCD_ENV e.g. production or sandbox
  • COMPOSE_PROJECT_NAME e.g. bcd-prod or bcd-box
  • GIN_MODE release for production, debug otherwise

Credentials required

  • POSTGRES_USER e.g. root
  • POSTGRES_PASSWORD e.g. root
  • POSTGRES_DB e.g. bcd

Services ports required

  • BCD_API_PORT e.g. 14000
  • POSTGRES_PORT e.g. 5432
  • BCD_GUI_PORT e.g. 8000

Sentry creds required if sentry_enabled: true

  • SENTRY_DSN

AWS settings

  • AWS_ACCESS_KEY_ID
  • AWS_SECRET_ACCESS_KEY

Others

  • STABLE_TAG required for building & running images e.g. 2.5