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.
List of RPC nodes with base urls and connection timeouts
rpc:
mainnet:
uri: https://mainnet-tezos.giganode.io
timeout: 20
requests_per_second: 10PostgreSQL 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 configuration
sentry:
environment: production
uri: ${SENTRY_DSN}
front_uri: ${SENTRY_DSN_FRONT}
debug: falseFolder to store cached contract sources
share_path: /etc/bcdSome third-party services
services:
mainnet:
mempool: https://mempool.dipdup.net/v1/graphqlAPI 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: 10Indexer service settings.
indexer:
project_name: indexer
sentry_enabled: true
networks:
mainnet:
receiver_threads: ${MAINNET_THREADS:-1}
connections:
max: 5
idle: 5Scripts settings for data migrations and AWS S3 snapshot registry
scripts:
networks:
- mainnet
connections:
max: 5
idle: 5
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.
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:
- Expose your node at
172.17.0.1:8732(docker gateway) - For each docker service that needs to access RPC add to compose file:
extra_hosts: sandbox: 172.17.0.1
- Now you can update configuration:
rpc: sandboxnet: uri: http://sandbox:8732 timeout: 20
About env files: https://docs.docker.com/compose/env-file/
BCD_ENVe.g. production or sandboxCOMPOSE_PROJECT_NAMEe.g. bcd-prod or bcd-boxGIN_MODErelease for production, debug otherwise
POSTGRES_USERe.g. rootPOSTGRES_PASSWORDe.g. rootPOSTGRES_DBe.g. bcd
BCD_API_PORTe.g. 14000POSTGRES_PORTe.g. 5432BCD_GUI_PORTe.g. 8000
SENTRY_DSN
AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEY
STABLE_TAGrequired for building & running images e.g. 2.5