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
TzKT API endpoints (optional) and connection timeouts
tzkt:
mainnet:
uri: https://api.tzkt.io/v1/
services_uri: https://services.tzkt.io/v1/
base_uri: https://tzkt.io/
timeout: 20
Elastic Search configuration
elastic:
uri:
- http://elastic:9200
timeout: 10
PostgreSQL connection string
db:
conn_string: "host=db port=5432 user=${POSTGRES_USER} dbname=bcd password=${POSTGRES_PASSWORD} sslmode=disable"
OAuth providers settings
oauth:
state: ${OAUTH_STATE_STRING}
jwt:
secret: ${JWT_SECRET_KEY}
redirect_url: https://better-call.dev/welcome
github:
client_id: ${GITHUB_CLIENT_ID}
secret: ${GITHUB_CLIENT_SECRET}
callback_url: https://api.better-call.dev/v1/oauth/github/callback
gitlab:
client_id: ${GITLAB_CLIENT_ID}
secret: ${GITLAB_CLIENT_SECRET}
callback_url: https://api.better-call.dev/v1/oauth/gitlab/callback
Sentry configuration
sentry:
environment: production
uri: ${SENTRY_DSN}
debug: false
Folder to store cached contract sources
share_path: /etc/bcd
IPFS settings (list of http gateways)
ipfs:
- https://ipfs.io
- https://dweb.link
API service settings
api:
project_name: api
bind: ":14000"
swagger_host: "api.better-call.dev"
cors_enabled: false
sentry_enabled: true
seed_enabled: false
networks:
- mainnet
Indexer service settings. Note the optional boost setting which tells indexer to use third-party service in order to speed up the process.
indexer:
project_name: indexer
sentry_enabled: true
skip_delegator_blocks: false
networks:
mainnet:
boost: tzkt
Metrics service settings
metrics:
project_name: metrics
sentry_enabled: true
Scripts settings for data migrations and AWS S3 snapshot registry
scripts:
aws:
bucket_name: bcd-elastic-snapshots
region: eu-central-1
access_key_id: ${AWS_ACCESS_KEY_ID}
secret_access_key: ${AWS_SECRET_ACCESS_KEY}
networks:
- mainnet
- carthagenet
- edo2net
- florencenet
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 unversal (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_ENV
e.g. production or sandboxCOMPOSE_PROJECT_NAME
e.g. bcd-prod or bcd-boxGIN_MODE
release for production, debug otherwiseES_JAVA_OPTS
"-Xms1g -Xmx1g" max RAM allocation for Elastic Search (g for GB, m for MB)
POSTGRES_USER
e.g. rootPOSTGRES_PASSWORD
e.g. rootPOSTGRES_DB
e.g. bcdRABBITMQ_DEFAULT_USER
e.g. guestRABBITMQ_DEFAULT_PASS
e.g. guest
BCD_API_PORT
e.g. 14000ES_REQUESTS_PORT
e.g. 9200RABBITMQ_PORT
e.g. 5672POSTGRES_PORT
e.g. 5432BCD_GUI_PORT
e.g. 8000
GITHUB_CLIENT_ID
GITHUB_CLIENT_SECRET
GITLAB_CLIENT_ID
GITLAB_CLIENT_SECRET
JWT_SECRET_KEY
OAUTH_STATE_STRING
SENTRY_DSN
AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY
STABLE_TAG
required for building & running images e.g. 2.5