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: 20TzKT 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: 20Elastic Search configuration
elastic:
uri:
- http://elastic:9200
timeout: 10PostgreSQL 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/callbackSentry configuration
sentry:
environment: production
uri: ${SENTRY_DSN}
debug: falseFolder to store cached contract sources
share_path: /etc/bcdIPFS settings (list of http gateways)
ipfs:
- https://ipfs.io
- https://dweb.linkAPI service settings
api:
project_name: api
bind: ":14000"
swagger_host: "api.better-call.dev"
cors_enabled: false
sentry_enabled: true
seed_enabled: false
networks:
- mainnetIndexer 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: tzktMetrics service settings
metrics:
project_name: metrics
sentry_enabled: trueScripts 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
- florencenetConnects 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_ENVe.g. production or sandboxCOMPOSE_PROJECT_NAMEe.g. bcd-prod or bcd-boxGIN_MODErelease for production, debug otherwiseES_JAVA_OPTS"-Xms1g -Xmx1g" max RAM allocation for Elastic Search (g for GB, m for MB)
POSTGRES_USERe.g. rootPOSTGRES_PASSWORDe.g. rootPOSTGRES_DBe.g. bcdRABBITMQ_DEFAULT_USERe.g. guestRABBITMQ_DEFAULT_PASSe.g. guest
BCD_API_PORTe.g. 14000ES_REQUESTS_PORTe.g. 9200RABBITMQ_PORTe.g. 5672POSTGRES_PORTe.g. 5432BCD_GUI_PORTe.g. 8000
GITHUB_CLIENT_IDGITHUB_CLIENT_SECRETGITLAB_CLIENT_IDGITLAB_CLIENT_SECRETJWT_SECRET_KEYOAUTH_STATE_STRING
SENTRY_DSN
AWS_ACCESS_KEY_IDAWS_SECRET_ACCESS_KEY
STABLE_TAGrequired for building & running images e.g. 2.5